You are not logged in.
Suppose you are in a hallway lined with 9 closed lockers, which you want to open. In each pass, you must toggle exactly 5 lockers. What is the minimum number of passes will you need to open them all?
How about if you must toggle exactly 6 lockers in each pass?
Last edited by anna_gg (2016-01-06 22:39:47)
Offline
Hi!
I found a way for five lockers with seven passes. Just tinkering at the moment though
Offline
Found a way for six lockers with only five passes though, and don't see the general principle just yet, so perhaps a lot is left to do!
Last edited by Relentless (2016-01-06 23:34:30)
Offline
Theoretically five lockers should be doable with five passes. I don't know how yet but I'll try and find an example.
Six lockers can be done in three passes:
0: CCCCCCCCC
1: CCCOOOOOO
2: OOOOOOCCC
3: CCCCCCCCC
Last edited by Nehushtan (2016-01-07 09:19:31)
240 books currently added on Goodreads
Offline
Five lockers in five passes.
0: CCCCCCCCC
1: CCCCCCCCC → OOOOOCCCC
2: OOOOOCCCC → OOOCCCOOO
3: OOOCCCOOO → OOOOOOOCC
4: OOOOOOOCC → OOOCCCCCO
5: OOOCCCCCO → OOOOOOOOO
Last edited by Nehushtan (2016-01-07 11:22:04)
240 books currently added on Goodreads
Offline
The final status must be OOOOOOOOO, not CCCCCCCCC
Theoretically five lockers should be doable with five passes. I don't know how yet but I'll try and find an example.
Six lockers can be done in three passes:
0: CCCCCCCCC 1: CCCOOOOOO 2: OOOOOOCCC 3: CCCCCCCCC
Offline
The final status must be OOOOOOOOO, not CCCCCCCCC
Nehushtan wrote:Theoretically five lockers should be doable with five passes. I don't know how yet but I'll try and find an example.
Six lockers can be done in three passes:
0: CCCCCCCCC 1: CCCOOOOOO 2: OOOOOOCCC 3: CCCCCCCCC
Oops.
Well, it looks like some configurations are impossible after all.
Of course. It has to do with parity! If you toggle 6 times, you change the total number of open/closed lockers by an even number. Since there are an odd number of closed lockers to start with, you can never get them all open!
240 books currently added on Goodreads
Offline
You must toggle the lockers by a total of 9+2x times (an odd number of moves), so that they are all turned open (9 moves) and 2x (that is, an even number) moves to open/close them. A workable solution would be 12345, 12367, 12389. This way we need 3 passes.
I agree for the second option (6 at a time): you cannot do it, because an odd number of moves (in total) is needed, but with 6 moves in each pass, we cannot get an odd number!
Offline
Well it looks like we all made some mistakes with this one, although it doesn't seem difficult enough to warrant it. My "solution" for six toggles, obviously, involved an illegal step. The problem is that with six toggles, you cannot get an even number of closed lockers; and six is even.
anna_gg - so how do we determine the minimum number of passes? Is it x, or is it 9+2x divided by our number of toggles?
For example, with 7 toggles, can it be done in three passes because 21/7 = 3, or can it only be done in six passes because x = 6
Edit: The answer is three passes.
First pass: Open 7 (2 closed)
Second pass: Open 1, close 6 (7 closed)
Third pass: Open 7
In fact, the answer is three passes for 3, 5 and 7 toggles, and trivially, 9 for 1 and 1 for 9, as the formula predicts.
Last edited by Relentless (2016-01-08 02:47:01)
Offline