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, 1/8 Regarding winning You win, 1, dollars with probability, 1/4 You win, 2, dollars with probability, 3/8 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, 1/2 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 3 2 3 t f + (6 t - 8 t ) f + (19 t - 48 t ) f + (84 t - 80 t + 128 t) f 3 2 2 3 2 3 + (71 t - 608 t + 320 t) f + (262 t - 360 t + 768 t - 512) f + 69 t 2 - 432 t + 320 t = 0 and in Maple notation t^3*f^6+(6*t^3-8*t^2)*f^5+(19*t^3-48*t^2)*f^4+(84*t^3-80*t^2+128*t)*f^3+(71*t^3 -608*t^2+320*t)*f^2+(262*t^3-360*t^2+768*t-512)*f+69*t^3-432*t^2+320*t = 0 The expected duration, let's call it, f[1], is one of the roots of the polynomial 3 2 -101 (101 f[1] + 2020 f[1] + 5344 f[1] - 7968) 3 2 (f[1] - 12 f[1] + 16 f[1] + 32) and in Maple notation -101*(101*f[1]^3+2020*f[1]^2+5344*f[1]-7968)*(f[1]^3-12*f[1]^2+16*f[1]+32) and its numerical value is 2.9653919099833889487 The second moment of the duration, let's call it, f[2], is one of the roots of the polynomial 3 2 -10201 (1030301 f[2] + 135999732 f[2] + 3414225408 f[2] + 2560353184) 3 2 (101 f[2] - 14140 f[2] + 367216 f[2] - 273824) and in Maple notation -10201*(1030301*f[2]^3+135999732*f[2]^2+3414225408*f[2]+2560353184)*(101*f[2]^3 -14140*f[2]^2+367216*f[2]-273824) and its numerical value is 33.317997349437264261 It follows that the variance is, 24.524448169642332716 and hence the standard-deviation is, 4.9522164905870515382 The , 3, -th moment of the duration, let's call it, f[3], is one of the roots of the polynomial 3 2 -10201 (1030301 f[3] - 4141810020 f[3] + 2981259771056 f[3] + 1233860899744) 3 2 (10510100501 f[3] + 42334684818028 f[3] + 30496930346132032 f[3] - 12804438319939488) and in Maple notation -10201*(1030301*f[3]^3-4141810020*f[3]^2+2981259771056*f[3]+1233860899744)*( 10510100501*f[3]^3+42334684818028*f[3]^2+30496930346132032*f[3]-\ 12804438319939488) and its numerical value is 939.83907491558073741 It follows that the scaled , 3, -th moment about the mean is, 5.7273511529336589468 The , 4, -th moment of the duration, let's call it, f[4], is one of the roots of the polynomial 3 2 -10201 (107213535210701 f[4] + 20233767219104335524 f[4] + 681489685420328978462016 f[4] + 75764210340425043689632) ( 3 2 10510100501 f[4] - 1983592287754732 f[4] + 66810049697118120112 f[4] - 8043308076789375392) and in Maple notation -10201*(107213535210701*f[4]^3+20233767219104335524*f[4]^2+ 681489685420328978462016*f[4]+75764210340425043689632)*(10510100501*f[4]^3-\ 1983592287754732*f[4]^2+66810049697118120112*f[4]-8043308076789375392) and its numerical value is 43886.178222130032516 It follows that the scaled , 4, -th moment about the mean is, 56.969352033877530334 To summarize the statistical data, expectation, variance, ... etc. is [2.9653919099833889487, 24.524448169642332716, 5.7273511529336589468, 56.969352033877530334] 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 [2.9653794731370811254, 24.521769946641356610, 5.7235096593685854360, 56.770427291271257723] and the probability that the goal is reached within, 200, rounds is , 0.99999994192561441291 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.1366666666666666667, 27.597988888888888889, 4.2544316072381530198, 24.464982396534363336] 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.70505142526109311635 This ends this article that took, 8.361, seconds to generate.