Sei sulla pagina 1di 4

Suppose you are in a hallway with 100 closed lockers. You begin opening every locker.

Then you close every second locker. Then you go to every third locker and open it (if it's
closed) or close it (if it's open). Let's call this action toggling a locker. Continue toggling
every nth locker on pass number n. After 100 passes, where you toggle only locker #100,
how many lockers are open?

Understand the Problem


In a hallway full of 100 lockers you start to open every locker. Then you close every second
locker from the beginning. Then on your third turn back you open the locker if its closed or you
close the locker if its open (called toggling a locker). Continue every turn toggling every nth
locker when you pass number n. Once you have only toggled locker 100 after your 100th pass,
how many lockers are open? We are asked to find how many lockers stay open after the 100th
pass.

Devise a Plan
First we are going to make a table. We will fill the table with our clues from the story that can be
used to find a pattern. We will start off with solving a simpler problem with the first 1-10 lockers
to see if we can find a pattern. Once we find a pattern we will check if it checks out with our
statement. We will use these methods so we can find what lockers will be open after a certain
amount of passes.

Carry Out the Plan


Step 1: Make a table
​Here we are solving what lockers have been open from 1 -10 or closed. After the 3rd
pass we continue to toggle every nth pass which can either end up opened or closed.
Locker nth n # of passes Turns toggled (opened or closed)

1 Open Start with Every locker open (1st pass)

2 Open, close All even numbers are closed (1st and 2nd
pass)

3 Open, close From here on every nth locker is toggled


so 3 is toggled because of 3rd pass (1st
and third pass)

4 Open, close open 4 is toggled because of 4th pass (1st, 2nd


& 4th pass)

5 Open, close 5 is toggled on the 5th pass (1st and 5th


pass)

6 Open, close, open, close 6 is toggled on the 3rd & 6 pass (1st, 2nd,
3rd, 6th pass)

7 Open, closed 7 is toggled on the 7th pass (1st& 7th


pass)

8 Open, closed, open, closed 8 is toggled on the 4th & 8th pass (1st,
2nd, 4th, & 8th pass)

9 Open, closed, open 9 is toggled on the 3rd & 9th pass (1st,
3rd & 9th pass)

10 Open, closed, open, closed 10 is toggled on the 5th and 10th pass
(1st, 2nd, 5th, & 10th pass)

Step 2: Find the pattern


From this table we see that each locker is toggled by its factor. Odd numbered lockers are only
toggled by its (nth) number and do not toggle again because it is a prime number (it’s only
factors are one and itself).
1*3 =3 1*5=5 1*7=7

The only lockers open from 1-10 are 1, 4, and 9. The difference is that these lockers have an odd
number of passes to end up open compared to the rest that are closed with an even amount of
passes. Therefore, lockers with numbers that have an even amount of factors will always end up
closed since we started with opening all the lockers first. While Lockers with an odd number of
factors will end up open.
Opened lockers (odd amount of factors) Closed Lockers (even amount of factors)
1: 1 2:1, 2
3:1, 3
4: 1, 2, 4
5:1, 5
6:1, 2, 3, 6
7:1, 7
8:1, 8
9: 1, 3, 9
Now looking at lockers 1,4, and 9 that are open we look for the pattern. We can see that these are
also numbers that can be square rooted.
1^2=1 2^2=4 3^2=9
This pattern can be seen as this formula: n^2 = opened locker
This means that only numbers that are squared from 1-100 can be opened lockers. Therefore, we
can get rid of all numbers with an even amount of factored pairs and cannot be squared.

Step 3: Check to confirm statement


We need to check our statement with other lockers from 11-100. Let’s check with an Odd
numbered locker
Ex: Locker 57 is open,close, open, close (open because we passed all lockers and opened them.
Close because we toggled on the 57 pass). Pattern is that it’s two factors are one and fiftyseven.
This confirms that the locker closes with an even amount of factored pairs.

Find numbered lockers that can be a Squared Number


Ex: Locker 49 is opened or closed?
49 factors are : 1,7,49 it is open! Only 3 factors (3 passes toggled twice).
Can it be squared? 7*7=49 yes.

Step 4: Find squared numbers with odd factored pairs


Find squared numbers from 1-100 and check if they have an odd amount of factored pairs.
Using our formula: n^2
Numbers that can be squared Odd # of Factored pairs
1: 1^2 1
4: 2^2 1,2,4
9: 3^2 1,3,9
16: 4^2 1,2,4,8,16
25: 5^2 1,5,25
36: 6^2 1,2,3,4,6,9,12,18,36
49: 7^2 1,7,49
64: 8^2 1,2,4,8,16,32,64
81: 9^2 1,3,9,27,81
100: 10^2 1,2,4,5,10,20,25,50,100
The answer: 10 lockers are open.
Lockers 1, 4, 9, 16, 25, 36, 49, 64, 81, 100 stay open after the 100th pass.

Look back
The steps I used in carrying out my plan were to first make a table from 1-10 to solve a simpler
problem, find a pattern, and check my statements. Since it was 100 lockers I wanted to cut it
short to 1-10 to solve a simpler problem, and also help me to solve the initial problem. My
second step was to find a pattern from 1-10. All numbers would toggle on their factors. In this
step, I grouped numbers and separated them by lockers that ended up open and ones that did not.
The ones that ended up closed were numbers with an even amount of factors. While the opened
lockers had an odd amount of factors. The opened lockers can also be squared. To make sure, I
made sure to add another step to check our statements. Also, I had to make sure that every
number that can be square rooted has an odd amount of factored pairs. The last step was to find
all the lockers opened from 1-100 that had an odd amount of factored pairs and can be square
rooted. Another way to solve this problem could be using a visual aid (100s chart). Then write
the nth number of passes on the numbers we pass and toggle and label it open or closed. Have
“o” represent opened and “c “ represent close. For example: on locker 4 we would write
(1^o,2^c,4^o). Doing so for passes 1-100 or less would help us see that there is a pattern.

Potrebbero piacerti anche