David R. MacIver's Blog
A Fun Puzzle
This post was originally published at notebook.drmaciver.com.
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 ().
Why?
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 (1)) then (P(X + Y 2Z) = ).
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 ()) and (P(A ) = 1) then (P(Z A) = E(P(Z a | A = a)) = E(e^{-A}) = F_A(-)).
Now, with (X, Y, Z) as above, we have:
- (P(X + Y 2Z) = F_{X + Y}(-)) (because if (Z (1)) then (2Z ())).
- If (t < 1) then (F_X(t) = F_Y(t) = _0e{(t - 1)x} = )
- (F_{X + Y}(t) = F_X(t) F_Y(t) = F_X(t)^2 = )
Thus, plugging in the numbers, we have (P(X + Y 2Z) = ()^2 = ) as desired.
Update 2: Colin’s solution is much better than mine.