vpFREE2 Forums

How to calc variance: JoB-9/6 and Dbl Pay Poker examples

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 :wink:

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

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.<<
<<
A variance of 242 is the highest I've every heard of for a VP game,
but I'm not surprised ... more than 10 times higher than JorB. I
thought your explanation was very clear, and the method seemed
correct to me.

As far as the combined variance, it seems more likely it would be
additive, in some sense, rather than an average of the two figures.

···

--- In vpFREE@yahoogroups.com, Bill Velek <billvelek@a...> wrote:

... others who I'm sure are more proficient at math than I am can

brumar_lv wrote:

As far as the combined variance, it seems more likely it would be
additive, in some sense, rather than an average of the two figures.

The concept that needs to be factored in is covariance -- the fact
that there's a relationship between the dealt hands and the resultant
final hands. A strong dealt hand will likely produce strong final
hands. This serves to increase variance.

- Harry

brumar_lv wrote:

> ... 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.<<
<<
A variance of 242 is the highest I've every heard of for a VP game,
but I'm not surprised ... more than 10 times higher than JorB. I
thought your explanation was very clear, and the method seemed
correct to me.

As far as the combined variance, it seems more likely it would be
additive, in some sense, rather than an average of the two figures.

The reason why I believe that you should average the two is this: if you were to play 1000 games of JoB-9/6 and then turn around and play 1000 games of NSUDs, wouldn't you say at the end of the day that you played 2000 games of VP with an _average_ of the two different ER's ... (99.54+99.73)/2= 99.635% ...? That seems logical to me. And if your ER for the day is the average of the ERs for the two games that you played that day, then why wouldn't the variance _for_the_day_ be the average of the variances of the two different games that you played? I submit that they would be, unless and until one of the math gurus provides a satisfactory explanation as to why it should be otherwise.

Now, if the above happens to be right, then consider this: it doesn't make any difference if I play 1000 games of JoB before the NSUDs, or if I play 500 of JoB, 500 NSUDs, then go back and play another 500 JoB, and finally the last 500 of NSUDs. It also doesn't matter if I alternately play a dozen of one and then a dozen of the other, back and forth until I've played a thousand of each. And I could also sit down and play one game on one machine and the other game on the machine next to it, alternating back and forth, one at a time. And it _seems_ to me that that is precisely what you are doing when you play Double Pay Poker, despite that you pay for both games up front before you play the first game. That is also the approach that I had taken when I had done my variance calculations for Multi Strike. The only reason that I had any doubts at all is because there are occasions when the dealt hand is going to automatically be the proper held hand for the 'second' game, which I thought _might_ call for some fancy computations of some sort, and perhaps it does. However, if Double Pay Poker is played long-term, then we should still eventually get a frequency distribution for each stage of the the game (essentially for each of two separate games) equal to what I had posted earlier for each stage, and I don't think it should ever make a difference that the proper strategy, in some instances, is to throw away cards which caused a payment in the first stage (e.g., collecting payment for a dealt low-pair or high-pair, which is then discarded in favor of holding a 4-Royal because the EV is higher). And my intuition is that with an near infinite number of games, it really doesn't matter that a dealt win in the first stage/game, such as a dealt Royal, is automatically going to be a winning hand in the second stage/game, because the stats for the second game already contemplate a number of dealt winners anyway. Anyway, I am still a bit unsure about whether the relationship of these two 'games' somehow biases them in some way to make their treatment as two separate games inappropriate. Incidentally, there is no similar relationship between the separate levels in Multi Strike, so I had no doubts about my calculations for that game.

_IF_ is is legitimate to treat the two stages of Double Pay in the same manner as two separate games, then let's relook at whether we should average the two variances. Let's pretend that the games have no relationship, as if it were possible to play a different hand in the second stage than what has been dealt in the first stage. In the long-term, there would be times when a player would lose both games, and times when a player would win the first but lose the second, or lose the first and win the second, or win both games. But regardless of those matchups, the frequency stats would still end up to be what we have already calculated, so I'm not sure that it should matter that in some games we are paid twice for the same hand, although I could be wrong. If I have time, maybe I can actually combine both frequency tables, square the difference for each hand (dealt or drawn) from the average of both games, multiply that by the frequency, total them all, and then divide by the larger figure of 5,197,920 instead of 2,598,960 to see how that would look, but I'll need the paytable for the second-stage to do that (I mentioned in my last post that I couldn't seem to find it on WinPoker).

I'm still hoping one of the math gurus will jump in here and help.

Cheers.

Bill Velek

···

--- In vpFREE@yahoogroups.com, Bill Velek <billvelek@a...> wrote:

Harry Porter wrote:

brumar_lv wrote:
> As far as the combined variance, it seems more likely it would be
> additive, in some sense, rather than an average of the two figures.

The concept that needs to be factored in is covariance -- the fact
that there's a relationship between the dealt hands and the resultant
final hands. A strong dealt hand will likely produce strong final
hands. This serves to increase variance.

Well, I thought that something like that might need to be factored in, but I wasn't sure. One way that I think that the need could be tested would be to create a combined paytable that accounts for all possible 2-stage outcomes, and then just use the regular variance formula. This would require some extra figuring, but then we would know for sure, so I might tackle this when I have extra time. I have finally figured the paytable out with WinPoker to get an ER of 97.87%, so I now have the correct figures to work with. In most instances, a dealt hand that wins in the first stage/game will be kept and is just an added value above the drawn hands in the second stage/game. For instance, we would have ...

HAND PAY in B.U.s FREQ. NOTE
Dealt Royals 12,800 4 Pay combines 12,000 betting units for a 'dealt' Royal with 800 betting units for the ending hand.
Royals from 1-Hi-Pair 802 ? When 'dealt' a 4-Royal/Hi-Pair or when dealt a KQJs or QJTs simultaneously with JJ, QQ, or KK,
                                                                                                 then we are paid '2' for the Hi-Pair, which is discarded to then complete a Royal.
Royals from 1-Lo-Pair 801 ? When 'dealt' a 4-Royal/Pair-Tens or a 3-Royal/Pair-Tens, paid '1' for TT and then complete a Royal.
Royals from Nothing 800 ? Whenever start without a paying 'dealt' hand, but then finish with a Royal.

The same thing would be done for the times when we break an initial deal of a paying 'two-pair' in order to keep just the pair of Aces. And when we have a 'dealt' FH consisting of a set of Aces, we split the FH by discarding the other pair and keep just the triple-Aces; we might draw another pair to give us a FH for the second stage/game, or maybe not. I don't know what the freq. of the above hands would be, so I've just used a question mark, but that can be easily calculated (I'm just not taking the time right now). We could then find the ER for each such hand, multiply it by the freq. and then add all of those sums and divide by _2_ betting units for each of the 2,598,960 "games" in a cycle {"games" meaning both stages combined). That would give us the ER for the "game", and we would then set about squaring the delta for each of the various hands listed (e.g., 802 minus the mean; 801 minus the mean; etc.).

I can't see how that would fail to give us the variance, since it is merely the application of the standard variance formula using the final result of each 2-stage "game".

Of course, it might be easier to adjust with co-variance, if that is actually appropriate for use here, but then I would expect that the results from those two different methods would be the same. Just two different ways to skin the same cat. At least that's what it seems like to me.

Cheers.

Bill Velek

Bill Velek wrote:

One way that I think that the need could be tested would be to
create a combined paytable that accounts for all possible
2-stage outcomes, and then just use the regular variance formula.

Bill, trust me when I say that you're not prepared to do this
accurately. The joint outcomes are far too complex. For myself, I'm
satisfied with a "finger in the wind" assessment that Double Pay is a
very volatile game.

- H.

--- In vpFREE@yahoogroups.com, "Harry Porter" <harry.porter@v...>
wrote:

Bill Velek wrote:
> One way that I think that the need could be tested would be to
> create a combined paytable that accounts for all possible
> 2-stage outcomes, and then just use the regular variance

formula.

Bill, trust me when I say that you're not prepared to do this
accurately. The joint outcomes are far too complex. For myself,

I'm

satisfied with a "finger in the wind" assessment that Double Pay is

a

very volatile game.

- H.

I agree, but I must compliment Bill too. He has managed an indepth
evaluation of a very complicated playing situation ... probably more
than anyone ever has before.

I have been reading the regs in Missouri and with respect to the setting of video poker paybacks, the regs read as follows:

Electronic gaming devices must not be set out to pay less that 80 percent of all wagers. Electronic gaming devices that may be affected by player skill must meet this standard when using a method of play that will provide the greatest return to the player over a period of continuous play.

What does that mean? Are video poker games dealt from a 52 deck in Missouri, or not?

I cannot find anything in Mississippi regs regarding this.

···

---------------------------------
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster.

[Non-text portions of this message have been removed]

I found the Mississippi gaming regs. They are clearer than Missouri:

Electronic gaming devices must not be set out to pay less that 80 percent nor greater than 100% of each wager available for play on the device. Electronic gaming devices that may be affected by player skill must meet this standard when using a method of play that will provide the greatest return to the player over a period of continuous play.

For gaming devices that are representative of live gambling games, the mathematical probability of a symbol or other element appearing in a game outcome must be equal to the mathematical probability of that symbol or element appearing in a live gambling game.

···

---------------------------------
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster.

[Non-text portions of this message have been removed]

sorry, there is a typo, below, it should be NOT less than 80 percent

···

Judy Freiberg <judyfreiberg@yahoo.com> wrote:
I found the Mississippi gaming regs. They are clearer than Missouri:

Electronic gaming devices must not be set out to pay less that 80 percent nor greater than 100% of each wager available for play on the device. Electronic gaming devices that may be affected by player skill must meet this standard when using a method of play that will provide the greatest return to the player over a period of continuous play.

For gaming devices that are representative of live gambling games, the mathematical probability of a symbol or other element appearing in a game outcome must be equal to the mathematical probability of that symbol or element appearing in a live gambling game.

---------------------------------
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster.

[Non-text portions of this message have been removed]

vpFREE Links:

http://www.west-point.org/users/usma1955/20228/VP/Links.htm

Yahoo! Groups Links

---------------------------------
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster.

[Non-text portions of this message have been removed]