PDA

View Full Version : Quiz .....

joeg
04-26-2003, 07:36 AM
I got this off another forum and was just wondering what answers any of you maths gurus here would come up with

A lunatic appears on the scene offering 6-4 heads and 2-1 tails. You have \$300 to play with, and must bet exactly \$100 on each spin (no more, no less) The lunatic offers 100 coin tosses and finally stipulates that each bet you make must be identical to the first. So if you have \$100 on tails, that must be your bet throughout. Similarly if you go 50-50 you cannot change.

its quite straight forward to come up with a no lose strategy (\$40 heads, \$60 tails) but the optimum strategy probably accepts some chance of loosing, anyone here up for working it out?

BruceZ
04-27-2003, 02:00 PM
This is an interesting problem. If we bet it all on tails, we would maximize our EV per flip, but we might go broke before we flip 100 times, which would reduce our EV overall. If we bet 60 on tails and 40 on heads, we would not go broke, and we would win an average of \$40/flip or \$4000 overall. So the correct answer is between 60 and 100 on tails. We must compute the risk of ruin for each of these amounts, and multiply the overall EV by the probability that we do not go broke. So this is really a risk of ruin problem. It is a short-term risk of ruin problem, since we are only flipping 100 times. The blackjack community has provided an approximate short term risk of ruin formula, and I have used this to tabulate the results shown below using Excel.

The first column is the amount bet on tails. The second column is the overall EV assuming we flip 100 times. The third column is SD for 100 flips. The fourth column is the risk of going broke. The last column is the overall EV including the risk of going broke. Note that the risk for \$60 should be exactly 0, but the formula makes an approximation. We see from this that the maximum EV occurs for a bet of \$76 on tails, which means \$24 is on heads. If we do this, we should expect to win approximately \$4295.

This result is reasonable from the standpoint of the Kelly criterion, which says to bet the fraction of your bankroll equal to your advantage divided by the ev of the square of your result E(x^2). This criterion maximizes the log growth of the bankroll without going broke. Since we lose nothing by betting \$60 on tails, each dollar over \$60 represents a risk. Our advantage is 50% since we are getting 2-1. E(x^2) is approximately 1.5 in this case, so 50%/1.5 = 33.3%. Since we have up to \$40 to risk, 33.3% of 40 would be about 13 dollars. We have decided to bet an extra \$16 for a total of \$76. It makes sense to bet a little more than Kelly since we are playing for a finite number of flips, and we are tolerating a 2.4% risk of ruin. True Kelly would allow varying the bet each flip which we cannot do here.

The EV column is computed as:

.5*[ bet*2 - (100-bet) + (100-bet)*1.5 - bet ]*100

The SD is computed as:

SQRT{ .5*[bet*2 - (100 - bet) ]^2 +
.5*[ (100 - bet)*1.5 - bet ]^2 -
(ev/100)^2 }*SQRT(100)

The short term risk of ruin is:

NORMSDIST[ (-300-EV)/SD ] +
EXP(-2*EV*300/SD^2)*NORMSDIST[ (-300+EV)/SD ]

where NORMDIST is the cumulative normal density.

<pre><font class="small">code:</font><hr>
bet EV SD risk of ruin EV*(1-risk of ruin)

60 4000 400 3.05902E-07 4000.00
61 4025 427.5 1.82429E-06 4024.99
62 4050 455 7.98686E-06 4049.97
63 4075 482.5 2.74733E-05 4074.89
64 4100 510 7.80703E-05 4099.68
65 4125 537.5 0.000190322 4124.21
66 4150 565 0.000409677 4148.30
67 4175 592.5 0.000796241 4171.68
68 4200 620 0.001422028 4194.03
69 4225 647.5 0.002366315 4215.00
70 4250 675 0.003710058 4234.23
71 4275 702.5 0.005530359 4251.36
72 4300 730 0.007895726 4266.05
73 4325 757.5 0.010862569 4278.02
74 4350 785 0.014473065 4287.04
75 4375 812.5 0.018754316 4292.95
<font color="red">76 4400 840 0.023718578 4295.64</font color>
77 4425 867.5 0.029364301 4295.06
78 4450 895 0.035677697 4291.23
79 4475 922.5 0.042634614 4284.21
80 4500 950 0.050202507 4274.09
81 4525 977.5 0.058342377 4261.00
82 4550 1005 0.067010582 4245.10
83 4575 1032.5 0.076160449 4226.57
84 4600 1060 0.085743674 4205.58
85 4625 1087.5 0.095711494 4182.33
86 4650 1115 0.10601564 4157.03
87 4675 1142.5 0.116609093 4129.85
88 4700 1170 0.127446651 4101.00
89 4725 1197.5 0.138485358 4070.66
90 4750 1225 0.149684779 4039.00
91 4775 1252.5 0.161007184 4006.19
92 4800 1280 0.172417638 3972.40
93 4825 1307.5 0.183884017 3937.76
94 4850 1335 0.195376972 3902.42
95 4875 1362.5 0.206869855 3866.51
96 4900 1390 0.218338612 3830.14
97 4925 1417.5 0.229761652 3793.42
98 4950 1445 0.241119711 3756.46
99 4975 1472.5 0.252395699 3719.33
100 5000 1500 0.263574548 3682.13
</pre><hr>

Do I pass? I'd be interested in seeing the other site's solution.

Glenn
04-27-2003, 03:59 PM
Hi Bruce-

I just looked over you solution quickly as I am working on the problem and didn't want to cheat, but it looks like you used 300 for bankroll when I think you should use 200 because if you lose more than 200 you can't bet the 100 anymore and thus can't play. So if you have \$99 you are ruined.

BruceZ
04-27-2003, 04:49 PM
You can use the entire 300 if you have 100 left before the last bet. You can end up with anything from 0 to 99 when you go "bust". Whether I use 300 or 200, I still get the peak at the same place, and the EVs hardly change at all.

BruceZ
04-27-2003, 06:38 PM
Actually the bankroll size does make a significant difference, and we should use a bankroll of \$201 as you said since when we lose that much the game is over. Below is the corrected data. The optimal occurs at \$69 dollars on tails, and \$31 on heads. The actual EV is around \$4151, but this could be +/- about 50 bucks depending on how much we have left over. I suppose if we wanted to be even more accurate, we could figure out how much we will have left for different amounts bet, and this may make a small difference to the optimal value. It makes more sense that we are betting a little less than Kelly since we can't change our bet. We will have a 1.7% risk of ruin.

It really wasn't necessary to use the short term risk of ruin formula. We could just use the normal risk of ruin formula r = exp(-2*EV*B/SD^2) since for 100 flips the difference is negligible. That is, if you don't go broke in 100 flips, you almost certainly never will even if you flipped forever.

<pre><font class="small">code:</font><hr>
Bet EV SD Risk of Ruin EV*(1-Risk of Ruin)
60 4000 400 4.31857E-05 3999.83
61 4025 427.5 0.000142867 4024.42
62 4050 455 0.000384231 4048.44
63 4075 482.5 0.000879165 4071.42
64 4100 510 0.001769968 4092.74
65 4125 537.5 0.003215568 4111.74
66 4150 565 0.005374475 4127.70
67 4175 592.5 0.008388800 4139.98
68 4200 620 0.012372244 4148.04
<font color="red">69 4225 647.5 0.017403179 4151.47</font color>
70 4250 675 0.023522585 4150.03
71 4275 702.5 0.030735814 4143.60
72 4300 730 0.039016894 4132.23
73 4325 757.5 0.048314201 4116.04
74 4350 785 0.058556558 4095.28
75 4375 812.5 0.069659094 4070.24
76 4400 840 0.08152849 4041.27
77 4425 867.5 0.094067411 4008.75
78 4450 895 0.10717806 3973.06
79 4475 922.5 0.120764922 3934.58
80 4500 950 0.134736754 3893.68
81 4525 977.5 0.149007954 3850.74
82 4550 1005 0.163499416 3806.08
83 4575 1032.5 0.178138976 3760.01
84 4600 1060 0.192861553 3712.84
85 4625 1087.5 0.207609055 3664.81
86 4650 1115 0.222330127 3616.16
87 4675 1142.5 0.236979787 3567.12
88 4700 1170 0.251518994 3517.86
89 4725 1197.5 0.265914185 3468.56
90 4750 1225 0.280136788 3419.35
91 4775 1252.5 0.294162753 3370.37
92 4800 1280 0.307972088 3321.73
93 4825 1307.5 0.321548423 3273.53
94 4850 1335 0.334878602 3225.84
95 4875 1362.5 0.347952304 3178.73
96 4900 1390 0.360761703 3132.27
97 4925 1417.5 0.373301146 3086.49
98 4950 1445 0.385566875 3041.44
99 4975 1472.5 0.397556774 2997.16
100 5000 1500 0.409270135 2953.65</pre><hr>

Bob T.
04-28-2003, 01:52 AM
In a practical sense, if the no loss strategy produces a expected value of 4000, why would anyone take any risk of ruin which would only increase your expected value by about 200?

BruceZ
04-28-2003, 02:57 AM
The overall EV of \$4151 INCLUDES the times we go broke and end up with nothing or only 99 bucks. Actually, our EV will be a little greater than this because of something I didn't take into account. That is, the times we don't go broke, we will actually win more than 100*EV/flip. Our EV would only be 100*EV/flip if we always played to 100 flips, even if we went negative at some point. Since we are considering only times that we didn't go negative, that implies we will win a little more than this. I'm not accounting for exactly how much we win when we win, and I'm approximating that this effect should not significantly change the optimal answer since the risk of ruin is small. This won't be true for the larger bet amounts, and they would have a significantly larger EV than I have indicated. I should really do a more complete job of making sure some of the higher bets do not become better candidates when this effect is considered.

So to answer your question, I'm assuming the goal of the problem is to maximize EV, not to protect a \$300 bankroll. By taking more risk and increasing our standard deviation, we also increase the chance of making much more than \$4000, as well as much less. If the goal were to make some amount under \$4000, say at least \$3000 with maximum confidence, then we should just bet 60/40. Betting 69/31 gives you a better chance to win any amount over \$4000, like \$5000 if that were your goal. If you bet it all on tails, you would have an even better chance of making \$5000, 30%, but you would also go broke 41% of the time. So it depends on your goals which are subjective, but normally we try to maximize EV, unless we are trying to protect a large bankroll.

Glenn
04-28-2003, 06:46 PM
HAHA I sent this problem to one of my friends and he called me about it and while on the phone I realized this exact thing. This is an annoying one for sure. It would probably be faster just to write a program that does a million trials at each bet size.

PseudoPserious
04-28-2003, 06:58 PM
I got a slightly different answer.

I wrote a quick VB program to sim each wager from 0-100 on tails 100,000 times.

The curve I got peak at T = \$73, for an EV of \$4600 with a .8% risk of ruin.

The odd thing (at first) was that the curve wasn't smooth in this area. It's smooth up until T=71, then starts looking more jagged. The graph of the risk of ruin vs bet size is also discontinuous.

I ran the sims a few more times to make sure it was a fluke result, but kept getting the same jagged shape with a peak at T=73 and only minor differences in the actual EV numbers. Then I realized (duh) that the discontinuities should be expected...a small change in bet size could tip you over the limit from needing x bad flips to bust to x+1 bad flips to bust.

I ran the sim from T=66 to T=76 in increments of a dime and saw the same T=73 peak again -- apparently bets between about T=72.8 and T=73.3 all have risks of ruin in the .6-.8% range, while bets in ranges immediately above and below have risks of ruin in the 2-4% range.

Or maybe my code is all kludged up and I have no idea what I'm talking about. But I'll go with a 73/27 split for an expected return of \$4600.

Cheers,
PP

PseudoPserious
04-28-2003, 07:00 PM
Or 100,000 /forums/images/icons/smile.gif

PP

BruceZ
04-28-2003, 08:16 PM
73 is what I predicted above from my Kelly analysis. I'm surprised you got a 0.8% risk of ruin though. I have 4.8% for 73, and 1.7% for 69, and those should be accurate. I got a 0.8 risk of ruin for 67. Did you use a bankroll of 201?

PseudoPserious
04-29-2003, 02:22 AM
Kinda sorta.

I used a BR of 300; it counts a 'bust' whenever the BR drops under 100 (i.e., a bet couldn't be made). So, if you had BR=100.10, you could still play, but BR=99.90 was a bust.

I'll look over the code again tomorrow morning; it's very straight-forward though so I don't know what I coe missing. I ran the full-scale sims 4 times and saw the EV peak at 73 each time (with the correspondingly low risk of ruin), and then the 66-76 sim 2 times and saw it both times. Maybe it is a numerical artifac; I dunno. I could e-mail you the spreadsheet if you like.

PP

joeg
04-29-2003, 10:17 AM
On the other forum they the answer was got by using the following formula,

Expected return = Average number of flips * average profit per flip

this is mathematicaly equivalent to the way you worked it out, except there they overlooked the fact that you couldn't use \$300 as your full bankroll. The fact that these to are both equivalent implies that the effect you mention above