Sticking it to the Genie

Probability, Logic: Medium

Photo by Ove Tøpfer from https://freeimages.com

The Genie's magic stick

This is from this week’s Riddler:

One day you stumble across a magic genie, who says that if you play a simple game with him, you could win fabulous riches. You take the genie up on his offer, and he hands you a stick of length 1. He says that behind his back is another stick, with a random length between 0 and 1 (chosen uniformly over that interval).

Next, you must break your stick into two pieces and present one of those pieces to the genie. If that piece is longer than the genie’s hidden stick, then you win a prize of $1 million times the length of your remaining piece. For example, if you present to the genie a length of 0.4, and that’s longer than the genie’s stick, then you win $1 million times 0.6, or $600,000. However, if the genie’s stick is longer, then you win nothing.

Being a regular reader of The Riddler, you crunch some numbers and prepare to break your stick in half. But then you have a thought. You ask the genie if you can have more than one turn. For example, if you present the genie with a length of 0.4, but the genie’s stick is longer, can you break off a piece of the remaining length of 0.6 — say, a length of 0.5 — and then present that to the genie? To keep things fair, your winnings will still be proportional to the leftover length. So had the genie’s length indeed been between 0.4 and 0.5, your first and second guesses, then the remaining length would have been 0.1, and you would have won $100,000.

The genie doesn’t think any of this really matters and says you can have as many turns as you desire. If your goal is to maximize your expected winnings, what will your strategy be? And how much money would you expect to win on average?

Solution preamble:

For the single round case, it is easily seen that the optimal strategy (and the only one) is to offer the genie a stick of length = 0.5 for an expected payout of 0.5 X 0.5 = 0.25 reward units or $250,000. (Let’s keep things simple and consider $1M to be 1 reward unit)

This question is only interesting because of the option to go multiple rounds—infinitely many if needed—offered by the Genie, leading to the question, can we do better than 0.25 reward units? What do you think? 

The Answer (**Spoiler Alert**):`

 Sorry: there’s no way to increase expected winnings beyond 0.25 units. A little probing of the problem reveals that while you cannot do any better than expected winnings of 0.25, there are other solutions possible when going two rounds. (A round only counts as a round if it involves presenting the genie with a stick of non zero length!). Go more than two rounds and your expected winnings drop! This was counter intuitive and made this puzzle interesting for me.

wizard
Photo by Artem Maltsev: https://unsplash.com/@art_maltsev

Solution (proof):

Let’s first look at the simple case of going exactly 2 rounds. This is instructive before venturing into the general case of \(n\) rounds.

Let \(x_1\) be the first non zero stick length presented and \(x_2 \gt x_1\) be the second, if the first one ends up being shorter than the Genie’s. 

Now the expected reward units \(R_2\) (remember we are counting $1M = 1 unit) is calculated as:

\begin{align*}
R_2 &= (\textit{round 1 payoff}) \cdot P(\textit{winning round 1}) \ + \ (\textit{round 2 payoff}) \cdot P(\textit{winning round 2 having lost round 1}) \ + \ 0 \cdot (\textit{losing in round 2}) \\ \\
&=(1-x_1)x_1 + (1-x_1-x_2)(x_2-x_1) \\ \\
&=x_2 – {x_2}^2 \\
\end{align*}

This, as you notice does not depend on \(x_1\) ! Also, it’s simple to determine that the maximum value occurs at \(x_2 = 0.5\) and the max expected reward units are 0.25. This is the same as what we got in the single round game.

So the 2 round game solution is: pick any \(0 \lt x_1 \lt 0.5 \) for round 1 and if you lose, then present Genie with stick \(x_2 = 0.5\) in round 2 for total expected winnings of 0.25 units. Clearly then there are infinite solutions here all resulting in the same expected winnings.

But what if we were to go beyond 2 rounds? Are we still limited to expected winnings of 0.25? If so, will we at least have more choices/solutions? Turns out, the answers are YES and NO, respectively. Here’s why:

As before consider \(n \) rounds with stick lengths \(x_1, x_2,…x_n \) with  \(0 \lt x_1 \lt x_2 \lt…\lt x_n \leq 0.5 \). Now the expected reward \(R_n\) can be written as 

\begin{align*}
R_n &=(1-x_1)x_1 + (1-x_1-x_2)(x_2-x_1) + (1-x_1-x_2 – x_3)(x_3-x_2)) + …+ (1 – x_1-x_2-x_3…-x_n)(x_n-x_{n-1}) \\ \\
&= \sum_{i=1}^{n}(1 – \sum_{j=1}^{i}x_j)(x_i – x_{i-1}) \qquad \tag{1} \label{eq1} \qquad (\textit{more compact notation if you prefer})
\end{align*} 

Let’s start with the case of \(n = 3\) which is illustrative of the general solution. The above equation simplifies to:

\[
R_3 = x_3 – x_1(x_3-x_2) – x_3^{2}
\]

Now here are the implications of this:

  • Since \(x_3 \gt x_2\) the second term above is overall less than zero. Which implies \(R_3 \) is maximized when the first cut \(x_1\) is 0 
  • This is the same as playing just a 2 round game which with \(x_1 = 0\) can be maximized as before with any \(0 \lt x_2 \lt 0.5 \) and \(x_3 = 0.5\) for total expected winnings of 0.25 units
  • If we forced this to be a three round game picking a non zero \(x_1\), we will reduce expected winnings! 

We’ve just learned that we can never play 3 rounds and do better! What if we played more than 3? We can now easily show that we will necessarily reduce our expected winnings if we play any number of rounds greater than 2.

If we take our general \(n\) round winnings \(R_n\) from \(\eqref{eq1}\) above and group all the terms containing \(x_1\), (the first cut stick length presented to the Genie), we get:

\begin{align*}
R_n &= \textit{a bunch of terms not containing} \ x_1 \ + \ … \ \ [-x_1(x_3-x_2) \ – \ x_1(x_4-x_3) \ – \ x_1(x_1-x_5) \ – \ … \ – \ x_1(x_n – x_{n-1})] \\ \\
&= \textit{non} \ x_1 \ \textit{terms} \ + \ … \ \ -x_1(x_n-x_2)
\end{align*}

Which, as before, knowing that \(x_n \gt x_2\) implies that it is maximized by picking the first cut \(x_1 = 0\) ! i.e. reduce it to an \(n-1\) round game. This of course by iterative/same logic results in it further becoming an  \(n-2\) round game, going all the way back to when it is only 2 rounds!

Hence you cannot play more than 2 rounds and do better.

Closing Thoughts: How will you play?

So then is the Genie is right in thinking “none of this really matters…”? 

Ans: Not exactly. This is because even though playing two rounds doesn’t change the expected rewards it does change the Variance/Standard deviation of the result: i.e. the spread around the expected 0.25 rewards. You can interpret this as risk-reward tradeoff. Compare it with the classic: I give you $10 with certainty or allow you to flip a coin for a chance to win $20 if you call it right or $0 if you lose. Clearly, the expected reward in both cases is $10 but the two offers are not identical. The gamblers might want to win big or go home with nothing, while others might prefer the certainty of $10.

In the same way, playing two rounds increases the possibility of big winnings in a small number of cases offset by a smaller win in the majority of cases (higher variance/standard deviation) vs. the one round where you win either 0 or 0.5 with equal likelihood  (hence the smallest standard deviation of 0.25). 

More specifically, the standard deviation for any \(0 \leq x_1 \leq 0.5 \) in a two round game is \(\sqrt{-x_1^2 +\displaystyle{\frac{x_1}{4} + \frac{1}{16} }}\) and is at a maximum when you pick the first cut at \(x_1 = 0.25\) at \(\sim\) 0.3 reward units.

I personally would sort of swing for the fences picking \(x_1\) = 0.1 to win $900K with a 10% chance or $400K with a 40% chance. How would you play this with the Genie if you had the chance? 

Like this content? Subscribe by email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Comments