Geeks Talk

Prepare for your Next Interview




How many lockers are then opened?

This is a discussion on How many lockers are then opened? within the Brainteasers forums, part of the Brain Gym category; In a boarding school the students go into the locker room and stand by their closed lockers. At the first blow of a whistle, the students open every locker. At ...


Go Back   Geeks Talk > Brain Gym > Brainteasers

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 04-30-2007
Expert Member
 
Join Date: Apr 2007
Location: Kolkata
Posts: 151
Thanks: 3
Thanked 10 Times in 9 Posts
debleena23 is on a distinguished road
Thumbs up How many lockers are then opened?

In a boarding school the students go into the locker room and stand by their closed lockers. At the first blow of a whistle, the students open every locker. At the second whistle, the students close every second locker (lockers 2,4,6 etc. are slammed shut). At the third whistle, the students toggle every third locker. To toggle means to close it if it's open, and to open it if it's close. They toggle lockers 3,6,9 etc. At whistle four they toggle every fourth locker. At the whistle 5, they toggle every 5th locker, and so on....
There are 100 lockers, at the 100th whistle, the student standing next to locker 100 (and only that student) toggles his locker. How many lockers are then opened?
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-30-2007
Contributing Member
 
Join Date: Sep 2006
Location: bangalore, india
Posts: 1,007
Thanks: 0
Thanked 76 Times in 64 Posts
psuresh1982 will become famous soon enough
Re: How many lockers are then opened?

I think ony one locker opened, that is first locker.

---------------------
suresh
Reply With Quote
  #3 (permalink)  
Old 05-09-2007
Expert Member
 
Join Date: Jan 2007
Location: Pune
Posts: 279
Thanks: 6
Thanked 4 Times in 4 Posts
smart_coder is on a distinguished road
Re: How many lockers are then opened?

10 lockers.
All those lockers with locker number equal to a perfect square will remain open, i.e 1, 4, 9, 16, 25, 36, 49, 64, 81, 100
For a locker to remain open it has to be toggled an odd number of times.
e.g
open or open-close-open or open-close-open-close-open and so on.

Since the perfect squares have odd number of factors, the locker number equal to perfect square will remain open.

Like locker number 36.
On first whistle it will get open.
On second whistle it will get closed.
On third whistle it will get open.
On fourth whistle it will get close.
On sixth whistle it will get open.
On ninth whistle it will get closed.
On twelth whistle it will get open.
On eighteenth whistle it will get closed.
On thirtysixth whistle it will get open.
__________________
[B][COLOR="Blue"]Anyone who thinks he knows all the answers, must not be up-to-date on the questions[/COLOR][/B]
[B]Anshul[/B]:)
Reply With Quote
Reply

  Geeks Talk > Brain Gym > Brainteasers


Thread Tools
Display Modes



All times are GMT -4. The time now is 12:49 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved