Statistical Analysis of the number of Rounds until you have at least ONE \ dollar In a Casino with a Certain Roulette By Shalosh B. Ekhad Once upon a time there was a casino with a strange roulette, where there were, 4, possible outcomes as follows. Regarding losing You lose, 1, dollars with probability, 1/4 You lose, 2, dollars with probability, 3/20 Regarding winning You win, 1, dollars with probability, 1/4 You win, 2, dollars with probability, 7/20 You start with a capital of 0 dollars, and have unlimited credit. Your goal \ in life is to gain a POSITIVE amount, and you quit as soon as you reach that goal. Note that the expected gain in ONE round is, 2/5 Since it is positive, sooner or later you will reach your goal. The probability generating function, let's call it f=f(t), for the random va\ riable "duration of game" in other words, the formal power series whose coefficient of, t^n is the pro\ bability of ending after n rounds satisfies the following algebraic equation 3 6 3 2 5 3 2 4 27 t f + (135 t - 180 t ) f + (372 t - 960 t ) f 3 2 3 3 2 2 + (1514 t - 1460 t + 2400 t) f + (1151 t - 10140 t + 5200 t) f 3 2 3 2 + (4031 t - 5000 t + 11600 t - 8000) f + 770 t - 6260 t + 4800 t = 0 and in Maple notation 27*t^3*f^6+(135*t^3-180*t^2)*f^5+(372*t^3-960*t^2)*f^4+(1514*t^3-1460*t^2+2400* t)*f^3+(1151*t^3-10140*t^2+5200*t)*f^2+(4031*t^3-5000*t^2+11600*t-8000)*f+770*t ^3-6260*t^2+4800*t = 0 The expected duration, let's call it, f[1], is one of the roots of the polynomial 3 2 -3296112 (2472084 f[1] + 51501750 f[1] + 157915075 f[1] - 207051500) 3 2 (12 f[1] - 170 f[1] + 325 f[1] + 500) and in Maple notation -3296112*(2472084*f[1]^3+51501750*f[1]^2+157915075*f[1]-207051500)*(12*f[1]^3-\ 170*f[1]^2+325*f[1]+500) and its numerical value is 3.6613328900723105254 The second moment of the duration, let's call it, f[2], is one of the roots of the polynomial -2037066434352 3 2 (52737792 f[2] - 13453630480 f[2] + 649001154825 f[2] - 448536730500) ( 3 2 82893816284751104 f[2] + 20593932483242852400 f[2] + 977674291276048802075 f[2] + 677854858915081991500) and in Maple notation -2037066434352*(52737792*f[2]^3-13453630480*f[2]^2+649001154825*f[2]-\ 448536730500)*(82893816284751104*f[2]^3+20593932483242852400*f[2]^2+ 977674291276048802075*f[2]+677854858915081991500) and its numerical value is 63.542756492198646088 It follows that the variance is, 50.137397960273388178 and hence the standard-deviation is, 7.0807766495119296467 The , 3, -th moment of the duration, let's call it, f[3], is one of the roots of the polynomial 3 -226340714928 (225146947692010244446767366144 f[3] 2 + 2625937515506546826946942274908800 f[3] + 5679469441421622771319459399954006075 f[3] 3 - 2134727543783693934054829590987471500) (15915612726672211968 f[3] 2 - 185521127239709343940480 f[3] + 401152646359814056974099425 f[3] + 149596201169553951414014500) and in Maple notation -226340714928*(225146947692010244446767366144*f[3]^3+ 2625937515506546826946942274908800*f[3]^2+5679469441421622771319459399954006075 *f[3]-2134727543783693934054829590987471500)*(15915612726672211968*f[3]^3-\ 185521127239709343940480*f[3]^2+401152646359814056974099425*f[3]+ 149596201169553951414014500) and its numerical value is 2868.4549739076713812 It follows that the scaled , 3, -th moment about the mean is, 6.3903929765821922131 The , 4, -th moment of the duration, let's call it, f[4], is one of the roots of the polynomial 3 -2037066434352 (7549617941402461967641684072819630014464 f[4] 2 + 6611153430490846452197569113919747440051532800 f[4] + 1071571800117558643862387816462246713466448229856075 f[4] + 115245050310196779647506354094676353739534249671500) ( 3 4803134884096218548197703811072 f[4] 2 - 4206107336573295545669793292423674880 f[4] + 681750842197083384685459765737692856156825 f[4] - 76230431629461174914087243863639875610500) and in Maple notation -2037066434352*(7549617941402461967641684072819630014464*f[4]^3+ 6611153430490846452197569113919747440051532800*f[4]^2+ 1071571800117558643862387816462246713466448229856075*f[4]+ 115245050310196779647506354094676353739534249671500)*( 4803134884096218548197703811072*f[4]^3-4206107336573295545669793292423674880*f[ 4]^2+681750842197083384685459765737692856156825*f[4]-\ 76230431629461174914087243863639875610500) and its numerical value is 214748.97810361790008 It follows that the scaled , 4, -th moment about the mean is, 70.536314980480830979 To summarize the statistical data, expectation, variance, ... etc. is [3.6613328900723105254, 50.137397960273388178, 6.3903929765821922131, 70.536314980480830979] Just to make sure, let's compare it with the much faster way of truncating t\ he prob. generating function up to, 200, rounds The corresponding approximation is [3.6602790196548799086, 49.900407689155101397, 6.2825477896260354440, 66.134451199775526460] and the probability that the goal is reached within, 200, rounds is , 0.99999525583310194941 Finally, let's compare it to the results of simulating it, 300, times. Of course this changes from time to time The corresponding crude approximation is [3.6200000000000000000, 39.508933333333333333, 4.4289461079378197906, 27.870931169922449542] and the fraction of the simulated games that for which the goal was reached \ within, 200, rounds is , 1. So far we considered the Solitaire game. Now suppose that two players take t\ urns, and the first player to reach the goal of having positive capital is declared the winner. Assuming that th\ ey each are give at most, 200, turns the probability of the first-to-move player winning is 0.68949024800235351112 This ends this article that took, 11.641, seconds to generate.