Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: CarTalk Puzzler

by tbone1 (Monsignor)
on Nov 17, 2005 at 13:57 UTC ( [id://509405]=note: print w/replies, xml ) Need Help??


in reply to CarTalk Puzzler

    The Hall of 20,000 Ceiling Lights

    There are 20,000 lights on. A person comes through and pulls the cord on every second light. A third person comes along and pulls the cord on every third light, etc. When someone comes who pulls every 20,000th chain, which lights are on?

Um, only the first light is on; all the others have had their plugs pulled. Obvious, isn't it, or am I missing something?

I mean, I'm all for trying to solve things programmatically, but do we need a program for this?

--
tbone1, YAPS (Yet Another Perl Schlub)
And remember, if he succeeds, so what.
- Chick McGee

Replies are listed 'Best First'.
Re^2: CarTalk Puzzler
by Aristotle (Chancellor) on Nov 18, 2005 at 13:35 UTC

    That confused me too. After reading the responses, I figured out that the puzzle refers to the cord – not plug – that switches a light on and off. So if a light has its cord pulled once, it’s off, twice, it’s on again, thrice, off again, etc. So the guy who pulls every 3rd cord will switch the 6th light back on, as well as the 12th, the 18th, etc. (In fact, he turns one light back on for each light that he turns off.)

    Hope that clears the confusion.

    (And that you weren’t jesting.)

    Makeshifts last the longest.

Re^2: CarTalk Puzzler
by chas (Priest) on Nov 17, 2005 at 20:20 UTC
    Well, consider that light number 4 is originally on, then gets turned off since it is a multiple of 2, then gets turned on since it is a multiple of 4, and then that's it for number 4.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://509405]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-26 07:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found