{"id":2049,"date":"2008-09-03T19:34:50","date_gmt":"2008-09-04T02:34:50","guid":{"rendered":"http:\/\/dabacon.org\/pontiff\/?p=2049"},"modified":"2008-09-03T19:34:50","modified_gmt":"2008-09-04T02:34:50","slug":"wisely-using-your-advantage","status":"publish","type":"post","link":"https:\/\/dabacon.org\/pontiff\/2008\/09\/03\/wisely-using-your-advantage\/","title":{"rendered":"Wisely Using Your Advantage"},"content":{"rendered":"<p>When I was a little kid I used to take a pair of dice and throw these dice repeatedly.  At each throw I&#8217;d fill in a box for the corresponding number on some graph paper and I would essentially &#8220;race&#8221; the numbers against each other.  I suppose for that reason I&#8217;ve always been fascinated not just by probabilities, but in the convergence of repeated trials to the limiting &#8220;probabilities.&#8221;  Which explains not just why I&#8217;m an uber geekazoid, but also why I was quite shocked today when I Googled &#8220;gambler&#8217;s ruin&#8221; and found that the intertubes only returned about 16000 hits (&#8220;card counting,&#8221; by the way, returns about 845,000 hits.)  Gambler&#8217;s ruin is one of my favorite basic probability exercises (and a reason why many a poor soul, even if they have an advantage, ends up losing their money.)<br \/>\n<!--more--><br \/>\nWhat is gamber&#8217;s ruin?  Suppose you have access to a game in which you have a slight advantage in winning.  We codify this advantage by postulating that you win the game a certain percent of the time which we call p (having an advantage means p is greater than a half.)  In this game, you can bet a dollar on each run of the game and if you win you get another dollar.  If you lose, well, of course you lose your dollar.  Now starting with a bankroll of D dollars, you might be interested in figuring out what the probability is that you will run out of money before your bankroll expands to T dollars.  In other words, what is your probability of ruin, given a starting bankroll of D dollars, an advantage of p, and a target of T dollars?<\/p>\n<p>The way to calculate this is kind of cute.  We want to calculate Pr(Ruin starting with x dollars).  But this is equal to the probability of winning the first game times the probability of ruin starting with x+1 dollars plus the probability of losing the first game times the probability of ruin starting with x-1 dollars.  In other words Pr(Ruin starting with x dollars) =Pr(Ruin starting with x+1 dollars|won first game) Pr(won first game) + Pr(Ruin starting with x-1 dollars|lost first game) Pr(lost first game).  To simplify notation let Pr(Ruin starting with x dollars) be denoted by P(x).  Then we can express the above equation as P(x)=P(x+1) Pr(won first game) + P(x-1) Pr(lost first game).  But we know the probabilities of winning and losing that first and last game (it just p and 1-p respectivally.)  Thus we have P(x)=p P(x+1) + (1-p) P(x-1). <\/p>\n<p>Note that P(0)=1 (since if we start with no money we always end up ruined) and P(T)=0 (since if have our target amount of money then we are never ruined.)  The equation P(x)=pP(x+1)+(1-p)P(x-1) is a difference equation, and as such there are a couple of ways to solve this equation.  We will choose the method which is the bane of students everywhere: the method of judicious guessing.  In particular suppose that P(x)=k^x for some unknown k.  Then if this solves the difference equation we must have k^x = p k^{x+1} +(1-p) k^{x-1}.  Canceling out some k&#8217;s allows one to write this as k=p k^2 +(1-p).  This quadratic equation has two solutions for k: k_+ = 1 and k_- = (1-p)\/p (we will assume that p does not equal one half, i.e. someone has an advantage in the game.)  Call this later solution k=k_-=(1-p)\/p.  From this we can guess that a generic solution to the difference equation is P(x)= A 1^x + B k^x for some yet to be determined A and B.  Recalling that P(0)=1, we obtain A+B=1 and further using P(T)=0 we obtain A +B (k_-)^T = 0.  Thus B=1\/(1-k^T) and A= -k^T \/(1-k^T).  Putting this all together we obtain that P(x)=[-k^T+k^x] \/[1-k^T].  Since we start with D dollars, the formula for gambler&#8217;s ruin is thus P(D)=[k^D &#8211; k^T]\/[1-k^T].<\/p>\n<p>It&#8217;s useful to try some sample values in the formula to get an idea of what it is telling you.  Suppose that your goal is to double your money, i.e. T=2D.  Then a handy table to assemble is to figure out your probability of ruin given your advantage and the size of your bankroll:<\/p>\n<table border=\"2\" cellspacing=\"2\" align=\"center\">\n<tr>\n<th>D  p<\/th>\n<th>0.501<\/th>\n<th>0.505<\/th>\n<th>0.51<\/th>\n<th>0.55<\/th>\n<th>0.6<\/th>\n<\/tr>\n<tr>\n<th>1<\/th>\n<td>0.499<\/td>\n<td>0.495<\/td>\n<td>0.49<\/td>\n<td>0.45<\/td>\n<td>0.4<\/td>\n<\/tr>\n<tr>\n<th>5<\/th>\n<td>0.4950<\/td>\n<td>0.4750<\/td>\n<td>0.4502<\/td>\n<td>0.2683<\/td>\n<td>0.1164<\/td>\n<\/tr>\n<tr>\n<th>10<\/th>\n<td>0.4900<\/td>\n<td>0.4502<\/td>\n<td>0.4013<\/td>\n<td>0.1185<\/td>\n<td>0.0170<\/td>\n<\/tr>\n<tr>\n<th>100<\/th>\n<td>0.4013<\/td>\n<td>0.1192<\/td>\n<td>0.0180<\/td>\n<td>1.927 x 10<sup>-9<\/sup><\/td>\n<td>2.460 x 10<sup>-18<\/sup><\/td>\n<\/tr>\n<tr>\n<th>1000<\/th>\n<td>0.0180<\/td>\n<td>2.059 x 10<sup>-9<\/sup><\/td>\n<td>4.226 x 10<sup>-18<\/sup><\/td>\n<td>7.077 x 10<sup>-88<\/sup><\/td>\n<td>8.105 x 10<sup>-177<\/sup><\/td>\n<\/tr>\n<\/table>\n<p>From this table you can conclude a few things.  Even if you have, a fairly considerable advantage, say p=0.55, if you start with 10 dollars you will be ruined before reaching 20 dollars with about 11.8 percent probability.  As a gambler this really means that you need to pay attention to not just your odds of winning, but also to your bankroll: betting a substantial portion of your bankroll is a good way to go broke even when you&#8217;ve got a considerable advantage!  <\/p>\n<p>Suppose that you want a chance of ruin which is one in a thousand.  What size bankroll should you use given an advantage p an a desire for an unlimited upside?  A rough quick way to calculate this, given you have an advantage p is to calculate 7p\/(2p-1).  So if p=0.51, then this is about 178 (the real number is 172.)<\/p>\n<p>Even more humbling is to use the above formula for gambler&#8217;s ruin when you are at a disadvantage.  For example if you win 49 percent of the time, and want to double your initial 100 dollars, the probability of ruin is 98.2 percent.  Thinking about this you might realize why casinos make such good money even with games whose odds are only slightly stacked in their favor.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When I was a little kid I used to take a pair of dice and throw these dice repeatedly. At each throw I&#8217;d fill in a box for the corresponding number on some graph paper and I would essentially &#8220;race&#8221; the numbers against each other. I suppose for that reason I&#8217;ve always been fascinated not &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/dabacon.org\/pontiff\/2008\/09\/03\/wisely-using-your-advantage\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Wisely Using Your Advantage&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[41],"tags":[],"class_list":["post-2049","post","type-post","status-publish","format-standard","hentry","category-mathematics"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/dabacon.org\/pontiff\/wp-json\/wp\/v2\/posts\/2049","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dabacon.org\/pontiff\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dabacon.org\/pontiff\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dabacon.org\/pontiff\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dabacon.org\/pontiff\/wp-json\/wp\/v2\/comments?post=2049"}],"version-history":[{"count":0,"href":"https:\/\/dabacon.org\/pontiff\/wp-json\/wp\/v2\/posts\/2049\/revisions"}],"wp:attachment":[{"href":"https:\/\/dabacon.org\/pontiff\/wp-json\/wp\/v2\/media?parent=2049"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dabacon.org\/pontiff\/wp-json\/wp\/v2\/categories?post=2049"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dabacon.org\/pontiff\/wp-json\/wp\/v2\/tags?post=2049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}