the theater seating puzzle (2023 Update)

All engineers are mathematicians, who enjoy puzzles. Probability theory is a stock part of the curriculum, so...

A theater has 15 seats in the first row. Patrons enter in single file, taking each consecutive seat, as they arrive. In this particular case, there are 8 boys, 7 girls.

If a boy and girl occupy adjacent seats, we have a candidate match. If boy sees girl on each side, that's two matches. Clearly, any possible arrangement will contain 1...14 candidate matches.

What's the average number of matches, for this row?

I found this in a book of math problems, it's a nice little exercise. However, my motivation here is mainly due to the fact that the author's reasoning, in his solution, is severely flawed. I think.

Take a crack at it. In a few days, I'll post the book solution, with my critique. Then you tell me where I'm wrong.

Or, if I'm right, yet somehow the book's solution is numerically correct, we have the challenge of explaining that miracle. Which is more interesting than the problem itself -

Reply to
RichD
Loading thread data ...

If the boys and girls are of dating age it is pretty certain there will be 14 candidate matches. They enter single file but no one said they entered randomly.

Reply to
Rick C

Anytime there is talk of averages I think of it as if your head is in liquid nitrogen and your feet is in a fire. The average temperature may be 72 deg F. but one end burns up and the other end is frozen solid. You are dead from both ends.

Reply to
Ralph Mowery

I used to enjoy puzzles and chess. But I have to think all day at work, so I don't want to do that for free any more.

Real puzzles are better than made-up ones.

Reply to
jlarkin

Yes - I was going to comment that Rich probably wanted to ask what is the statistically median number of matches.

CH

Reply to
Clifford Heath

I've found that hypothetical puzzles, or other people's puzzles, can be a worthwhile academic exercise as the underlying method to solve them often becomes helpful later in life (personal and / or work).

Reply to
Grant Taylor

Programming the permutations gives me 7.466666.. which is (7 * 16 / 15). Those numbers are suggestive.

This matches the result I get by simulation.

Trying to do it algebraicly suggests it will still produce 28 distinct terms to be calculated, which is presumably not the intent.

Sylvia.

Reply to
Sylvia Else

There is a trick in that all the middle seats are equivalent through having two nearest neighbours so you can easily compute the probability of a seat gap being a 0-1 or 1-0 transition. The gaps are all identical! (each gap between the seats has exactly one seat on either side)

So the closed form solution for N = 2n+1 seats is:

(N+1)(N-1)/(2N)

Or substituting N = 2n+1

(n+1)(2n)/(2n+1)

Where in this case n=7, N=15 (though I would write it as 14*8/15) (since there are 14 adjacent seats and 8 boys)

That gives the same result as you have observed experimentally.

I did check it by brute force simulation going from N=3 & N=5 where I started by hand out to N=31 by computer and it still holds. You could easily generalise it for any ratio of girls and boys.

Reply to
Martin Brown

Tennis isn't push ups, but push ups are a useful exercise for a tennis player -

Reply to
RichD

Finally, someone shows some sense!

Reply to
RichD

So did this match the result in the book?

Sylvia.

Reply to
Sylvia Else

You still haven't explained why you think the book got it wrong!

Reply to
Martin Brown

I did.

The pairs of seats aren't independent. Consider the leftmost three seats; two pairs. The middle seat is common to both. So one can't simply calculate the mean for a single pair, then generalize to 14 pairs, as the linearity theorem doesn't hold.

There are C(15,8) seating arrangements, where C is the combination formula: "from n, choose c"

The only sure thing is a brute force program, which checks every one, tallying the candidate matches in each.

Reply to
RichD

It asks only for the *average* and that can be computed without having to grind through all of the permutations by sheer brute force.

Consider the solution vectors for the simplest case of three seats and the original problem with girl = 0, boy = 1

0 0 1 bitrev 1 0 0 0 1 0 symmetric

Your argument that there is an end effect although true is exactly cancelled out by the corresponding bitreversed seating pattern or by symmetry. The book's method gives the right answer with the least effort through understanding the inherent symmetry of the problem.

One of my mathematics professor friends specialized in setting exam questions that could be done either by slogging away with brute force and a standard method or thinking clearly and finding the easy way. His questions were useful for picking out future likely mathematicians.

You can check the algebraic result by doing that which is what I did. Hence the practical limitation of 31 seats.

Reply to
Martin Brown

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.