Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2016-01-06 22:33:31

anna_gg
Member
Registered: 2012-01-10
Posts: 232

9 lockers

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

#2 2016-01-06 23:10:34

Relentless
Member
Registered: 2015-12-15
Posts: 631

Re: 9 lockers

Hi!

I found a way for five lockers with seven passes. Just tinkering at the moment though

Offline

#3 2016-01-06 23:33:01

Relentless
Member
Registered: 2015-12-15
Posts: 631

Re: 9 lockers

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

#4 2016-01-07 09:18:48

Nehushtan
Member
Registered: 2013-03-09
Posts: 957

Re: 9 lockers

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

#5 2016-01-07 09:48:08

Nehushtan
Member
Registered: 2013-03-09
Posts: 957

Re: 9 lockers

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

#6 2016-01-07 10:52:46

anna_gg
Member
Registered: 2012-01-10
Posts: 232

Re: 9 lockers

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

Offline

#7 2016-01-07 11:01:19

Nehushtan
Member
Registered: 2013-03-09
Posts: 957

Re: 9 lockers


[list=*]
[*]
[/*]
[/list]





[list=*]
[*]
[/*]
[/list]


Last edited by Nehushtan (2016-01-07 11:13:48)


240 books currently added on Goodreads

Offline

#8 2016-01-07 11:11:56

Nehushtan
Member
Registered: 2013-03-09
Posts: 957

Re: 9 lockers

anna_gg wrote:

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

#9 2016-01-07 22:33:53

anna_gg
Member
Registered: 2012-01-10
Posts: 232

Re: 9 lockers

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

#10 2016-01-08 02:13:49

Relentless
Member
Registered: 2015-12-15
Posts: 631

Re: 9 lockers

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

#11 2016-01-08 02:58:18

Nehushtan
Member
Registered: 2013-03-09
Posts: 957

Re: 9 lockers

That was a fun puzzle. Thanks for posting it, Anna. Please post some more! big_smile


240 books currently added on Goodreads

Offline

Board footer

Powered by FluxBB