• 0

Filling a room

Question

Posted · Report post

You have an empty room, and a group of people waiting outside the room. At each step, you may either get one person into the room, or get one out. Can you make subsequent steps, so that every possible combination of people is achieved exactly once?

0

Share this post


Link to post
Share on other sites

2 answers to this question

  • 0

Posted (edited) · Report post

Label each person 1..n.

In the table below the first column represents the person switching their in-room state, the second column lists the people in the room.

Method is:

i. put person 1 in room.

ii. put next person in room, then repeat the sequence of movers that preceded this last entrant. (Of course, they'll be going in the opposite direction, this time.)

iii. repeat step ii. until all 2^n states (including the 0 state the room started in) have been visited.

Proof that the method works is inductive on n. (Left as exercise to reader.)

<empty>

1 1

2 12

1 2

3 23

1 123

2 13

1 3

4 34

1 134

2 1234

1 234

3 24

1 124

2 14

1 4

… …

Edited by austinm
0

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Proof that the method works is inductive on n. (Left as exercise to reader.)

By the way, I wasn't just being coy here. The proof is a bit interesting--contains one or two knots that have to be thought-through carefully--and is worth taking five minutes to lay out.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.