DRMacIver's Notebook

A Fun Puzzle

A Fun Puzzle

From Twitter:

fun math game:

there are two players, and a machine that outputs a random number between 0.0 and 1.0 when you press a button

(inclusive, chosen uniformly and independently, from the reals, etc) player 1 pushes the button twice, and multiplies the two outputs together to get a score (e.g. 0.45 x 0.9=0.4).

then player 2 pushes the button once, and squares the result to get their score (e.g. 0.67 x 0.67 = 0.4489)

the higher score wins. which player wins more often?

The answer is that player two wins with probability \(\frac{5}{9}\).


I originally just brute forced solved the integral, but it's easier to see after a change of variables. The log of a uniform \(0, 1\) random variable is exponentially distributed with parameter \(1\). So this boils down to the claim that if \(X, Y, Z \sim \textrm{Exp}(1)\) then \(P(X + Y \leq 2Z) = \frac{5}{9}\).

The proof of this is as follows:

\begin{align} P(X + Y \leq 2Z) &= P\left(Z \geq \frac{X + Y}{2}\right) \\ & = \int\limits_{x, y \geq 0} e^{-x - y} \int\limits_{z \geq \frac{x + y}{2}} e^{-z} dz dx dy \\ & = \int\limits_{x, y \geq 0} e^{-x - y} \left(1 - e^{-\frac{x + y}{2}}\right) dx dy \\ & = \int\limits_{x, y \geq 0} e^{-x} e^{- y} dx dy - \int\limits_{x, y \geq 0} e^{-\frac{3}{2} x} e^{-\frac{3}{2} y} dx dy \\ & = \left(\int\limits_{x, y \geq 0} e^{-x} dx\right)^2 - \left(\int\limits_{x, y \geq 0} e^{-\frac{3}{2}x} dx\right)^2 \\ & = 1^2 - \left(\frac{2}{3}\right)^2 \\ & = \frac{5}{9} \\ \end{align}

I still feel like there should be a nicer solution than this. It's a step above just brute force solving the integral in tidiness, but I don't feel it makes it any more intuitive where the actual number comes from.

Update: OK, here is probably as nice as it's going to get.

For a random variable \(A\) define the moment generating function of \(A\) as \(F_A(t) = E(e^{tA})\). Note that if \(A, B\) are independent then \(F_{A + B}(t) = E(e^{t(A + N)}) = E(e^{tA} e^t{B}) = E(e^{tA}) E(e^t{B}) = F_A(t) F_B(t)\).

Note also that if \(Z \sim \mathrm{Exp}(\lambda)\) and \(P(A \geq 0) = 1\) then \(P(Z \geq A) = E(P(Z \geq a | A = a)) = E(e^{-\lambda A}) = F_A(-\lambda)\).

Now, with \(X, Y, Z\) as above, we have:

  1. \(P(X + Y \geq 2Z) = F_{X + Y}(-\frac{1}{2})\) (because if \(Z \sim \mathrm{Exp}(1)\) then \(2Z \sim \mathrm{Exp}(\frac{1}{2})\)).
  2. If \(t < 1\) then \(F_X(t) = F_Y(t) = \int\limits_0^\infty e^{(t - 1)x} = \frac{1}{1 - t}\)
  3. \(F_{X + Y}(t) = F_X(t) F_Y(t) = F_X(t)^2 = \frac{1}{(1 - t)^2}\)

Thus, plugging in the numbers, we have \(P(X + Y \geq 2Z) = \left(\frac{1}{1 + \frac{1}{2}}\right)^2 = \frac{4}{9}\) as desired.

Update 2: Colin's solution is much better than mine.