Math Challenge

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: midwestfisherman
Anyone else want to take a shot at this? :)

I don't know what is left to do, since I already simulated all 1,000,000 openeings and closings of lockers. You want me to run the script again and see if the outcome changes? :)
 

TuxDave

Lifer
Oct 8, 2002
10,571
3
71
Is there really a clean way to answer this? I see the mathematical solution, but it kinda sucks. If the locker has an odd number of possible factors, then it will remain open. Otherwise it'll remain closed.

eg.

36 has 1,2,3,4,6,9,12,18,36: 9 factors so it'll remain open

18 has 1,2,3,6,9,18: 6 factors so it'll remain closed
 

HonkeyDonk

Diamond Member
Oct 14, 2001
4,020
0
0
Originally posted by: midwestfisherman
Just wondering if anyone can solve this problem...

Imagine you are at a school that still has student lockers. There are 1000 lockers, all shut and unlocked, and 1000 students.

Here's the problem:

1. Suppose the first student goes along the row and opens every locker.

The second student then goes along and shuts every locker divisible by the number 2.

1. The third student changes the state of every third locker divisible by the number 3. (If the locker is open the student shuts it, and if the locker is closed the student opens it.)

2. The fourth student changes the state of every fourth locker divisible by the number 4.

Imagine that this continues until the thousand students have followed the pattern with the thousand lockers. At the end, which lockers will be open and which will be closed? Why?

Good luck! :D


kinda confused on the "every third locker divisible by 3" Does that mean he just goes down and changes the state of locker 3,6,9,12,15,etc.? Or does that mean he changes 9,18,27 (every 3rd locker divisible by 3).
 

przero

Platinum Member
Dec 30, 2000
2,060
0
0
"Quote

--------------------------------------------------------------------------------
Originally posted by: przero
#25 opened by Student 1 and closed by student 5.
--------------------------------------------------------------------------------


And reopened by student 25."

Studnet 25 is to reopen every 25Th locker divisible by 25, i.e. the locker #625!
 

HonkeyDonk

Diamond Member
Oct 14, 2001
4,020
0
0
Originally posted by: przero
"Quote

--------------------------------------------------------------------------------
Originally posted by: przero
#25 opened by Student 1 and closed by student 5.
--------------------------------------------------------------------------------


And reopened by student 25."

Studnet 25 is to reopen every 25Th locker divisible by 25, i.e. the locker #625!

see, thats the part that really confuses me, the wording of the rules. Why would you write "reopen every 25th locker divisible by 25" If you are meaning student #25 opens locker 25,50,75,100,etc, shouldn't you write it as:

"change state every 25th locker" -or- "change state every locker that is divisible by 25"

Saying "change state every 25th locker that is divisible by 25" suggests that you only change locker #625 b/c by following the pattern, 25,50,75....the 25th locker that is divisible by 25 is going to be 625. (25x25).

Does anyone get what I'm saying?