Pages:
Author

Topic: Satoshi Dice -- Statistical Analysis - page 75. (Read 192889 times)

legendary
Activity: 2940
Merit: 1333
July 24, 2012, 04:56:09 AM
Quote
Results: 2012-Jul-24 01:47am (up to block 190505)

   Address  Target   Should Win |    #Bets |       Win        |  Lose  | Refunds |   BTC In   |  BTC Out   |  Refund  |   Profit  |   RTP 
--------------------------------------------------------------------------------------------------------------------------------------------
 1dice1e6p       1      0.00002 |    10762 |      0 (0.00000) |  10482 |     280 |      57.71 |       0.01 |    17.88 |     57.69 |   0.033
 1dice1Qf4       2      0.00003 |      999 |      0 (0.00000) |    929 |      70 |       8.54 |       0.00 |     5.58 |      8.54 |   0.021
 1dice2pxm       4      0.00006 |     1506 |      0 (0.00000) |   1474 |      32 |      13.88 |       0.00 |     1.22 |     13.87 |   0.051
 1dice2vQo       8      0.00012 |     1289 |      0 (0.00000) |   1249 |      40 |      18.64 |       0.00 |     4.15 |     18.64 |   0.042
 1dice2WmR      16      0.00024 |     1514 |      0 (0.00000) |   1484 |      30 |      25.62 |       0.02 |     6.60 |     25.59 |   0.103
 1dice2xkj      32      0.00049 |     3455 |      1 (0.00029) |   3443 |      11 |     111.43 |     100.41 |     1.29 |     11.02 |  90.111
 1dice2zdo      64      0.00098 |     5210 |      7 (0.00135) |   5186 |      17 |     212.08 |     121.70 |    55.64 |     90.37 |  57.385
 1dice37Ee     128      0.00195 |     6325 |     15 (0.00239) |   6262 |      48 |    1234.78 |    1148.24 |    40.25 |     86.53 |  92.992
 1dice3jkp     256      0.00391 |     4874 |     22 (0.00453) |   4838 |      14 |     516.89 |     334.58 |    13.11 |    182.30 |  64.730
 1dice4J1m     512      0.00781 |     7647 |     49 (0.00641) |   7593 |       5 |    1560.53 |     746.69 |     9.35 |    813.84 |  47.848
 1dice5wwE    1000      0.01526 |    14013 |    205 (0.01463) |  13806 |       2 |    2299.43 |    1970.99 |     1.80 |    328.44 |  85.716
 1dice61SN    1500      0.02289 |     7801 |    183 (0.02348) |   7612 |       6 |    3073.99 |    3498.29 |    15.00 |   -424.30 | 113.803
 1dice6DPt    2000      0.03052 |     9469 |    298 (0.03148) |   9168 |       3 |    3437.89 |    3149.86 |     9.24 |    288.03 |  91.622
 1dice6gJg    3000      0.04578 |     7691 |    378 (0.04919) |   7306 |       7 |    4950.12 |    6483.39 |    24.99 |  -1533.26 | 130.974
 1dice6GV5    4000      0.06104 |     8533 |    543 (0.06366) |   7987 |       3 |    3045.70 |    2822.91 |    31.20 |    222.78 |  92.685
 1dice6wBx    6000      0.09155 |    15779 |   1491 (0.09453) |  14282 |       6 |    8760.70 |    8957.31 |     7.01 |   -196.61 | 102.244
 1dice6YgE    8000      0.12207 |    31680 |   3944 (0.12452) |  27729 |       7 |    6387.25 |    5654.73 |     0.00 |    732.51 |  88.532
 1dice7EYz   12000      0.18311 |    16580 |   3146 (0.18980) |  13429 |       5 |    6845.20 |    6994.97 |    14.50 |   -149.76 | 102.188
 1dice7fUk   16000      0.24414 |    44182 |  10721 (0.24269) |  33454 |       7 |   13861.13 |   13682.86 |    97.79 |    178.27 |  98.714
 1dice7W2A   24000      0.36621 |    32836 |  12157 (0.37060) |  20647 |      32 |   13747.50 |   13676.13 |   212.63 |     71.36 |  99.481
 1dice8EMZ   32000      0.48828 |   315841 | 153941 (0.48760) | 161769 |     131 |   98000.04 |   98557.45 |  2173.21 |   -557.40 | 100.569
 1dice97EC   32768      0.50000 |   130873 |  65255 (0.49891) |  65539 |      79 |   48823.95 |   47197.33 |   789.20 |   1626.61 |  96.668
 1dice9wcM   48000      0.73242 |    93996 |  69156 (0.73613) |  24790 |      50 |   76324.51 |   74924.62 |   467.98 |   1399.89 |  98.166
 1dicec9k7   52000      0.79346 |      875 |    700 (0.80000) |    175 |       0 |    1335.75 |    1344.51 |     0.00 |     -8.76 | 100.656
 1dicegEAr   56000      0.85449 |      689 |    569 (0.82583) |    120 |       0 |     407.99 |     343.46 |     0.00 |     64.52 |  84.184
 1diceDCd2   60000      0.91553 |      140 |    125 (0.91241) |     12 |       3 |      48.09 |      48.61 |     0.00 |     -0.52 | 101.093
 1dice9wVt   64000      0.97656 |     5906 |   5653 (0.97854) |    124 |     129 |    5025.32 |    4832.49 |   239.20 |    192.83 |  96.163
--------------------------------------------------------------------------------------------------------------------------------------------
                                |   780465 | 328559           | 450889 |    1017 |  300134.79 |  296591.69 |  4238.91 |   3543.10 |  98.819
--------------------------------------------------------------------------------------------------------------------------------------------

SD Profit before fees:       3543.10320692 BTC (1.181%)
Cumulative Fees Paid:         392.85462500 BTC
SD Profit after fees:        3150.24858192 BTC (1.050%)
----
Since Satoshi Dice started, there have been:
Blockchain Tx:  2373598  :  SatoshiDice Tx: 1441132  (60.7%)
Blockchain MB:  1002.6  :  SatoshiDice Tx: 592.4  (59.1%)

donator
Activity: 2058
Merit: 1007
Poor impulse control.
July 23, 2012, 05:05:51 AM
I used the pbinom function in R to calculate a binomial CDF, instead of messing with beta functions. You could also use the Gnu Scientific Library, specifically gsl_cdf_binomial_P where the three variables used in the function are the number of wins (q in R, k in gsl), the probability (p in both R and gsl), and the number of trials (size in R, n in gsl).

For my variables I used your data with the integer value in the "Win" column as q, the "Should win" column as p, and the "#Bets" column as size. If you're using R, also use the lower.tail = TRUE arg.
legendary
Activity: 2940
Merit: 1333
July 23, 2012, 04:46:18 AM
Interesting.

How are you calculating the CDF?
donator
Activity: 2058
Merit: 1007
Poor impulse control.
July 23, 2012, 02:05:55 AM
I thought this might be of interest. The last column of the table shows how probable the luck for a given game is. As a simple indicator, consider game with a CDF over 0.95 to be very lucky and any game with a CDF under 0.05 to be very unlucky.

As a measure is's quite useful since the CDF results tends to be counter-intuitive as they are affected by observation size as well as the outcome. For example, the 48000 game has been very lucky so far, even though the fraction of wins (0.73581) is not much larger than the probability (0.73242). The 128 game seems very lucky (0.00224 compared with 0.00195) but the CDF shows us this is not significantly lucky (0.75278). The 32 game seems unlucky (0.00029 cw 0.00049) but isn't unusual  (0.49737).


legendary
Activity: 2940
Merit: 1333
July 22, 2012, 07:18:44 PM
Quote
Results: 2012-Jul-22 04:03pm (up to block 190291)

   Address  Target   Should Win |    #Bets |       Win        |  Lose  | Refunds |   BTC In   |  BTC Out   |  Refund  |   Profit  |   RTP 
--------------------------------------------------------------------------------------------------------------------------------------------
 1dice1e6p       1      0.00002 |    10612 |      0 (0.00000) |  10333 |     279 |      53.52 |       0.01 |    17.86 |     53.51 |   0.036
 1dice1Qf4       2      0.00003 |      993 |      0 (0.00000) |    923 |      70 |       8.24 |       0.00 |     5.58 |      8.24 |   0.021
 1dice2pxm       4      0.00006 |     1499 |      0 (0.00000) |   1467 |      32 |      13.75 |       0.00 |     1.22 |     13.75 |   0.052
 1dice2vQo       8      0.00012 |     1285 |      0 (0.00000) |   1245 |      40 |      18.54 |       0.00 |     4.15 |     18.53 |   0.042
 1dice2WmR      16      0.00024 |     1480 |      0 (0.00000) |   1450 |      30 |      24.45 |       0.02 |     6.60 |     24.42 |   0.094
 1dice2xkj      32      0.00049 |     3442 |      1 (0.00029) |   3430 |      11 |     109.99 |     100.41 |     1.29 |      9.58 |  91.289
 1dice2zdo      64      0.00098 |     5178 |      7 (0.00136) |   5154 |      17 |     210.92 |     121.70 |    55.64 |     89.22 |  57.700
 1dice37Ee     128      0.00195 |     6262 |     14 (0.00225) |   6200 |      48 |    1233.88 |    1143.24 |    40.25 |     90.63 |  92.654
 1dice3jkp     256      0.00391 |     4662 |     21 (0.00452) |   4627 |      14 |     495.11 |     332.03 |    13.11 |    163.07 |  67.063
 1dice4J1m     512      0.00781 |     7173 |     46 (0.00642) |   7122 |       5 |    1514.92 |     717.83 |     9.35 |    797.08 |  47.384
 1dice5wwE    1000      0.01526 |    13523 |    193 (0.01427) |  13328 |       2 |    2208.67 |    1888.68 |     1.80 |    319.98 |  85.512
 1dice61SN    1500      0.02289 |     7503 |    175 (0.02334) |   7322 |       6 |    3046.90 |    3468.65 |    15.00 |   -421.74 | 113.842
 1dice6DPt    2000      0.03052 |     8696 |    279 (0.03209) |   8414 |       3 |    3386.76 |    3114.94 |     9.24 |    271.81 |  91.974
 1dice6gJg    3000      0.04578 |     7481 |    367 (0.04910) |   7107 |       7 |    4904.68 |    6452.27 |    24.99 |  -1547.58 | 131.553
 1dice6GV5    4000      0.06104 |     8246 |    522 (0.06333) |   7721 |       3 |    2999.67 |    2777.53 |    31.20 |    222.14 |  92.594
 1dice6wBx    6000      0.09155 |    15166 |   1426 (0.09406) |  13735 |       5 |    8653.84 |    8830.60 |     7.01 |   -176.76 | 102.043
 1dice6YgE    8000      0.12207 |    30631 |   3823 (0.12484) |  26801 |       7 |    6255.83 |    5535.22 |     0.00 |    720.60 |  88.481
 1dice7EYz   12000      0.18311 |    16525 |   3136 (0.18983) |  13384 |       5 |    6785.06 |    6957.16 |    14.50 |   -172.09 | 102.536
 1dice7fUk   16000      0.24414 |    43181 |  10481 (0.24276) |  32693 |       7 |   13578.67 |   13151.00 |    97.79 |    427.66 |  96.850
 1dice7W2A   24000      0.36621 |    32517 |  12037 (0.37054) |  20448 |      32 |   13709.59 |   13652.30 |   212.63 |     57.28 |  99.582
 1dice8EMZ   32000      0.48828 |   311497 | 151841 (0.48766) | 159525 |     131 |   96191.56 |   97008.25 |  2173.21 |   -816.69 | 100.849
 1dice97EC   32768      0.50000 |   129506 |  64573 (0.49891) |  64854 |      79 |   48455.42 |   46905.01 |   789.20 |   1550.41 |  96.800
 1dice9wcM   48000      0.73242 |    92779 |  68268 (0.73621) |  24461 |      50 |   74075.16 |   72580.05 |   467.98 |   1495.11 |  97.982
 1dicec9k7   52000      0.79346 |      712 |    570 (0.80056) |    142 |       0 |    1184.15 |    1200.70 |     0.00 |    -16.55 | 101.398
 1dicegEAr   56000      0.85449 |      336 |    272 (0.80952) |     64 |       0 |     234.41 |     184.05 |     0.00 |     50.35 |  78.518
 1diceDCd2   60000      0.91553 |       58 |     51 (0.87931) |      7 |       0 |      37.58 |      38.23 |     0.00 |     -0.65 | 101.732
 1dice9wVt   64000      0.97656 |     5850 |   5599 (0.97868) |    122 |     129 |    5021.19 |    4828.39 |   239.20 |    192.80 |  96.160
--------------------------------------------------------------------------------------------------------------------------------------------
                                |   766793 | 323702           | 442079 |    1012 |  294412.58 |  290988.41 |  4238.89 |   3424.17 |  98.837
--------------------------------------------------------------------------------------------------------------------------------------------

SD Profit before fees:       3424.17659660 BTC (1.163%)
Cumulative Fees Paid:         385.98247500 BTC
SD Profit after fees:        3038.19412160 BTC (1.032%)
----
Since Satoshi Dice started, there have been:>
Blockchain Tx:  2325411  :  SatoshiDice Tx: 1416455  (60.9%)
Blockchain MB:  983.2  :  SatoshiDice Tx: 582.3  (59.2%)

legendary
Activity: 2940
Merit: 1333
July 21, 2012, 03:08:29 PM
Quote
Results: 2012-Jul-21 11:24am (up to block 190118)

   Address  Target   Should Win |    #Bets |       Win        |  Lose  | Refunds |   BTC In   |  BTC Out   |  Refund  |   Profit  |   RTP 
--------------------------------------------------------------------------------------------------------------------------------------------
 1dice1e6p       1      0.00002 |    10512 |      0 (0.00000) |  10242 |     270 |      52.82 |       0.01 |    16.30 |     52.80 |   0.036
 1dice1Qf4       2      0.00003 |      990 |      0 (0.00000) |    921 |      69 |       8.04 |       0.00 |     5.38 |      8.04 |   0.022
 1dice2pxm       4      0.00006 |     1498 |      0 (0.00000) |   1466 |      32 |      13.55 |       0.00 |     1.22 |     13.55 |   0.049
 1dice2vQo       8      0.00012 |     1284 |      0 (0.00000) |   1244 |      40 |      18.14 |       0.00 |     4.15 |     18.13 |   0.034
 1dice2WmR      16      0.00024 |     1477 |      0 (0.00000) |   1447 |      30 |      24.42 |       0.02 |     6.60 |     24.39 |   0.094
 1dice2xkj      32      0.00049 |     3417 |      1 (0.00029) |   3405 |      11 |     106.99 |     100.40 |     1.29 |      6.59 |  93.841
 1dice2zdo      64      0.00098 |     5167 |      7 (0.00136) |   5143 |      17 |     209.30 |     121.70 |    55.64 |     87.60 |  58.146
 1dice37Ee     128      0.00195 |     6260 |     14 (0.00225) |   6198 |      48 |    1233.38 |    1143.24 |    40.25 |     90.13 |  92.692
 1dice3jkp     256      0.00391 |     4638 |     21 (0.00454) |   4603 |      14 |     494.40 |     332.03 |    13.11 |    162.37 |  67.159
 1dice4J1m     512      0.00781 |     7067 |     44 (0.00623) |   7018 |       5 |    1475.25 |     592.75 |     9.35 |    882.49 |  40.180
 1dice5wwE    1000      0.01526 |    13311 |    186 (0.01398) |  13123 |       2 |    2140.42 |    1683.04 |     1.80 |    457.37 |  78.631
 1dice61SN    1500      0.02289 |     7304 |    171 (0.02343) |   7127 |       6 |    2974.84 |    3383.09 |    15.00 |   -408.24 | 113.723
 1dice6DPt    2000      0.03052 |     7957 |    255 (0.03206) |   7699 |       3 |    3302.47 |    3015.76 |     9.24 |    286.71 |  91.318
 1dice6gJg    3000      0.04578 |     7341 |    364 (0.04963) |   6970 |       7 |    4856.92 |    6429.68 |    24.99 |  -1572.76 | 132.382
 1dice6GV5    4000      0.06104 |     7889 |    503 (0.06378) |   7383 |       3 |    2888.61 |    2689.64 |    31.20 |    198.97 |  93.112
 1dice6wBx    6000      0.09155 |    14890 |   1406 (0.09446) |  13479 |       5 |    8604.42 |    8781.98 |     7.01 |   -177.55 | 102.064
 1dice6YgE    8000      0.12207 |    30147 |   3774 (0.12522) |  26366 |       7 |    6206.82 |    5497.96 |     0.00 |    708.86 |  88.579
 1dice7EYz   12000      0.18311 |    16380 |   3106 (0.18968) |  13269 |       5 |    6750.36 |    6908.21 |    14.50 |   -157.85 | 102.338
 1dice7fUk   16000      0.24414 |    43006 |  10434 (0.24266) |  32565 |       7 |   13545.31 |   13113.43 |    97.79 |    431.88 |  96.812
 1dice7W2A   24000      0.36621 |    32168 |  11900 (0.37030) |  20236 |      32 |   13667.82 |   13608.03 |   212.63 |     59.79 |  99.563
 1dice8EMZ   32000      0.48828 |   308319 | 150251 (0.48753) | 157939 |     129 |   95502.88 |   96267.43 |  2173.21 |   -764.55 | 100.801
 1dice97EC   32768      0.50000 |   128228 |  63938 (0.49893) |  64213 |      77 |   48099.37 |   46629.50 |   789.20 |   1469.86 |  96.944
 1dice9wcM   48000      0.73242 |    90649 |  66699 (0.73616) |  23905 |      45 |   67451.56 |   65853.71 |   467.98 |   1597.84 |  97.631
 1dicec9k7   52000      0.79346 |      350 |    272 (0.77714) |     78 |       0 |     184.19 |     179.40 |     0.00 |      4.78 |  97.400
 1dicegEAr   56000      0.85449 |       99 |     76 (0.76768) |     23 |       0 |     196.36 |     148.35 |     0.00 |     48.00 |  75.552
 1diceDCd2   60000      0.91553 |       38 |     32 (0.84211) |      6 |       0 |      22.33 |      22.17 |     0.00 |      0.15 |  99.302
 1dice9wVt   64000      0.97656 |     5823 |   5572 (0.97857) |    122 |     129 |    5015.57 |    4822.75 |   239.20 |    192.81 |  96.156
--------------------------------------------------------------------------------------------------------------------------------------------
                                |   756209 | 319026           | 436190 |     993 |  285046.66 |  281324.42 |  4237.13 |   3722.24 |  98.694
--------------------------------------------------------------------------------------------------------------------------------------------

SD Profit before fees:       3722.24804889 BTC (1.306%)
Cumulative Fees Paid:         380.64905000 BTC
SD Profit after fees:        3341.59899889 BTC (1.172%)
----
Since Satoshi Dice started, there have been:
Blockchain Tx:  2286024  :  SatoshiDice Tx: 1396679  (61.1%)
Blockchain MB:  967.7  :  SatoshiDice Tx: 574.1  (59.3%)

legendary
Activity: 2940
Merit: 1333
July 20, 2012, 08:49:25 PM

This reminded me of both Penney's game

I hadn't been aware of that, it's an interesting problem. Thanks!

Btw, what are you using for charts?

I was made aware of it by one of Derren Brown's TV shows - possibly this one.  I'd check but I think the storm outside is making my Internet connection too flaky to do anything much at the moment.

The charts are from gnuplot using data generated by a modified version of the extras/sample_armory_code.py script in the armory git repository.
donator
Activity: 2058
Merit: 1007
Poor impulse control.
July 20, 2012, 07:37:44 PM
Here, for 6 heads in a row.  The expected length of a round is the sum of the probability of each outcome times the length of that outcome:

.......

so 63/32 flips.  The expected number of rounds to get 6 heads is 64, the expected length of each round is 63/32, so the expected number of flips is 64*63/32 = 126.

I follow now. Nice clear way to approach the problem when you put it like that.

This reminded me of both Penney's game

I hadn't been aware of that, it's an interesting problem. Thanks!

Btw, what are you using for charts?
legendary
Activity: 2940
Merit: 1333
July 20, 2012, 03:05:14 PM
After all that unpleasant maths Wink back the your regularly scheduled tables of numbers and graphs...

Quote
Results: 2012-Jul-20 11:44am (up to block 189971)

   Address  Target   Should Win |    #Bets |       Win        |  Lose  | Refunds |   BTC In   |  BTC Out   |  Refund  |   Profit  |   RTP  
--------------------------------------------------------------------------------------------------------------------------------------------
 1dice1e6p       1      0.00002 |    10450 |      0 (0.00000) |  10180 |     270 |      51.83 |       0.01 |    16.30 |     51.82 |   0.037
 1dice1Qf4       2      0.00003 |      989 |      0 (0.00000) |    920 |      69 |       7.94 |       0.00 |     5.38 |      7.94 |   0.022
 1dice2pxm       4      0.00006 |     1498 |      0 (0.00000) |   1466 |      32 |      13.55 |       0.00 |     1.22 |     13.55 |   0.049
 1dice2vQo       8      0.00012 |     1284 |      0 (0.00000) |   1244 |      40 |      18.14 |       0.00 |     4.15 |     18.13 |   0.034
 1dice2WmR      16      0.00024 |     1476 |      0 (0.00000) |   1446 |      30 |      24.37 |       0.02 |     6.60 |     24.34 |   0.094
 1dice2xkj      32      0.00049 |     3417 |      1 (0.00029) |   3405 |      11 |     106.99 |     100.40 |     1.29 |      6.59 |  93.841
 1dice2zdo      64      0.00098 |     5167 |      7 (0.00136) |   5143 |      17 |     209.30 |     121.70 |    55.64 |     87.60 |  58.146
 1dice37Ee     128      0.00195 |     6257 |     14 (0.00225) |   6195 |      48 |    1233.36 |    1143.24 |    40.25 |     90.11 |  92.693
 1dice3jkp     256      0.00391 |     4609 |     21 (0.00457) |   4574 |      14 |     491.61 |     332.02 |    13.11 |    159.58 |  67.538
 1dice4J1m     512      0.00781 |     6931 |     43 (0.00621) |   6883 |       5 |    1460.76 |     580.23 |     9.35 |    880.52 |  39.721
 1dice5wwE    1000      0.01526 |    12041 |    169 (0.01404) |  11870 |       2 |    2089.30 |    1665.78 |     1.80 |    423.51 |  79.729
 1dice61SN    1500      0.02289 |     7031 |    163 (0.02320) |   6862 |       6 |    2947.56 |    3355.32 |    15.00 |   -407.76 | 113.834
 1dice6DPt    2000      0.03052 |     7634 |    244 (0.03197) |   7387 |       3 |    3242.60 |    2968.55 |     9.24 |    274.04 |  91.549
 1dice6gJg    3000      0.04578 |     7038 |    350 (0.04978) |   6681 |       7 |    4810.53 |    6361.10 |    24.99 |  -1550.57 | 132.233
 1dice6GV5    4000      0.06104 |     7602 |    487 (0.06409) |   7112 |       3 |    2775.87 |    2565.27 |    31.20 |    210.59 |  92.413
 1dice6wBx    6000      0.09155 |    14370 |   1355 (0.09433) |  13010 |       5 |    8526.55 |    8694.98 |     7.01 |   -168.42 | 101.975
 1dice6YgE    8000      0.12207 |    29138 |   3640 (0.12495) |  25491 |       7 |    6098.25 |    5379.06 |     0.00 |    719.19 |  88.207
 1dice7EYz   12000      0.18311 |    16210 |   3072 (0.18957) |  13133 |       5 |    6661.61 |    6807.11 |    14.50 |   -145.49 | 102.184
 1dice7fUk   16000      0.24414 |    42396 |  10284 (0.24261) |  32105 |       7 |   13255.13 |   12875.71 |    97.79 |    379.42 |  97.138
 1dice7W2A   24000      0.36621 |    31849 |  11782 (0.37031) |  20035 |      32 |   13330.29 |   13301.97 |   212.63 |     28.32 |  99.787
 1dice8EMZ   32000      0.48828 |   304780 | 148509 (0.48747) | 156142 |     129 |   93709.98 |   94614.77 |  2173.21 |   -904.78 | 100.966
 1dice97EC   32768      0.50000 |   127050 |  63345 (0.49888) |  63629 |      76 |   46098.86 |   44536.87 |   789.20 |   1561.98 |  96.612
 1dice9wcM   48000      0.73242 |    89590 |  65896 (0.73590) |  23649 |      45 |   65018.36 |   63475.25 |   467.98 |   1543.10 |  97.627
 1dicec9k7   52000      0.79346 |      157 |    123 (0.78344) |     34 |       0 |      61.72 |      60.32 |     0.00 |      1.39 |  97.733
 1dicegEAr   56000      0.85449 |       51 |     39 (0.76471) |     12 |       0 |     131.38 |      93.56 |     0.00 |     37.82 |  71.213
 1diceDCd2   60000      0.91553 |       22 |     17 (0.77273) |      5 |       0 |      15.59 |      15.31 |     0.00 |      0.27 |  98.235
 1dice9wVt   64000      0.97656 |     5809 |   5560 (0.97853) |    122 |     127 |    5013.48 |    4820.66 |   239.20 |    192.82 |  96.154
--------------------------------------------------------------------------------------------------------------------------------------------
                                |   744846 | 315121           | 428735 |     990 |  277405.04 |  273869.34 |  4237.13 |   3535.69 |  98.725
--------------------------------------------------------------------------------------------------------------------------------------------

SD Profit before fees:       3535.69622366 BTC (1.275%)
Cumulative Fees Paid:         374.93467500 BTC
SD Profit after fees:        3160.76154866 BTC (1.139%)
----
Since Satoshi Dice started, there have been:
Blockchain Tx:  2249769  :  SatoshiDice Tx: 1376978  (61.2%)
Blockchain MB:  952.8  :  SatoshiDice Tx: 565.8  (59.4%)



I noticed a sharp drop of 100 BTC or so on the red line about a day ago and looked to see what happened.

This bet is responsible for the loss.  2 BTC on each of lessthan 1500, 2000, 3000, and 4000, with a lucky number of 920 winning all 4 bets.  A 223.90897599 BTC return for an 8 BTC outlay!

Quote
Bet: lessthan 3000
Bet Amount: 2.00000000
Payment: 42.65159066

Bet: lessthan 2000
Bet Amount: 2.00000000
Payment: 63.97263600

Bet: lessthan 1500
Bet Amount: 2.00000000
Payment: 85.29368133

Bet: lessthan 4000
Bet Amount: 2.00000000
Payment: 31.99106800
legendary
Activity: 2940
Merit: 1333
July 20, 2012, 02:07:34 PM
I'm not sure of your method but you do have the correct answer. In general, the number of coin tosses it takes on average to get n heads in a row is given by:

Code:
(p^(-n) - 1)/(1 - p), where p = 0.5 and n = the number of heads in a row

  Heads in a row   Expect. no. tosses
               1                  2
               2                  6
               3                 14
               4                 30
               5                 62
               6                126

Try this against your method and see if you're right in a few more cases. I'm not saying you're wrong, just that I don't follow how you got your result.

Here, for 6 heads in a row.  The expected length of a round is the sum of the probability of each outcome times the length of that outcome:

Outcomep(Outcome)len(Outcome)p(Outcome)*len(Outcome)
T1/211/2
HT1/421/2
HHT1/833/8
HHHT1/1641/4
HHHHT1/3255/32
HHHHHT1/6463/32
HHHHHH1/6463/32
-----
63/32

so 63/32 flips.  The expected number of rounds to get 6 heads is 64, the expected length of each round is 63/32, so the expected number of flips is 64*63/32 = 126.

It was fun and I got to learn some new things. Plus you also persevered - I could have been wrong.

... and you were, a couple of times...  Wink  But only in little ways.

This reminded me of both Penney's game and the discussion around this question, both of which you may find interesting if you didn't see them before.
donator
Activity: 2058
Merit: 1007
Poor impulse control.
July 20, 2012, 08:49:40 AM
You're right.  It seems counter-intuitive to me that flipping three heads in a row (a 1-in-8 shot) takes an expected 14 flips to happen, but it does.

Because the average length of a round which ends when we either flip a tail or get 3 heads:

T : half the time
HT : 1/4 the time
HHT : 1/8 the time
HHH : 1/8 the time

is 1*1/2 + 2*1/4 + 3*1/8 + 3*1/8 = 1.75 tosses - so the expectation is that it takes 1.75*8 = 14 flips.

Tricky one, that. Toss a coin one million times and see how many times you get three heads in a row, right? Not a geometrically distributed random anymore, since the round end is either throwing a tail or or getting three heads in a row.

I'm not sure of your method but you do have the correct answer. In general, the number of coin tosses it takes on average to get n heads in a row is given by:

Code:
(p^(-n) - 1)/(1 - p), where p = 0.5 and n = the number of heads in a row

  Heads in a row   Expect. no. tosses
               1                  2
               2                  6
               3                 14
               4                 30
               5                 62
               6                126
               7                254
               8                510
               9               1022
             10               2046
             11               4094
             12               8190
             13              16382
             14              32766
             15              65534
             16             131070
             17             262142
             18             524286
             19            1048574
             20            2097150

Try this against your method and see if you're right in a few more cases. I'm not saying you're wrong, just that I don't follow how you got your result.

There's a very nice derivation of this (and of a more general solution where the probability of a head or tail varies with each toss) using Markov chains here.

Thanks for persevering with me!

It was fun and I got to learn some new things. Plus you also persevered - I could have been wrong.
legendary
Activity: 2940
Merit: 1333
July 20, 2012, 04:49:56 AM
You're right.  It seems counter-intuitive to me that flipping three heads in a row (a 1-in-8 shot) takes an expected 14 flips to happen, but it does.

Because the average length of a round which ends when we either flip a tail or get 3 heads:

T : half the time
HT : 1/4 the time
HHT : 1/8 the time
HHH : 1/8 the time

is 1*1/2 + 2*1/4 + 3*1/8 + 3*1/8 = 1.75 tosses - so the expectation is that it takes 1.75*8 = 14 flips.

Thanks for persevering with me!
donator
Activity: 2058
Merit: 1007
Poor impulse control.
July 20, 2012, 03:09:25 AM
There is a mean of 2 flips per game, so we'd expect exactly 10 heads in a row once every 2048 flips.

Is that 'exactly' where we are differing?  The guy didn't have exactly 75 losses and then a win.  He had 75 losses and quit playing.  Who knows how many losses he would have had if he had kept playing.


Then he hasn't finished playing, in terms of the definition of "round" which I gave above. This is equivalent to "75 losses or greater" the probability which is as I described:

This means the probability of 75 or more plays before a win is given by the upper tail geometric distribution CDF

except I was wrong - the upper tail CDF is (1-1/p)^(k-1). Ooops! Still, the basic idea remains the same - multiply by the number of expected rounds per game to get the number of plays before 75 losses on a row or more occurs.

I think we expect at least 10 heads in a row once every 1024 flips.

(exactly 11 heads is half as likely as exactly 10, exactly 12 is half as likely again,etc.  1/2 + 1/4 + ... = 1.  ie. the chance of seeing exactly 10 is the same as the chance of seeing 11 or more.  I see exactly 10 once every 2048 flips, I see 11 or more once every 2048 flips too.  Combining these 2, I see 10 or more every 1024 flips.

Sure. As per the first part of my post, you can find the probability of 10 or more heads by using the upper tail CDF: (1-p)^(k-1). In this case, it's (1-1/2)^9 = 1/512. This probability means that for a round defined as a series of flips ending in a tail, flipping 10 or more heads in a row should occur once every 512 rounds, or once every 1024 plays - as you saw in your simulation.

So going back to the original question - how many times would any one players be expected to play to experience 75 losses or more in a row? The upper tail CDF is (1-8000/65536)^(75-1) = 1/15274.94  and the mean number of plays per round = 8.192, so we would expected a run of 75 losses or greater to occur once every  125132.3 plays. Different from my original answer because I had the upper tail CDF function wrong. You can check with this simulation if you like:

Code:
> rg   <- rgeom(1e07, 8000/65536) + 1
> 1/(length(which(rg>=75))/sum(rg))
[1] 129051.3

I could be wrong - write your own sim to check and see how it goes!
legendary
Activity: 2940
Merit: 1333
July 20, 2012, 02:16:29 AM
There is a mean of 2 flips per game, so we'd expect exactly 10 heads in a row once every 2048 flips.

Is that 'exactly' where we are differing?  The guy didn't have exactly 75 losses and then a win.  He had 75 losses and quit playing.  Who knows how many losses he would have had if he had kept playing.

I think we expect at least 10 heads in a row once every 1024 flips.

(exactly 11 heads is half as likely as exactly 10, exactly 12 is half as likely again,etc.  1/2 + 1/4 + ... = 1.  ie. the chance of seeing exactly 10 is the same as the chance of seeing 11 or more.  I see exactly 10 once every 2048 flips, I see 11 or more once every 2048 flips too.  Combining these 2, I see 10 or more every 1024 flips.
donator
Activity: 2058
Merit: 1007
Poor impulse control.
July 20, 2012, 01:21:31 AM
OK, here's how I see it:

The number of times any one player must play before he wins at the 8000/65536 game is a shifted geometrically distributed random variable, p = 8000/65536. Let the term "round" indicate a series of plays ending in a win.

This means the probability of 75 or more plays before a win is given by the upper tail geometric distribution CDF:

Code:
(1-8000/65536)^75 =  5.747515e-05

So for every round played, there is a 5.747515e-05 chance the round will end after 74 plays. So, on average, we expect one in 17398.82 rounds to last 75 plays or more.

The mean number of plays per round is:

Code:
1/p = 8.192

So, converting rounds to plays, we expect a run of 75 or more losses in a row to occur once in 17398.82 * 8.192 = 142531.1 plays.

So I was out by a factor of almost 10.


For you (fair) coin flip example, calling a series of plays ending in a head a "round", 10 heads in a row has a probability of occurring determined by the probability density function, p*(1-p)^(k-1).

In this case, k = 10 and p = 0.5, so the probability of winning exactly 10 heads in a row for a given round is 0.5*(1-0.5)^9 = 1024

There is a mean of 2 flips per game, so we'd expect exactly 10 heads in a row once every 2048 flips.

Here is my code for a coin flip simulation, written in R:

Code:
> rg   <- rgeom(1e06, 1/2) + 1
> length(which(rg==10))/sum(rg)
[1] 0.0004780581

1/0.0004780581 = 2091.796, quite close to the exact 2048.


Edit: If you want to know the probability of exactly 75 losses in a row occurring, use the geometric distribution probability density function: p*(1-p)^(k-1) =  8000/65536*(1- 8000/65536)^(75-1) = 7.99154e-06 or once in 125132.3 rounds. Since one round has a mean number of plays of 8.192, the expected number of plays before a round of exactly 75 losses before one win is 125132.3 * 8.192 = 1025084 plays.

Some more R code for you to try, simulating a game that ends a series of losses with a win, the probability of a win being 8000/65536:

Code:
> rg   <- rgeom(1e07, 8000/65536) + 1
> 1/(length(which(rg==75))/sum(rg))
[1] 1092795

Quite close. The lower p is the greater the variance so you might want to bump the first term in rgeom() up to 1e10 if you machines faster than my work computer.





legendary
Activity: 2940
Merit: 1333
July 20, 2012, 12:09:34 AM
Here's the simulation code:

Quote
#!/usr/bin/python

import random

trials = 100000
target = 10
max = 2**target * target

count =
  • * max
for trial in range(trials):
    in_a_row = 0
    for flip in range(max):
        if random.random() < 0.5:
            in_a_row += 1
            if in_a_row == target:
                count[flip] += 1
                break
        else:
            in_a_row = 0

cumulative = 0
for flip in range(max):
    cumulative += count[flip]
    if count[flip]:
        print("%4d on flip %d; cumulative %6.2f%%" %
              (count[flip],
               flip+1,
               100.00 * cumulative / trials))
donator
Activity: 2058
Merit: 1007
Poor impulse control.
July 19, 2012, 10:37:00 PM
I think you might be right - serves me right for posting while trying to leave early for lunch. I'll go over it later and see if I come to the same results as you.
legendary
Activity: 2940
Merit: 1333
July 19, 2012, 10:20:15 PM
Quick comment: It's even unluckier than that, since  it's 1 chance in 17399 of a run of 75 or less bets in a row not winning - so that's going to have required 17399 * 75 =   1304925 or more bets to make it likely to have occurred once.

Enjoying you analysis so far - thanks for your work.

I'm not sure, but I don't think you should multiply by 75.  Maybe add (75-1).

Consider flipping a fair coin.  How many times do you need to flip before it is 'likely' to get 10 heads in a row?

It's a 1-in-1024 chance, so I would say you need to flip 1024 + (10-1) = 1033 coins to have a reasonable chance of 310 heads in a row.

By your (implied) logic would you say you need 1024*10 = 10240 flips to make it likely?

I just ran a simulation.  Flipping coins until getting 10 in a row, and counting how many flips it took.  I tried it 100,000 times.  116 (0.12%) of those times the first 10 coins were all heads.  To have a 1% chance of getting 10 heads in a row I had to flip 29 times.  For 10% I had to flip 221 coins, etc.  Flipping 1033 coins gives a 39.71% chance of getting 10 heads in a row.

But flipping 10239 coins gives a huge 99.34% chance.

I have a feeling this is a binomial distribution thing, so I should be able to work out the maths rather than doing it by simulation.  But I think that after 17399 * 75 plays you're almost guaranteed to have a losing streak of 75 or more.

Oh, and the analysis I'm posting is based on work done by etotheipi - the OP in this thread.  But I'm glad you appreciate it.
donator
Activity: 2058
Merit: 1007
Poor impulse control.
July 19, 2012, 09:51:37 PM
The house edge is determined by the payout when you win.  The chance of winning is always the same - it picks a number between 0 and 65535 and you win if the number is less than 8000.  Your calculation is off a little because 1 - 8000/65536 isn't 7/8, it's a little more than that.

I make it a one-in-17399 chance of losing all 75 bets, so still really unlucky.  But then again 1-in-17k shots do happen.  About once every 17k bets.  And there have been over 600k bets.

 >>> 1 / ((1 - 8000/65536.0) ** 75)
  17398.822919111808


Quick comment: It's even unluckier than that, since  it's 1 chance in 17399 of a run of 75 or less bets in a row not winning - so that's going to have required 17399 * 75 =   1304925 or more bets to make it likely to have occurred once.

Enjoying you analysis so far - thanks for your work.



legendary
Activity: 2940
Merit: 1333
July 19, 2012, 07:20:10 PM
3 new games have been introduced: lessthan 52k, 56k, and 60k:

Quote
Results: 2012-Jul-19 04:14pm (up to block 189848)

   Address  Target   Should Win |    #Bets |       Win        |  Lose  | Refunds |   BTC In   |  BTC Out   |  Refund  |   Profit  |   RTP 
--------------------------------------------------------------------------------------------------------------------------------------------
 1dice1e6p       1      0.00002 |    10095 |      0 (0.00000) |   9826 |     269 |      49.71 |       0.01 |    16.20 |     49.70 |   0.039
 1dice1Qf4       2      0.00003 |      984 |      0 (0.00000) |    915 |      69 |       7.78 |       0.00 |     5.38 |      7.78 |   0.023
 1dice2pxm       4      0.00006 |     1493 |      0 (0.00000) |   1461 |      32 |      13.09 |       0.00 |     1.22 |     13.08 |   0.043
 1dice2vQo       8      0.00012 |     1279 |      0 (0.00000) |   1240 |      39 |      17.68 |       0.00 |     3.65 |     17.67 |   0.027
 1dice2WmR      16      0.00024 |     1470 |      0 (0.00000) |   1440 |      30 |      22.89 |       0.01 |     6.60 |     22.87 |   0.074
 1dice2xkj      32      0.00049 |     3389 |      1 (0.00030) |   3377 |      11 |     105.91 |     100.40 |     1.29 |      5.50 |  94.798
 1dice2zdo      64      0.00098 |     5162 |      7 (0.00136) |   5138 |      17 |     206.73 |     121.68 |    55.64 |     85.04 |  58.863
 1dice37Ee     128      0.00195 |     6247 |     14 (0.00226) |   6185 |      48 |    1233.06 |    1143.24 |    40.25 |     89.81 |  92.716
 1dice3jkp     256      0.00391 |     4562 |     21 (0.00462) |   4528 |      13 |     490.07 |     332.02 |    13.11 |    158.04 |  67.750
 1dice4J1m     512      0.00781 |     6775 |     42 (0.00620) |   6728 |       5 |    1456.03 |     580.09 |     9.35 |    875.93 |  39.841
 1dice5wwE    1000      0.01526 |    10486 |    150 (0.01431) |  10334 |       2 |    2051.62 |    1587.69 |     1.80 |    463.92 |  77.388
 1dice61SN    1500      0.02289 |     6898 |    160 (0.02322) |   6732 |       6 |    2902.66 |    3248.48 |    15.00 |   -345.82 | 111.914
 1dice6DPt    2000      0.03052 |     7521 |    243 (0.03232) |   7275 |       3 |    3202.11 |    2904.42 |     9.24 |    297.69 |  90.703
 1dice6gJg    3000      0.04578 |     6914 |    348 (0.05038) |   6559 |       7 |    4767.11 |    6317.21 |    24.99 |  -1550.09 | 132.516
 1dice6GV5    4000      0.06104 |     7399 |    473 (0.06395) |   6923 |       3 |    2699.06 |    2458.54 |    31.20 |    240.52 |  91.089
 1dice6wBx    6000      0.09155 |    14175 |   1327 (0.09365) |  12843 |       5 |    8502.09 |    8668.21 |     7.01 |   -166.12 | 101.954
 1dice6YgE    8000      0.12207 |    28522 |   3556 (0.12471) |  24959 |       7 |    6058.32 |    5341.87 |     0.00 |    716.44 |  88.174
 1dice7EYz   12000      0.18311 |    16117 |   3051 (0.18936) |  13061 |       5 |    6638.82 |    6772.67 |    14.50 |   -133.85 | 102.016
 1dice7fUk   16000      0.24414 |    42142 |  10219 (0.24253) |  31916 |       7 |   13161.09 |   12747.59 |    97.79 |    413.49 |  96.858
 1dice7W2A   24000      0.36621 |    31588 |  11696 (0.37064) |  19860 |      32 |   13225.56 |   13222.07 |   212.63 |      3.49 |  99.974
 1dice8EMZ   32000      0.48828 |   301258 | 146729 (0.48726) | 154400 |     129 |   92456.79 |   93222.19 |  2173.21 |   -765.39 | 100.828
 1dice97EC   32768      0.50000 |   126199 |  62916 (0.49885) |  63207 |      76 |   45118.62 |   43391.34 |   789.20 |   1727.28 |  96.172
 1dice9wcM   48000      0.73242 |    88026 |  64754 (0.73600) |  23227 |      45 |   62057.75 |   60478.44 |   467.98 |   1579.30 |  97.455
 1dicec9k7   52000      0.79346 |       23 |     18 (0.78261) |      5 |       0 |      10.68 |      11.64 |     0.00 |     -0.96 | 109.002
 1dicegEAr   56000      0.85449 |       11 |      7 (0.63636) |      4 |       0 |       0.32 |       0.27 |     0.00 |      0.04 |  85.085
 1diceDCd2   60000      0.91553 |        4 |      3 (0.75000) |      1 |       0 |       2.55 |       2.71 |     0.00 |     -0.16 | 106.514
 1dice9wVt   64000      0.97656 |     5794 |   5545 (0.97847) |    122 |     127 |    5012.36 |    4819.54 |   239.20 |    192.81 |  96.153
--------------------------------------------------------------------------------------------------------------------------------------------
                                |   734533 | 311280           | 422266 |     987 |  271470.56 |  267472.47 |  4236.53 |   3998.08 |  98.527
--------------------------------------------------------------------------------------------------------------------------------------------

SD Profit before fees:       3998.08798832 BTC (1.473%)
Cumulative Fees Paid:         369.74470000 BTC
SD Profit after fees:        3628.34328832 BTC (1.337%)
----
Since Satoshi Dice started, there have been:
Blockchain Tx:  2218777  :  SatoshiDice Tx: 1359223  (61.3%)
Blockchain MB:  939.4  :  SatoshiDice Tx: 557.9  (59.4%)

Pages:
Jump to: