পরিমাণগত অর্থায়ন · বই 18 · ক্যারিয়ার

Interviews I: Maths, Probability and Speed

এই বইটি এখনো বাংলা ভাষায় পাওয়া যায় না। সংস্করণ: English, Français।

Interviews I: Maths, Probability and Speed · ক্যারিয়ার

14Optimal Stopping

Deciding when to stop, by working backwards from the last decision. A threshold is the value of continuing, and most of these questions come down to finding that one number. The later ones ask what information is worth, and when no stopping rule can help at all.

Question 14.1 ★ QR, QT, Trader, Analyst • any • junior

You roll a fair die and are paid its value in dollars, but you may reject the roll and roll again, taking the new value. With one possible re-roll, when should you keep and what is the game worth? And with two possible re-rolls?

Answer

Answer to Question 14.1.

With one re-roll, keep 4, 5 or 6, and the game is worth 4.254.25. With two re-rolls, keep 5 or 6 at first, and the game is worth 14/3≈4.6714/3 \approx 4.67.

Work backwards. The last roll is worth 3.53.5, so with one re-roll left you keep anything above 3.53.5. The value is then 12⋅5+12⋅3.5=4.25\tfrac12 \cdot 5 + \tfrac12 \cdot 3.5 = 4.25. With two re-rolls left, you compare the roll with 4.254.25, so you keep 5 and 6 only. The value is 13⋅5.5+23⋅4.25=14/3\tfrac13 \cdot 5.5 + \tfrac23 \cdot 4.25 = 14/3. With many re-rolls the value climbs towards 6.

Classic wrong answer. Using the same threshold at every stage. The threshold is the value of what you would be giving up, and that value is higher when you have more rolls left.

Question 14.2 ★ QR, QT, Trader • any • junior

You draw a uniform number on [0,1][0, 1] and may keep it or reject it for a new draw. What is the game worth with one possible rejection? With two? With three? What is the threshold at each stage?

Answer

Answer to Question 14.2.

The values are 5/85/8, 89/128≈0.69589/128 \approx 0.695 and 24305/32768≈0.74224305/32768 \approx 0.742. At each stage the threshold is the value of the game that you would move to: 12\tfrac12, then 58\tfrac58, then 89128\tfrac{89}{128}.

If the game is worth vv after a rejection, you keep any draw above vv. So the new value is

E[max⁡(U,v)]=v⋅v+∫v1x dx=1+v22.E[\max(U, v)] = v \cdot v + \int_v^1 x\,dx = \frac{1 + v^2}{2}.

Start from v=12v = \tfrac12, the value of a last draw that you must keep.

The recursion has its only fixed point at v=1v = 1, so with many draws the value tends to the top of the range, as it should.

Classic wrong answer. Giving 2/32/3 for one rejection, which is the mean of the larger of two draws. That is what you get with hindsight. Here you have to decide before you see the second draw.

Question 14.3 ★ QR, QT, Trader • any • junior

A bag holds 100 tickets, numbered 1 to 100. You draw one and see it. You may keep it and be paid its number in dollars, or you may draw a second ticket from the remaining 99 and be paid that instead. What should you do, and what is the game worth?

Answer

Answer to Question 14.3.

Keep 51 or higher, and the game is worth about $63.13\$63.13.

If you hold a ticket with number xx, the second draw is uniform on the other 99, so its mean is (5050−x)/99(5050 - x)/99. You keep when

x≥5050−x99  ⟺  100x≥5050  ⟺  x≥50.5.x \ge \frac{5050 - x}{99} \iff 100x \ge 5050 \iff x \ge 50.5.

The threshold is exactly the plain mean, 50.550.5. Removing a low ticket raises the mean of the rest, removing a high one lowers it, and the two effects balance there.

The value is 1100(∑x=51100x+∑x=1505050−x99)=1100(3775+2537.6)\frac{1}{100}\bigl(\sum_{x = 51}^{100} x + \sum_{x = 1}^{50} \frac{5050 - x}{99}\bigr) = \frac{1}{100}(3775 + 2537.6). The continuous version, with a threshold of 12\tfrac12, is worth 0.6250.625, which is close to this on a scale of 100.

Classic wrong answer. Thinking that you should switch only for tickets far below the middle, because of “the risk of losing what you have”. You are paid a mean, and a risk-neutral player should use the threshold at the mean.

Question 14.4 ★ QR, QT, Trader, Analyst • any • junior

You turn over the cards of a shuffled standard deck, one by one. At any moment you may say “stop”, and you win if the next card is red; if you never speak you are forced to bet on the last card. What rule gives you the best chance of winning?

Answer

Answer to Question 14.4.

No rule does better than 1/21/2, and every rule achieves exactly 1/21/2.

The fraction of red among the remaining cards is a martingale. If rr of the r+br + b remaining cards are red, the expected fraction after the next card is

rr+b⋅r−1r+b−1+br+b⋅rr+b−1=rr+b.\frac{r}{r + b} \cdot \frac{r - 1}{r + b - 1} + \frac{b}{r + b} \cdot \frac{r}{r + b - 1} = \frac{r}{r + b}.

Your win chance when you stop is the current fraction. Optional stopping says that the expected value at any stopping rule is the starting value, 12\tfrac12.

A shorter proof: given what you have seen, the next card and the very last card are exchangeable. So stopping and betting on the next card has the same chance as betting on the last card of the deck, and that card is red with chance 12\tfrac12, whatever your rule.

Classic wrong answer. Waiting until more black cards have gone by, because then the deck is richer in red. It does get richer when that happens, but it might never happen, and on average those paths balance. A backward induction shows that every state is exactly indifferent.

Why it matters. This is the simplest example of “no timing rule beats a fair game”. Anyone who shows you a rule that seems to get an edge from timing a fair process has made an error, or they are selecting their sample.

Question 14.5 ★★ QR, QT, Trader, DS • any • junior

You interview nn candidates in random order. After each interview you can compare the candidate only with those already seen, and you must hire on the spot or reject for good. You win only by hiring the best of all nn. Find the best rule and the win chance for n=3n = 3, then the best rule for n=10n = 10, then the limit for large nn.

Answer

Answer to Question 14.5.

For n=3n = 3: reject the first, and then take the first candidate better than all before, for a win chance of 1/21/2. For n=10n = 10: reject the first 3, for a win chance of about 0.3990.399. For large nn: reject a fraction 1/e1/e, for a win chance tending to 1/e≈0.3681/e \approx 0.368.

A good rule rejects the first ss and then takes the next candidate who beats all before. You win if the best overall is at position k>sk > s, with chance 1n\tfrac1n for each kk, and if the best of the first k−1k - 1 lies in the first ss, with chance sk−1\tfrac{s}{k - 1}. So

P(win)=sn∑k=s+1n1k−1.P(\text{win}) = \frac{s}{n} \sum_{k = s + 1}^{n} \frac{1}{k - 1}.

For n=3n = 3 and s=1s = 1, this is 13(1+12)=12\tfrac13(1 + \tfrac12) = \tfrac12. Taking anyone at a fixed position wins with chance only 13\tfrac13. For large nn, with s=xns = xn, the sum is about ln⁡(1/x)\ln(1/x), so you maximise xln⁡(1/x)x\ln(1/x), which peaks at x=1/ex = 1/e with value 1/e1/e.

The threshold form need not be assumed. At position kk, a candidate who beats all before is the overall best with chance k/nk/n, and that rises with kk, while the value of going on falls. A backward induction on kk gives the same answer, 0.3990.399 for n=10n = 10.

Classic wrong answer. Assuming the win chance falls to 0 as nn grows, because the best is ever harder to find. The win chance tends to a constant, however many candidates there are.

Question 14.6 ★★ QR, QT, Trader, Analyst • any • junior

You may draw uniform numbers on [0,1][0, 1] as many times as you like, paying 0.020.02 for each draw, the first included, and you keep the last number drawn. When do you stop, how many draws do you make on average, and what is the game worth? What happens as the cost rises and as it falls to 0?

Answer

Answer to Question 14.6.

Stop at the first number above 0.80.8. You make 5 draws on average, and the game is worth 0.80.8. In general the threshold is 1−2c1 - \sqrt{2c}.

Let vv be the value of the game before a draw that you must pay for. The future looks the same after any rejection, so a draw xx is kept when x≥vx \ge v. The value equation is v=E[max⁡(U,v)]−cv = E[\max(U, v)] - c, which says

∫v1(x−v) dx=c,so(1−v)22=c.\int_v^1 (x - v)\,dx = c, \quad\text{so}\quad \frac{(1 - v)^2}{2} = c.

With c=0.02c = 0.02, you get 1−v=0.21 - v = 0.2. The number of draws is geometric with success chance 0.20.2, so its mean is 5. As a second route: you end up with a number averaging 0.90.9, and you pay 5⋅0.025 \cdot 0.02, which leaves 0.80.8.

The threshold falls as the cost rises. At c=12c = \tfrac12 the threshold is 0 and the game is worth nothing, because the first draw is worth just its cost. At c=0c = 0 the threshold is 1, and you go on forever.

Classic wrong answer. Lowering the threshold as the costs pile up. The money already spent is gone, and the future looks the same after every draw, so there is one threshold for the whole game.

Why it matters. Going on is an option with a price. This same equation appears when you decide how long to search for a better price, or when to stop collecting data.

Question 14.7 ★★ QR, QT, Trader • any • junior

You roll a fair 20-sided die for free, and you are paid the number shown. You may re-roll as often as you like, paying $1 for each re-roll, and only the last number counts. When do you stop, and what is the game worth?

Answer

Answer to Question 14.7.

Keep 15 or higher. The game is worth 91/6≈$15.1791/6 \approx \$15.17.

Let ww be the value of the game when you are about to make a free roll. A re-roll therefore gives you w−1w - 1, so you keep any number above w−1w - 1. A threshold rule “keep at least tt” has a kept number averaging (t+20)/2(t + 20)/2, and 20/(21−t)20/(21 - t) rolls on average, of which all but the first cost $1. Its value is

t+202−(2021−t−1).\frac{t + 20}{2} - \Bigl(\frac{20}{21 - t} - 1\Bigr).

This gives 15.1415.14 at t=14t = 14, 15.1715.17 at t=15t = 15, and 1515 at t=16t = 16. So t=15t = 15 is best. It agrees with the condition: w−1=14.17w - 1 = 14.17, so you keep what beats 14.1714.17, which is 15 or more. Value iteration on w=E[max⁡(k,w−1)]w = E[\max(k, w - 1)] reaches the same value.

Limits: with a free re-roll the value would be 20. With a very high cost you keep the first roll, for a value of 10.510.5.

Classic wrong answer. Comparing the roll with ww itself, which gives a threshold of 16 and a value of only 15. A re-roll costs $1, so the number to beat is w−1w - 1.

Question 14.8 ★★ QR, QT, Analyst, DS • any • junior

You are selling a block of stock. Each day one offer arrives, uniform on [0,1][0, 1], and a rejected offer is gone. Money received a day later is worth 0.80.8 times as much. Which offers do you accept, how long does it take on average, and what is the block worth just before the first offer arrives?

Answer

Answer to Question 14.8.

Accept anything at or above 0.50.5. It takes 2 days on average, and the block is worth 0.6250.625 just before the first offer.

Let vv be the value before an offer arrives. A rejected offer gives you δv\delta v, with δ=0.8\delta = 0.8, so you accept when the offer beats δv\delta v. Then

v=E[max⁡(U,δv)]=1+(δv)22.v = E[\max(U, \delta v)] = \frac{1 + (\delta v)^2}{2}.

Solving this gives v=1−1−δ2δ2=1−0.60.64=0.625v = \frac{1 - \sqrt{1 - \delta^2}}{\delta^2} = \frac{1 - 0.6}{0.64} = 0.625, and the threshold is δv=0.5\delta v = 0.5. Half of the offers are accepted, so the wait is geometric, with mean 2 days. A simulation with this rule gives the same value.

The limits make sense. At δ=0\delta = 0 you take any offer, which is worth 12\tfrac12. At δ=1\delta = 1 you wait for an offer of nearly 1, and the value tends to 1.

Classic wrong answer. Waiting for 0.6250.625, the value of the block, a rule worth only about 0.6090.609. What you give up by refusing is that value a day later, so the threshold is δv\delta v, not vv. That the threshold equals the mean offer, 0.50.5, is a coincidence of δ=0.8\delta = 0.8.

Question 14.9 ★★ QR, QT, Trader • any • junior

You roll a fair die repeatedly and add up the results. You may stop at any time and take the total in dollars, but if you roll a 6, the game ends and you get nothing. When should you stop? About what is the game worth?

Answer

Answer to Question 14.9.

Keep rolling below 15, and stop at 15 or more (you are indifferent at exactly 15). The game is worth about $6.15\$6.15.

Holding a total of SS, one more roll gives an expected

16∑k=15(S+k)=5S6+156.\frac16 \sum_{k = 1}^{5} (S + k) = \frac{5S}{6} + \frac{15}{6}.

This beats SS exactly when S<15S < 15. A rule that compares stopping with one more step and then stopping is often called one-step look-ahead. It is optimal here, because once it says “stop”, it continues to do so at every higher total, and totals only go up.

For the value, use backward induction from totals of 15 and up, where the value is the total. For S<15S < 15 the value is 16∑k=15V(S+k)\frac16\sum_{k = 1}^5 V(S + k). Working down gives V(0)≈6.15V(0) \approx 6.15. A simulation of the rule matches.

Note how much the risk of a zero costs. Even if you follow the rule, you fail to reach 15 about 62% of the time, and all of the value comes from the paths that do.

Classic wrong answer. Stopping when the total reaches 3.5⋅5=17.53.5 \cdot 5 = 17.5, or after a set number of rolls. The rule depends on what you hold, because what you risk is the total, whereas the gain is a fixed 2.52.5 on average, so the risk and reward come into balance at 15.

Question 14.10 ★★ QR, QT, Trader • any • junior

A fair coin is flipped up to 4 times, and you may stop after any flip, including before the first. You are paid heads minus tails so far, which may be negative. What is the best rule, and what is it worth? How does the answer change if you are paid heads minus tails or nothing, whichever is greater?

Answer

Answer to Question 14.10.

With negative payoffs allowed, every rule is worth 0. With the floor at 0, going to the end is optimal: the game is worth 3/43/4.

Heads minus tails, SkS_k, is a fair random walk, hence a martingale. For a bounded stopping time, E[Sτ]=S0=0E[S_\tau] = S_0 = 0. So all rules are worth the same: stopping when ahead brings gains offset by the losses of the paths that had to run to the end.

With a floor, the payoff is max⁡(Sk,0)\max(S_k, 0), a convex function of a martingale, hence a submartingale. Its expectation can only rise with time, so waiting until the end is optimal. Then

E[S4+]=1⋅4+4⋅216=34,E[S_4^+] = \frac{1 \cdot 4 + 4 \cdot 2}{16} = \frac34,

from S4=4S_4 = 4 with chance 116\tfrac{1}{16}, and S4=2S_4 = 2 with chance 416\tfrac{4}{16}. For large nn, this grows like n/2π\sqrt{n/2\pi}.

Classic wrong answer. Stopping at a gain of 1 on the first flip to lock in a profit, with the floor in place. Stopping pays 1, and going on pays 5/45/4, because the floor protects you from the fall. (Stopping at 2 after two heads happens to cost nothing, since the walk can no longer go below 0.)

Why it matters. This is why it is not optimal to exercise an American call on a stock with no dividends and zero rates early. The call’s payoff is convex in a martingale, so early exercise only gives away the option’s remaining value.

Question 14.11 ★★ QR, QT, Trader, Analyst • hedge fund • junior

A trade costs 40 and pays 100 if a deal closes, which you believe has a 50% chance, and nothing otherwise. A research report will say “yes” or “no”, and it is right 80% of the time whichever way the truth lies. What is the most you would pay for this report? What would you pay for a perfect report?

Answer

Answer to Question 14.11.

The report is worth at most 10. A perfect report is worth at most 20.

Without a report, you trade, with an expected 0.5⋅100−40=100.5 \cdot 100 - 40 = 10.

With the report, “yes” and “no” are equally likely, by symmetry. After “yes”, the chance of a deal is 0.80.8, so trading is worth 4040. After “no”, the chance is 0.20.2, so trading is worth −20-20, and you pass, which gives 0. So the value is 12⋅40+12⋅0=20\tfrac12 \cdot 40 + \tfrac12 \cdot 0 = 20, which is 10 above the original.

With a perfect report you trade only when the deal will close, and you make 60. So it is worth 12⋅60=30\tfrac12 \cdot 60 = 30, which is 20 more.

The value comes only from changing a decision. A report that is right 60% of the time is worth nothing here: after “no” you would have a chance of 0.40.4, which is worth 0, so it saves you nothing. That is an important check: accuracy above 12\tfrac12 does not mean that information has value.

Classic wrong answer. Paying for the higher expected profit after “yes”, 40−10=3040 - 10 = 30. You do not get “yes” every time, and you must commit to the price before you know what the report says.

Question 14.12 ★★ QR, QT, DS, Trader • any • junior

Coin A has a known heads chance of 1/21/2, and coin B has an unknown heads chance, uniform on [0,1][0, 1]. You flip one coin at a time, choosing each time after seeing past results, and you are paid $1 per head. With two flips, which do you flip first, and what is the game worth? Why flip a coin that has the same average chance as the other?

Answer

Answer to Question 14.12.

Flip coin B first, then stay with B after a head and switch to A after a tail. The game is worth 13/1213/12, against 1 for coin A twice.

Coin B has the same chance on the first flip, 12\tfrac12. But it also tells you something. After a head, the chance for B is 23\tfrac23 by Laplace’s rule; after a tail it is 13\tfrac13, so you go to A. So the value is

12+12⋅23+12⋅12=1312.\tfrac12 + \tfrac12 \cdot \tfrac23 + \tfrac12 \cdot \tfrac12 = \tfrac{13}{12}.

The extra 1/121/12 is the value of learning. With only one flip left there is nothing to learn from, and both coins are worth 12\tfrac12. With three flips, the value is 5/35/3, against 3/23/2 for coin A, so an edge of 1/61/6. The value of exploring grows with the time left to use what you learn.

Classic wrong answer. Saying you are indifferent because the two coins have the same mean. The unknown coin has the same mean, but it has variance in what you will know next, and you can exploit that.

Why it matters. Given two strategies with equal expected return, allocate the first capital to the one you know less about, as long as you will have time to act on what you learn.

Question 14.13 ★★ QR, QT, Trader • market maker • junior

You draw uniform numbers on [0,1][0, 1] and add them up. You may stop at any time and take the total, but if the total goes over 1 you get nothing. When should you stop, and what is the game worth at the start?

Answer

Answer to Question 14.13.

Stop once the total is at least 2−1≈0.414\sqrt{2} - 1 \approx 0.414. The game is worth (2−1)e2−1≈0.627(\sqrt{2} - 1)e^{\sqrt{2} - 1} \approx 0.627 at the start.

With a total of ss, one more draw and then stopping has an expected payoff of

∫01−s(s+u) du=s(1−s)+(1−s)22=1−s22.\int_0^{1 - s} (s + u)\,du = s(1 - s) + \frac{(1 - s)^2}{2} = \frac{1 - s^2}{2}.

This beats ss exactly when s2+2s−1<0s^2 + 2s - 1 < 0, so when s<2−1s < \sqrt{2} - 1. Once you exceed this, the total only goes up, so the rule stays “stop”.

For the value at ss below the threshold tt, the value function satisfies V(s)=∫s1V(x) dxV(s) = \int_s^1 V(x)\,dx, where V(x)=xV(x) = x above tt. Differentiating gives V′=−VV' = -V, so V(s)=V(t)et−sV(s) = V(t)e^{t - s}, and V(t)=tV(t) = t. So V(0)=tetV(0) = te^t. A simulation of the rule gives the same, and scanning other thresholds confirms the maximum at tt.

Classic wrong answer. Stopping once the total is above 12\tfrac12, by symmetry. There is no symmetry, because going over costs you everything you have, and at 12\tfrac12 that is a lot for a low chance of a modest gain.

Question 14.14 ★★★ QR, QT, Trader • market maker, hedge fund • junior, experienced

A deck is dealt face up, one card after another. Each red card pays you $1, each black card costs you $1, and you may stop at any time. Work out the value of a deck of 2 red and 2 black by hand, and describe the method for a full deck of 26 and 26. About how much is the full deck worth?

Answer

Answer to Question 14.14.

The deck of 2 and 2 is worth 2/32/3, and the full deck is worth about $2.62.

Let V(r,b)V(r, b) be the value with rr red and bb black left. Then V(0,b)=0V(0, b) = 0, V(r,0)=rV(r, 0) = r and

V(r,b)=max⁡(0, rr+b(1+V(r−1,b))+br+b(V(r,b−1)−1)).V(r, b) = \max\Bigl(0,\ \frac{r}{r + b}\bigl(1 + V(r - 1, b)\bigr) + \frac{b}{r + b}\bigl(V(r, b - 1) - 1\bigr)\Bigr).

This is a 27×2727 \times 27 table, and you fill it in from the small corner. You stop when the second term is not positive.

By hand: V(1,1)=12V(1, 1) = \tfrac12. V(1,2)V(1, 2) has continuation value 13(1+0)+23(12−1)=0\tfrac13(1 + 0) + \tfrac23(\tfrac12 - 1) = 0. And V(2,1)=23(1+12)+13(2−1)=43V(2, 1) = \tfrac23(1 + \tfrac12) + \tfrac13(2 - 1) = \tfrac43. So

V(2,2)=12(1+V(1,2))+12(V(2,1)−1)=12+16=23.V(2, 2) = \tfrac12\bigl(1 + V(1, 2)\bigr) + \tfrac12\bigl(V(2, 1) - 1\bigr) = \tfrac12 + \tfrac16 = \tfrac23.

The whole deck is worth 0 if you never start, and the full deck ends at zero if you do not stop, so all of the value lies in having the option to stop. Note that the deck has a value even though every card is a fair bet. A prophet who stops at the top of the walk would make about 4 on a full deck, and the game gets about two-thirds of that with no foresight.

Classic wrong answer. Saying that the value is 0, by the optional stopping theorem. The running total is not a martingale: when you are ahead, more black cards than red remain, so the next card has a negative expected value. That is exactly when you stop.

Question 14.15 ★★★ QR, QT, Trader • hedge fund • junior, experienced

You drive along a long straight street towards a restaurant. Parking spaces lie one unit apart along the whole street, one of them exactly at the restaurant, and each is free with probability 0.10.1, independently. You see whether a space is free only when you reach it, and you cannot turn back. If you park xx units from the restaurant, before it or past it, you walk xx units. Which free spaces do you take, and what is your expected walk? What is the rule for a general chance pp that a space is free?

Answer

Answer to Question 14.15.

Take the first free space that is at most 6 units before the restaurant, or failing that the first free space at or past it. The expected walk is about 6.576.57. In general, with q=1−pq = 1 - p, take a free space xx units before the restaurant exactly when qx≥12q^x \ge \tfrac12.

Use backward induction. Past the restaurant, your walk only grows, so you take the first free space, which is 1/p1/p units past on average. Let V(x)V(x) be the expected walk on arriving xx units before the restaurant, before seeing that space. Then

V(0)=qp,V(x)=pmin⁡(x,V(x−1))+q V(x−1).V(0) = \frac{q}{p}, \qquad V(x) = p\min\bigl(x, V(x - 1)\bigr) + q\,V(x - 1).

If you take every free space from xx inwards, this solves to V(x)=x+(2qx+1−q)/pV(x) = x + (2q^{x + 1} - q)/p. At xx units, taking costs xx, and passing costs V(x−1)=x−1+(2qx−q)/pV(x - 1) = x - 1 + (2q^x - q)/p. So you take the space when p≤2qx−qp \le 2q^x - q, which is qx≥12q^x \ge \tfrac12. In words: take it when it is at least even money that all xx spaces from here up to and including the restaurant’s are occupied.

With q=0.9q = 0.9, we have 0.96=0.5310.9^6 = 0.531 and 0.97=0.4780.9^7 = 0.478, so the limit is 6 units, and V(6)=6+(2⋅0.97−0.9)/0.1≈6.57V(6) = 6 + (2 \cdot 0.9^7 - 0.9)/0.1 \approx 6.57. Limits of 5 and 7 units give 6.636.63 and 6.616.61.

Classic wrong answer. Taking the first free space within 10 units, because the average gap between free spaces is 1/p=101/p = 10. This costs 7.287.28. The right test compares a chance with one half, not a distance with the average gap. Refusing everything before the restaurant costs 99.

Why it matters. Once you would stop at some point, you would also stop at every point closer, so comparing stopping now with stopping at the next chance is enough. Rules of this monotone kind turn up in working an order before a deadline, and they save solving the whole recursion.

Question 14.16 ★★★ QR, QT, DS, Trader • hedge fund • junior, experienced

A coin has an unknown heads chance, uniform on [0,1][0, 1]. You will place one bet on the next flip, at even money and for $1, on the side of your choice. Before that, you may see nn free flips. What is your expected profit for n=0n = 0, 1, 2 and 3? What does the second flip add, and what is the limit as nn grows?

Answer

Answer to Question 14.16.

The profits are 0, 13\tfrac13, 13\tfrac13 and 25\tfrac25. The second free flip adds nothing, and the limit is 12\tfrac12. For odd nn, the value is n+12(n+2)\frac{n + 1}{2(n + 2)}, and each even nn has the same value as the odd number before it.

With kk heads in nn flips, the chance of heads next is k+1n+2\frac{k + 1}{n + 2}, by Laplace’s rule. You bet on the likelier side, so your profit is ∣2k+1n+2−1∣|2\frac{k + 1}{n + 2} - 1|. With a uniform prior, kk is uniform on 0,…,n0, \dots, n. So the value is the average of that absolute value over kk.

For n=1n = 1: chances 13,23\tfrac13, \tfrac23, and profit 13\tfrac13.

For n=2n = 2: chances 14,12,34\tfrac14, \tfrac12, \tfrac34, and profits 12,0,12\tfrac12, 0, \tfrac12, so the mean is 13\tfrac13.

For n=3n = 3: profits 35,15,15,35\tfrac35, \tfrac15, \tfrac15, \tfrac35, so the mean is 25\tfrac25.

Betting on the side of the first flip is still an optimal rule after the second flip. If the two agree, you bet that way anyway, and if they disagree, you are indifferent. So the second flip changes no decision, and it adds no value. The limit is E∣2p−1∣=12E|2p - 1| = \tfrac12, which is what knowing pp exactly would be worth.

Classic wrong answer. Assuming that the value of data grows smoothly with nn. It is flat here between an odd and an even step, because only a change in decision has value. Further data that sharpens your estimate without changing your bet adds nothing to a one-shot bet of fixed size.

Question 14.17 ★★★ QR, QT, Trader • market maker, hedge fund • junior, experienced

Player A draws a uniform number on [0,1][0, 1] and may reject it once for a new draw, which must then be kept. Player B sees A’s final number, and then does the same, with one possible rejection. The higher number wins. When should A keep the first draw, and what is A’s chance of winning?

Answer

Answer to Question 14.17.

A should keep a first draw of at least 1/3≈0.5771/\sqrt{3} \approx 0.577, and A’s chance of winning is about 0.4620.462.

Start with B. Given A’s final number xx, B wins unless both of B’s draws are below xx, because B redraws exactly when behind. So A wins with chance x2x^2.

Now, A has a draw xx. Keeping gives x2x^2. Redrawing gives a uniform number, and so E[U2]=13E[U^2] = \tfrac13. So A keeps when x2≥13x^2 \ge \tfrac13. With threshold tt, the chance that A wins is

∫t1x2 dx+t⋅13=1−t33+t3,\int_t^1 x^2\,dx + t \cdot \tfrac13 = \frac{1 - t^3}{3} + \frac{t}{3},

which is maximised at t2=13t^2 = \tfrac13, and has value 13(1+233)≈0.462\tfrac13\bigl(1 + \tfrac{2}{3\sqrt{3}}\bigr) \approx 0.462. As a check, t=0t = 0 and t=1t = 1 both mean that A has effectively one draw, which gives 13\tfrac13. A simulation of the game gives the same.

Classic wrong answer. Using 12\tfrac12 as the threshold, which is what maximises the expected number. A is not trying to get a high number on average; A has to survive B’s two tries. The payoff is x2x^2, not xx. Convexity favours a riskier choice.

Question 14.18 ★★★ QR, QT, Trader, DS • hedge fund • junior, experienced

There are 30 independent trials in order, each a success with chance 0.10.1. You watch them one at a time, and you may stop once, at a success. You win if that success turns out to be the last of the 30. Which rule is best, and what is the win chance? How is this linked to hiring the best of nn candidates?

Answer

Answer to Question 14.18.

Stop at the first success in the last 9 trials. The win chance is 0.99≈0.3870.9^9 \approx 0.387. Hiring is the same problem with success chance 1/k1/k at trial kk.

Stopping at a success on trial kk wins if the remaining n−kn - k are all failures. So a success is worth more the later it comes, and the rule is a threshold on the trial number. For a rule that accepts any success in the last ss trials, you win when exactly one success occurs among them:

P(win)=spqs−1,q=1−p.P(\text{win}) = s p q^{s - 1},\quad q = 1 - p.

Comparing ss with s+1s + 1, the chance rises while s⋅p/q<1s \cdot p/q < 1. Here p/q=1/9p/q = 1/9, so s=9s = 9 gives exactly 1, and s=9s = 9 and s=10s = 10 tie, at 0.3870.387. For s=8s = 8 it is 0.3830.383.

This is the odds algorithm: sum the odds of success from the end backwards, and start accepting when the sum reaches 1. In the hiring problem, “candidate kk beats all before” is a success with chance 1k\frac1k, these events are independent, and the last success is the overall best. The odds are 1k−1\frac{1}{k - 1}. For n=10n = 10, summing from the end reaches 1 at k=4k = 4, so you reject the first 3, as found by direct calculation. The win chance is at least about 1/e1/e when the sum of the odds reaches 1.

Classic wrong answer. Waiting until the expected number of remaining successes is about 1, which is the last 10 trials here. It is nearly right, and it gives the same win chance in this tied case. In general use the odds, not the probabilities, which matters when the chances are not small.

Question 14.19 ★★★★ QR, QT • hedge fund, market maker • experienced

You flip a fair coin as many times as you like, and when you stop you are paid the fraction of flips that were heads. There is no cost and no limit. Show that the game is worth at least 3/43/4. Find what the rule “stop the first time heads lead” is worth in closed form. Would you ever stop with heads level with tails, or even behind?

Answer

Answer to Question 14.19.

The rule “stop at the first lead” is worth exactly π/4≈0.785\pi/4 \approx 0.785. Backward induction with a long horizon gives about 0.7930.793 for the best rule, so that rule is not optimal. You should never stop when level or behind.

For the lower bound: a head on the first flip pays 1. After a first tail, the fair walk comes back to level with probability 1, so you can always reach a fraction of 12\tfrac12. This gives at least 12⋅1+12⋅12=34\tfrac12 \cdot 1 + \tfrac12 \cdot \tfrac12 = \tfrac34.

For the first lead: the first lead comes at flip 2m+12m + 1 with chance Cm22m+1\frac{C_m}{2^{2m + 1}}, with CmC_m the Catalan numbers, and the fraction then is m+12m+1\frac{m + 1}{2m + 1}. So the value is

∑m≥0Cm22m+1⋅m+12m+1=∑m≥0(2mm)1(2m+1)22m+1=12arcsin⁡1=π4,\sum_{m \ge 0} \frac{C_m}{2^{2m + 1}} \cdot \frac{m + 1}{2m + 1} = \sum_{m \ge 0} \binom{2m}{m}\frac{1}{(2m + 1)2^{2m + 1}} = \frac12 \arcsin 1 = \frac{\pi}{4},

using Cm(m+1)=(2mm)C_m(m + 1) = \binom{2m}{m} and the arcsine series.

Never stop when level or behind. From any state you can get back to at least 12\tfrac12 almost surely, because the walk is recurrent, so stopping below 12\tfrac12 loses. At exactly 12\tfrac12 you have a positive chance of getting a lead, and you can still come back, so continuing is strictly better.

The first lead is not always a good moment to stop either. After tail, head, head, you have 23\tfrac23, but going on is worth about 0.6690.669. So the optimal rule demands a bigger lead at some points, and the required lead grows like 0.84n0.84\sqrt{n}. The value comes from a backward induction from 5000 flips, using a low and a high guess for the terminal value, and both round to 0.7930.793. It is the output of that calculation, not of a formula.

Classic wrong answer. Saying that the game is worth 1 because a fair walk gets ahead by any amount eventually. It gets ahead, but the fraction is what pays, and as the number of flips grows, any given lead is worth less. Being ahead by a fixed amount at a late time has a value close to 12\tfrac12.

Question 14.20 ★★★★ QR, QT • hedge fund • experienced

Independent non-negative prizes X1,…,XnX_1, \dots, X_n with known distributions are shown in order. You can take a prize when it is shown, or lose it for good. A prophet, who sees all of them in advance, earns E[max⁡Xi]E[\max X_i]. Show that a single fixed threshold lets you earn at least half of this, whatever the distributions, and show by example that you cannot guarantee more than a half.

Answer

Answer to Question 14.20.

Take the threshold t=12E[M]t = \tfrac12 E[M], with M=max⁡XiM = \max X_i, and accept the first prize that is at least tt. That earns at least 12E[M]\tfrac12 E[M]. An example with one prize of 1 for sure, followed by one of 1/ε1/\varepsilon with chance ε\varepsilon, shows that you cannot do better than a half in general.

Let p=P(M≥t)p = P(M \ge t), the chance that you accept something. Your reward has two parts. Each time you accept you get at least tt, which gives ptpt. On top of that, you get the excess (Xi−t)+(X_i - t)^+ when you accept prize ii. You reach prize ii with no acceptance so far with chance at least 1−p1 - p, and that event depends only on the prizes before ii, so it is independent of XiX_i. So

Reward≥pt+(1−p)∑iE[(Xi−t)+]≥pt+(1−p)E[(M−t)+]≥pt+(1−p)(E[M]−t),\text{Reward} \ge pt + (1 - p)\sum_i E[(X_i - t)^+] \ge pt + (1 - p) E[(M - t)^+] \ge pt + (1 - p)(E[M] - t),

where the sum is above (M−t)+(M - t)^+ because the largest excess is one of the terms. With t=12E[M]t = \tfrac12 E[M], both tt and E[M]−tE[M] - t equal 12E[M]\tfrac12 E[M], and pp cancels:

Reward≥p⋅12E[M]+(1−p)⋅12E[M]=12E[M].\text{Reward} \ge p \cdot \tfrac12 E[M] + (1 - p) \cdot \tfrac12 E[M] = \tfrac12 E[M].

For the example, the first prize is 1 for sure. The second prize is 1/ε1/\varepsilon with chance ε\varepsilon, so its mean is 1 too. So anything you do is worth 1. But the prophet takes the second prize when it comes, and otherwise the first, for 2−ε2 - \varepsilon. The ratio tends to 12\tfrac12.

Classic wrong answer. Trying for a threshold that depends on all of the distributions in a complicated way. A single number already gets the best guarantee possible over all distributions, and the proof uses nothing about the order in which they arrive.

Why it matters. This gives the true value of hindsight in selection problems. Backtests that pick the best moment after the fact can show up to twice what any real rule can earn, even when the distributions are perfectly known.