See the top rated post in this thread. Click here

# Thread: Don/other experts, How to find covariance of a game ?

1. Did you find this post helpful? Yes | No

## Don/other experts, How to find covariance of a game ?

Hi Don/other experts,

How to find covariance of a game ?

There is an example how to find covariance of Blackjack at this link https://wizardofodds.com/games/blackjack/variance/

Firstly, find total variance of N hands per round, and use the formula,

Total variance of N hands per round= N* Variance of 1 hand per round+ N * (N-1) * covariance.

Fro example, variance of 1 hand per round = 1.31 and Total variance of 2 hands per round(through simulations) = 3.565, N = 2,

So, 3.565 = 2 * 1.31 + 2(1)* covariance

covariance = (3.565 - 2.62) /2 = 0.4725.

My question : Is simulations the only way to find total variance of N hands per round ?

Regards

James

2. 0 out of 2 members found this post helpful. Did you find this post helpful? Yes | No
Of course not. You can also do a combinatorial analysis to find the exact covariance.

3. Did you find this post helpful? Yes | No
Originally Posted by James989
My question : Is simulations the only way to find total variance of N hands per round ?
For a counting strategy cut card game, yes.

4. Did you find this post helpful? Yes | No
Originally Posted by Norm
For a counting strategy cut card game, yes.
I speculate that this simulation may need a massive computation power because covariance is the product of two variances. This means a squared amount of computations.

5. Did you find this post helpful? Yes | No
CVData calculates total variance only as opposed to calculating variance and covariance and using them to calculate total variance. (CVCX is a bit different.) Remember that players can change the number of hands played, and for cover purposes, may not change them based only on the count. Calculation of standard deviation requires almost no time in CVData. This is because this is the only per round, floating point calculation in CVData and the calc is overlapped with other non-FP calcs by the CPU as CPUs perform these operations in parallel. (It's a bit more complicated than that as an FP calc by the CPU keeps a port active for a bunch of cycles that could have been used for a non-FP calc in some CPUs.)

Below is a further discussion from my book:

Standard Deviations

Standard deviations are problematic in simulations for two reasons. First, adding billions of numbers in floating point causes inaccuracies. This is solved by the use of sim cycles discussed earlier, but, somewhat differently than with all other statistics. Since we are adding squares of numbers, the counters are much larger and 32 bit integers are not large enough. So, floating-point is used. This is the only use of floating point in the CVData sim engine.

Second, SD requires that you find the differences between each data point and the mean of all data points. This is normally easy. But, when you have billions of numbers, there is no way to know the mean of billions of numbers before using each number. There are several possible solutions discussed here.

Result tables
– The quickest method is to keep tables of the counts of different results. I believe SBA uses this method. For example, you have a counter for all results of all rounds that have a result of +/-1 unit. Another counter for all counts of +/-2 units. A separate counter exists for each possible round result. When the sim is complete, you can use this table to calculate the standard deviation. No multiplies are performed during the sim, mean can be calculated after the sim, and results are accurate. The table needs to include counters for every possible result. That means half units for insurance and surrender and a round where one player plays seven spots, split to eight hands at each spot, and doubles every hand. But, there is a problem. When you introduce unusual BJ payoffs or custom bonuses, the table becomes unwieldy. You could have a 1,000:1 payoff that hits more than one hand at once. As I was looking for maximum flexibility, I rejected this idea.

Assume the mean is zero
– Peter Griffin on page 167 of The Theory of Blackjack points out that the square of the average result can be assumed to be effectively zero. This means that the average squared result and variance are virtually the same in the case of variance of a Blackjack hand. So, we can ignore the calculation of the mean and differences between each result and the mean. And this means we can calculate standard deviation with one pass. This enormously simplifies SD calculations for Blackjack rounds and solves this one problem. BUT, we may want to calculate other standard deviations — for example, the standard deviation of results of Blackjack rebate sessions that include many hands. Assuming a mean of zero will not work in this case. We need another solution.

Standard deviation for a sample
– Calculating standard deviations from a sample of events is common. I rejected this, as the standard error of the calculation increases.

Calculating Running Variance
– In 1962, B. P. Welford described a method of calculating variance in one pass. Essentially, it recalculates the mean after examining each data point instead of after all data points. The mean is, at first, inaccurate, but becomes more and more accurate. The method is reasonably accurate, although it suffers some loss of precision due to the constant recalculations as well as loss of accuracy. But, the most serious problem is that the recalculation of the mean requires a divide for every hand. This is unacceptable. (CVData/CVCX do not perform divides during a sim cycle.)

Lagging means
– The method I settled on for sessions is somewhat like the Welford method, only I recalculate the mean once a sim cycle instead of once a round. By recalculating the mean every one million rounds, the precision, accuracy and speed problems are all solved. In theory, the result will be a tiny bit less accurate than one would expect for the total number of hands run. That is, you might need to run 300 million rounds to get the accuracy that you would expect for 250 million rounds. However, since standard deviation converges far more quickly than EV in Blackjack sims, the results will be as accurate as the EV results.

6. Did you find this post helpful? Yes | No
This is really for mathematicians. It becomes research. Thank you.

7. Did you find this post helpful? Yes | No
Originally Posted by aceside
Of course not. You can also do a combinatorial analysis to find the exact covariance.
Are you sure ? I think it may need a massive computation for MULTIPLE HANDS.

8. 0 out of 1 members found this post helpful. Did you find this post helpful? Yes | No
Originally Posted by James989
Are you sure ? I think it may need a massive computation for MULTIPLE HANDS.
I am not so sure because I am not a mathematician. If the covariance of two blackjack hands are well defined mathematically, it should have an exact value. You may ask Norm and Don about this.

9. Did you find this post helpful? Yes | No
Originally Posted by aceside
I am not so sure because I am not a mathematician. If the covariance of two blackjack hands are well defined mathematically, it should have an exact value. You may ask Norm and Don about this.
If you are not so sure, why did you say that it can be done with combinatorial analysis ? No offense.

10. Did you find this post helpful? Yes | No
Originally Posted by James989
If you are not so sure, why did you say that it can be done with combinatorial analysis ? No offense.
I responded to your post because I am an expert. There are two approaches to blackjack problems. If combinatorial analysis can not solve it, simulation might solve it. Clear?

Page 1 of 9 123 ... Last

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

#### About Blackjack: The Forum

BJTF is an advantage player site based on the principles of comity. That is, civil and considerate behavior for the mutual benefit of all involved. The goal of advantage play is the legal extraction of funds from gaming establishments by gaining a mathematic advantage and developing the skills required to use that advantage. To maximize our success, it is important to understand that we are all on the same side. Personal conflicts simply get in the way of our goals.