TCS
Company
Logical Reasoning
Logical Sequences
There r 1000 lockers and 1000 students in a school. the principal asks the 1st student to go to every locker and open it. then he has the 2nd student go to every 2nd locker and close it. the 3rd goes to every 3rd locker and, if it is closed he opens it, and if it is open, he closes it. the fourth student does this to every fourth locker and so on. the process is completed with the 1000th student. How many lockers are open?
Read Solution (Total 6)
-
- 31
all perfect square numbered lockers like 1,4,9,16...961 - 12 years agoHelpfull: Yes(22) No(1)
- only the perfect square numbered doors have the odd number of times operated...
here only the odd number of times operated doors are open..
so the answer is 31 - 12 years agoHelpfull: Yes(4) No(0)
- Set up a chart (first row is locker number...below is the student # (1 for first, 2 for second, 3 for third, etc.) O is open, x is closed:
L 1 2 3 4 5 6 7 8 9
1 o o o o o o o o o
2 o x o x o x o x o
3 o x x x o o o x x
4 o x x o o o o o x
and so on, just large enough to get a pattern.
When you do (and if you do it correctly), you will hopefully get that the only open lockers are the locker numbers that happen to be perfect squares.
To answer the question, you need to know how many perfect squares there are that are less than 1000.
31^2 < 1000 < 32^2
so the number of lockers left open will be 31.
- 12 years agoHelpfull: Yes(3) No(1)
- garima please explain how?
- 12 years agoHelpfull: Yes(1) No(3)
- ABA NUV CHEPU ANTE KANI VERE VALANI CHEPAMANAKARLEDU ARDAMAINDI ANUKUNTA KADA BALA SUBRAHMANYAM
- 12 years agoHelpfull: Yes(0) No(9)
- to solve this type of problem use the square of the natural number up the total number of cases....
eg. if 100 cases are given then use k - 10 years agoHelpfull: Yes(0) No(2)
TCS Other Question