aez-notes

The Theatre Row

Eight eligible bachelors and seven beautiful models happen randomly to have purchased single seats in the same 15-seat row of a theatre. On the average, how many pairs of adjacent seats are ticketed for marriagable couples?

Assuming only heterosexual couples are marriagable — this is an old book — we can solve this with recursion where the n_m function indicates the number of pairs if there is a male added to the rightmost end and n_f the number if a female is added to the rightmost end.

mean_matches(m,f) :=
if is(equal(min(m,f), 0))
then 0
else (
  if is(equal(m + f, 2))
  then 1
  else (m * n_m(m-1,f) / (m+f) + f * n_f(m,f-1) / (m+f)));


n_m(m, f) :=
if is(equal(f, 0))
then 0
else (
  if is(equal(m, 0))
  then 1
  else m * n_m(m-1,f) / (m + f) + f * (1 + n_f(m, f-1) )/ (m + f));

n_f(m, f) :=
if is(equal(m, 0))
then 0
else (
  if is(equal(f, 0))
  then 1
  else m * (1 + n_m(m-1,f)) / (m + f) + f * n_f(m, f-1)/ (m + f));

is(equal(mean_matches(0,0), 0));
is(equal(mean_matches(0,1), 0));
is(equal(mean_matches(1,0), 0));
is(equal(mean_matches(1,1), 1));

mean_matches(8,7), numer;
/* approx 7.467 */

Consider the random variable, \(I_i\), which is the indicator of a marriagable pair sitting in the \(i\)-th pair of seats. The total number of marriagable pairs is the sum of these indicator variables. These random variables are correlated, but this does not influence the expected value since it is a linear operator. This suggests and alternative solution. The probability that \(I_i=1\) is \(2 m f / ((m+f)(m+f-1)) \).

expected_matches(m,f) := (m+f-1) *2 * m * f / ((m + f)*(m + f - 1));

for m thru 8 do
 (for f thru 8 do
   (
     print(is(equal(expected_matches(m,f),mean_matches(m,f))))
   )
 )

Author: Alex Zarebski

Created: 2022-04-15 Fri 12:29

Validate