Shuffler Part 4

2021-09-26

In part 2 and part 3 of the shuffler series, we focused on how often we expect events like blitzers and jack of diamonds in the blinds. We checked the site data against the expectation we derived mathematically and determined the shuffler appears to be matching our expectation. In this part, we will derive one more expecation, check it, and then move on to checking whether the shuffler is behaving the same across all the players on the site.

First a word about “fairness” in the deal across players. We discussed that the probability any one player gets the queen of clubs in a hand is 18.75% (6 out of 32). We know it is unrealistic to expect every player to get the queen of clubs exactly as often. Imagine five players are sitting at a table in person, and they play 32 hands. We expect each player will have been dealt the queen of clubs 6 times in those 32 hands, but we aren’t surprised if one of the players is dealt the queen of clubs many more than 6 times while someone else only gets it once. In the short term, this deviation is expected in a random shuffler. As the players are dealt more and more hands, say thousands, we expect the rate at which they are dealt the queen of clubs will get closer and closer to 18.75%.

In this article, we will determine how much variation we expect based on the number of hands a player is dealt, and we will check whether the shuffler is matching that amount of variation.

Expected number of trump per hand

A player might be dealt anywhere between 0 and 6 trump in a hand. We would like to know the probability of each possible number of trump, and we will check whether our expectation matches the reality of what is happening on the site. We will count the total number of hands matching each trump count and divide each by the total number of possible hands that can be dealt.

Recall that the total number of possible hands is 32 choose 6, or 906,192. There are 14 trump and 18 fail making up the 32 card deck. Each trump count probability follows the convention below:

Let T = the number of trump

P(T=i)=(14i)(186i)(326)=906,192P(T = i) = \frac { {14 \choose i} {18 \choose 6-i} } { {32 \choose 6} } = 906,192

For example, if we want to know the probability of two trump dealt in a hand, that is

P(T=2)=(142)(184)(326)=30.729%P(T = 2) = \frac { {14 \choose 2} {18 \choose 4} } { {32 \choose 6} } = 30.729\%

The probability for each possible number of trump along with what is dealt on the site is shown in the table below.

Trump Count Website Shuffler Derived Expectation
0 2.050% 2.049%
1 13.195% 13.237%
2 30.780% 30.729%
3 32.779% 32.777%
4 16.905% 16.901%
5 3.957% 3.977%
6 0.333% 0.331%
Total 100% 100%

Since there are fewer trump than fail, it is not surprising that it is more likely to receive 0 trump than 6. We also see that it is normal to be dealt 2 or 3 trump. If a player requires 4 or more trump to pick, they will consider picking 20% of the time, but their picking percentage will be much less. Some of those hands will include the jack of diamonds, and in other cases, someone else will pick in front of them. In short, in order to get their share of picks (about 20%), a player must be willing to pick on 3 trump in the right situation.

Fairness of the deal across all players

We have a collection of over 1,000 players who have been dealt at least 250 hands. For any given player, we can calculate a confidence interval - say a 95% confidence interval - for the percentage of the time they are dealt a specific card or a certain number of trump. We can then check whether 95% of the players on the site are dealt the card or number of trump within the confidence interval.

Percentage of hands with a specific card

We will demonstrate the construction of the 95% confidence interval using the example of the percentage of hands a player is dealt the queen of clubs. The range is

0.1875±1.96σn0.1875 \pm 1.96 \cdot \frac { \sigma } { \sqrt{n} }

We need to calculate σ\sigma . Since the percentage of hands including the queen of clubs comes from a Bernoulli(.1875), the standard deviation or σ\sigma is simply 0.1875(10.1875)\sqrt{0.1875 \cdot (1 - 0.1875)} = 0.390. A player with 1,000 hands dealt will have a 95% confidence interval of

0.1875±1.960.3901000=(16.33%,21.17%).0.1875 \pm 1.96 \cdot \frac { 0.390 } { \sqrt{1000} } = (16.33\%, 21.17\%).

For contrast, the range for a player with 10,000 hands is (17.985%, 19.515%). The range is reduced the more hands a player has been dealt.

We will use this methodology to check a few interesting single cards first. The results are shown in the table below. The percent out of range should be about 5% for each one. There are a little over 1,000 players in the data, so each one of the “out of range” counts appears to be off by about 2-3 players.

Card % Out Of Range
Queen Of Clubs 4.75%
Queen Of Spades 5.33%
Queen Of Hearts 5.23%
Queen Of Diamonds 4.75%
Jack Of Diamonds 5.23%

A big takeaway is how much variation you might experience over 1,000 hands. The 95th percentile is dealt an extra queen of clubs every 20 hands when compared to the player at the 5th percentile. This rate of receiving the queen of clubs is virtually independent of the rate of receiving the queen of spades, so the short-term inequity is real.

Percentage of hands with a certain number of trump

We will use the same approach to determine the percentage of players out of their 95% confidence interval for each possible trump count. The table below shows the percentage of players who are outside the confidence interval for each trump count. They are all close enough to 5% so that the shuffler checks out in this respect.

Trump Dealt % Outside 95% CI
0 4.16%
1 3.97%
2 5.91%
3 5.13%
4 4.84%
5 3.97%
6 4.26%

Conclusions

Over the past four articles, we have checked the shuffler for accuracy with established principles of probability. We have checked how closely the streaks of blitzers produced by the shuffler match what we would expect. Prior to this article, we checked how the shuffler performs generally. In this article, we focused on fairness across all the players.

In every respect, the shuffler checked out. There are some important takeaways that have come from this investigation. Understandinging the expected frequency of events (particularly events that seem like they should be very unlikely) can make observing these events less frustrating.

  1. We expect someone to be dealt a blitzer on 1 in 4 hands.
  2. We expect someone to be dealt all four queens every 500 hands. Note that the picker will have all four queens after the bury more often than that.
  3. A player who is dealt 50 hands per day is more likely to see 5 or more blitzers in a row than a day without consecutive blitzers.
  4. A confidence interval can be calculated for the events we are interested in. In the four articles, we calculated a confidence interval several times and checked that the shuffler is within tolerance.

One of the themes in the effort to checkout the shuffler is the importance of seeing unusual events the right amount. The shuffler has dealt over 400,000 hands, so we are bound to see unusual occurences in 400,000 hands. We have checked that the site shuffler has produced unusual streaks, four queens in one hand, and six trump in one hand as often as expected.

Enough work has been done to convince the author that the shuffler is behaving properly.