Beefy Boxes and Bandwidth Generously Provided by pair Networks chromatic writing perl on a camel
Perl Monk, Perl Meditation
 
PerlMonks  

Re: CarTalk Puzzler

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

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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 chas (Priest) on Nov 17, 2005 at 15: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.
Re^2: CarTalk Puzzler
by Aristotle (Chancellor) on Nov 18, 2005 at 08: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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://509405]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.