This started under the thread "[vpFREE] Re: Double Pay Poker: Computing the Return", but because this post will contain info that some folks might find useful for other vp games, I'm starting this as a new thread. In the former thread brumar_lv asked how to calculate the variance for Double Pay Poker based on the following paytable and other details which he provided for that game, including his most recently corrected info; I am also revising my former calculations of ER per the new 'correct' data that he provided in his most recent post in that thread. The info he provided (the paytable) combined with my info (frequency of hands and ER from each hand) are combined in the following table that was posted in that thread (now revised to reflect changed data):
HAND PAY Exp.FREQ. ER
RF: 60,000 4 240,000
SF: 2,500 36 90,000
4Aces w/2,3,4: 5,000 12 60,000
4-2,3,4 w/A,2,3,4: 2,000 36 72,000
4Aces: 2,000 36 72,000
4-2,3,4: 1,000 108 108,000
4-5thruK: 500 432 216,000
FH: 200 3,744 748,800
F: 100 5,108 510,800
ST: 50 10,200 510,000
3ofaK: 30 54,912 1,647,360
2Pair: 20 123,552 2,471,040
JorBPair: 10 337,920 3,379,200
Pair of 5-10: 5 506,880 2,534,400
TOTAL: 12,659,600
Cost to play games = 52!/47!/5!*5= 12,994,800
TOTAL RETURN % = 12,659,600/12,994,800*100= 97.420506664204143195739834395297%
The above ER is only for the "initial deal" portion of the game. After
that part of the game, I understand that you then play-out your hand
with a paytable that renders an ER of 97.87% as per your revised statement.
You would then average the two = (97.42+97.87)/2= 97.645% TOTAL ER for GAME.
Now, I know how to calculate variance for individual games, but when we get into more complex games such as multi-play, Multi Strike, and two-stage games such as this one (paying first on the initial deal and then again after the draw), I'm not as confident and will certainly defer to the real math gurus here. My inclination would be to simply average the variance from the first stage with the variance from the second stage; any comments or corrections on that will certainly be appreciated.
Now, how do you calculate the variance for a simple game (or one stage in this case)? Well, let's start first with a demonstration in a case that we can easily verify with WinPoker -- JoB-9/6 Full-Coin -- and as a foundation I will now print the relevant portion of the details screen from WinPoker's analysis of that game, but I am having it expressed in betting units, so the first thing you need to do is to go to WinPoker and set the value of a Royal, single-coin, to 800 (4000 full-coin divided by 5 coins), and then print the single-coin details as follows (we only need the paytable and frequency of hands):
JACKS OR BETTER
Hand Name Payout Frequency
ROYAL FLUSH 800 64.345748
STRAIGHT FLUSH 50 284.08995
4 OF A KIND 25 6140.1617
FULL HOUSE 9 29919.766
FLUSH 6 28626.273
STRAIGHT 4 29184.676
3 OF A KIND 3 193489.19
TWO PAIR 2 335990.70
JACKS OR BETTER 1 557697.91
NOTHING 0 1417562.9
Total Return 99.5439%
Variance 19.51468
We note that WinPoker says that the variance for this game is 19.51468, so that's what we can expect to get. There are two measurements of variance (I'm not a math teacher and I'm rusty on stuff that I don't use much, so I can't explain very well why there are two ... but one is essentially just an adjustment when we have limited sample sizes, and the other is for very large sample sizes), but the two formulas are almost identical and they are both based on the square of the delta between the samples and average. Taking the JoB-9/6 example, we know that the average paytable value is the long-term expected return, i.e., 99.5439%, which we will henceforth express as a decimal (.995439). I am now doing to go reprint the above table and add new columns for the delta (difference between the hand-value and average-value), along with another column which squares the delta, and a column which multiplies that value by the frequency of that hand, as follows (e.g., the Delta for a Royal is 800 - .995439 = ):
JACKS OR BETTER Hand Name Pays Delta Delta^2 Frequency ***(Delta^2) x Frequency
ROYAL FLUSH 800 799.004561 638408.288498802721 64.345748 41078858.852855258187180308
STRAIGHT FLUSH 50 49.004561 2401.446998802721 284.08995 682226.95781751506875395
4 OF A KIND 25 24.004561 576.218948802721 6140.1617 3538077.5202527283399857
FULL HOUSE 9 8.004561 64.072996802721 29919.766 1917049.071256160483286
FLUSH 6 5.004561 25.045630802721 28626.273 716963.064815900488833
STRAIGHT 4 3.004561 9.027386802721 29184.676 263461.358964088303396
3 OF A KIND 3 2.004561 4.018264802721 193489.19 777490.80188399608599
TWO PAIR 2 1.004561 1.009142802721 335990.70 339062.5966861906947
JACKS OR BETTER 1 0.004561 0.000020802721 557697.91 11.60163402401311
NOTHING 0 -0.995439 0.990898802721 1417562.9 1404661.3803917086509
TOTAL: 50717863.206557570316134958
We then take that TOTAL, above, and divide it by the total number of hands, which we already know is 52!/47!/5!= 2,598,960 ...
50717863.206557570316134958 / 2598960 = 19.514676334594441744441991411949
We can see that our result, when compared to the WinPoker variance of 19.51468 differs by only
-0.0000036654 ... which I think is close enough for government work 
The second method of calculating variance merely divides the total squared-deltas by the Total number of sample ... MINUS ONE! i.e., in this case ... 2,598,960 - 1 = 2,598,959 ... so if we proceed to divide our TOTAL by that, we get an almost identical answer (because this is a large sample) of ... 50717863.206557570316134958/2598959= 19.514683843245534198936942829802
I can't tell you which of the two is technically the correct one to use, but who really cares ... the difference between the two methods is less than .00000751
Now let's calculate the variance for the 'initial-deal' portion of Double Pay Poker, using the table of values at the very top of this post, but converted to betting units (e.g., the Royal is changed from 60,000 to 12,000), and with the addition of new columns for the 'Delta', 'Delta^2', and '(Delta^2)xFrequency'); note also that the 'Delta' is the difference of the pay for that hand and the average (ER), which is calculated at the top of this post, converted to decimal, is .97420506664204143195739834395297 which I will round to .9742 --
HAND PAYS Delta Delta^2 Freq ***(Delta^2) x Freq
RF: 12,000 11999.0258 143976620.14906564 4 575906480.59626256
SF: 500 499.0258 249026.74906564 36 8964962.96636304
4Aces w/2,3,4: 1,000 999.0258 998052.54906564 12 11976630.58878768
4-2,3,4 w/A,2,3,4: 400 399.0258 159221.58906564 36 5731977.20636304
4Aces: 400 399.0258 159221.58906564 36 5731977.20636304
4-2,3,4: 200 199.0258 39611.26906564 108 4278017.05908912
4-5thruK: 100 99.0258 9806.10906564 432 4236239.11635648
FH: 40 39.0258 1523.01306564 3,744 5702160.91775616
F: 20 19.0258 361.98106564 5,108 1848999.28328912
ST: 10 9.0258 81.46506564 10,200 830943.669528
3ofaK: 6 5.0258 25.25866564 54,912 1387003.84762368
2Pair: 4 3.0258 9.15546564 123,552 1131176.09075328
JorBPair: 2 1.0258 1.05226564 337,920 355581.6050688
Pair of 5-10: 1 0.0258 0.00066564 506,880 337.3996032
JUNK HANDS 0 -0.9742 0.94906564 1,555,980 1476727.1545272
TOTAL: 629559214.7077344
Once again, this is for a total of 2,598,960 hands, so ...
Variance = 629559214.7077344/2598960= 242.23505352438452303998522485917 or 242.2351
or if you prefer the other figure using 'N-1' as the dividend ...
Variance = 629559214.7077344/2598959= 242.23514672903050798415827260068 or 242.2351
Howard Stern, Harry Porter, Steve Jacobs, and a host of others who I'm sure are more proficient at math than I am can probably confirm whether the total variance for the whole game -- combining both the first stage payout for 'dealt' hands PLUS the second stage for 'completed' hands -- is an average of the two or something else.
I can't seem to find the game on WinPoker to retrieve the variance for the 'completed' hands, but I think once you get that you would just average it with my above figure.
Finally, I'm not going to swear to the accuracy of the above calculations because I'm not going to take the time to create a spreadsheet with check sums (the procedure I use for working out my own strategy charts). But in principle, that is how you calculate variance.
Harry Porter, as I've told you previously, I no longer have my variance calculations for Multi Strike, but as best I can recall, I believe that all I did was do separate calculations for each level using the different frequencies derived after strategy adjustment, and then used a weighted average for each level to account for the free rides, and then I think I just averaged the weighted figures for all levels. I'd have to either redo the calcs or have something to look at again to get it clear in my mind, but I was pretty confident that I figured it correctly.
If anyone spots any mistakes in the above, please let me know because after all the work I put into this post, I'm planning on adding it to my velek.com website.
Thanks.
Bill Velek