Shuffle Tracking Theory
by Statman.
Question:
Posted by GT on November 14, 1996 at 10:30:46:
Here's a "theory" question which I've asked before with no satisfactory
response.
Suppose you're using the hi-lo count, playing a 4-deck game with 1 deck cut
off. The running count at the end of 3 decks is +10, indicating that there is a -10
count in the 1 deck cutoff. Suppose the shuffle mixes that 1 deck cutoff into one deck
randomly chosen from the played cards, forming a 2-deck slug which you perfectly cut to the top of the shoe. What is the correct way to play the first two decks of
the shoe?
We know that the expected running count after the 2 decks will be -10+10/3 =
-6 2/3 because the -10 slug was mixed with a 1/3 of a +10 pack. But we do not know
that the _exact_ running count after 2 decks will be -6 2/3, so I think that we cannot
just perform a true count conversion as though we are playing a 2-deck game.
So does anyone know the right way to play this? It's not obvious to me.
Answer:
Posted by StatMan on November 28, 1996 at 07:44:54: In Reply to: shuffle
tracking theory posted by GT on November 14, 1996 at 10:30:46:
Yes, the right way to play it is known, and has been known for a very long time.
The answer for your situation is: Start off the top with a running count of +10.
Pretend that you are playing against 3 decks to do your normalization. So if your
count a half deck in (after starting at +10) is say +6, the true count is +6/2.5 =
2.4. When you approach the end of the 2 deck packet, such that the next hand
will use cards outside the packet, you should "shut off" your shuffle track by
subtracting off the +10 extra count that you started with, and normalizing as usual
to the 4 deck shoe.
As a plausibility check, suppose that your count after 1 deck was the expected
+6.67. Since there are two "pseudo-decks" remaining, the true is still 3.33, just
like it was off the top.
In the general case, in which you mix some other number of cards into some
other size pack, you would have to multiply your slug count by some factor
before normalizing to some number of pseudo-decks. Your case is just an easy
one in which the factor is exactly 1, and the number of pseudo-decks is exactly
3.
The formula for these parameters was known in 1981(!) by the Boston Team. It
was referred to with great awe and respect as "The NRS Formula" (NRS=Non
Random Shuffle) or just "The Formula". It was used successfully for several years
in AC and LV before most playable casinos caught on and introduced stronger
shuffles. The formula was developed by some Operations Research guys and
statisticians associated with the team. Unfortunately, I really don't know who
exactly to give credit to. A guy in a trenchcoat named Gary? Mark? Was Joel
involved? Maybe JP knows. I heard rumors that the formula was published in an
obscure OR journal somewhere, but I really have no idea.
What amazes me is how many years later I still see people trying to track shuffles
and bet by the seat of their pants. I have heard of NOBODY outside the Boston
Team (well ok maybe one other team that I wrote some multi-packet tracking
software for) that ever played shuffles properly. They are probably missing 90%
of the EV they could get.
Example: You find a casino with 6 deck shoes and an old-fashioned six part
break-down shuffle. You are able to count 20 cards, which get shuffled only into
a 1 deck pack. You are able to cut this to the front of the shoe. Wow. How do
you play?
Suppose that your 20 cards have a count of -4, that is, they are good cards.
They get shuffled up into a deck and you cut them to the front. You play a half
deck, and the count drops by 5. You put in 4 good cards, 5 have come out.
Most seat-of-the-pants shuffle trackers would drop their bets at this point. But is
the party really over? Answer: No way! The actual true count at this point is
+1.687. You're still far inside positive EV territory.
The NRS formula would tell you that in this situation, you should multiply your
'slug' count by 1.97 and then play as if the shoe has 2.21 decks. It won't hurt
anything to call the multiplier 2. (I also call the multiplier positive when it's really
negative. A negative slug count, meaning that it contains good cards, translates
into a positive running count off the top.) A conservative policy would be to
normalize to 2.5 decks, since maybe you counted only 18 cards this time, and
maybe the pack is a couple cards bigger than 52. Still, with these conservative
numbers, you should have started with a running count of +8. After a drop of 5,
this is still +3. So we have a conservative estimate of true = 1.5, which is still
something to work with.
Note that if you used the multiplier of 1.97 and 2.21 pseudo-decks, you would
have a true of 1.68. This is a very good approximation to the actual true count.
I mention this because the 1.687 number above is not a result from the NRS formula, but instead an exact calculation of ALL the conditional probabilities. The
NRS formula gives a linear approximation to the true count. It's not exact, but
it's very, very good.
I don't know if this is the appropriate place to just blurt out the equations in all
their glory. Maybe this is a topic that people are paying good money to hear
about on the green or black chip pages. (I wouldn't have any idea since I don't
actually get to play often enough to justify subscribing.)
But this is a theory page, which gives me the right to put all kinds of boring math
into an article. So for those who want to try this at home, and aren't afraid of a
"brownian bridge" or a diffusion process, here's all the hints you need:
Suppose you've counted 'k' cards out of a shoe of 'd' cards. Call the count 'c'.
To make things easier, think of the cards you've counted as being painted red.
Paint the remainder of the shoe blue. (This is better done at home in a thought
experiment than in a casino.) Now mix enough blue cards into the red cards to
make a pack of size 'q'. It's this pack that we want to cut to the front and play.
Now suppose that you've played 'lambda' cards out of this mixed pack, and the
(naïve) count of those cards is 'alpha'. If you could simply know how much of
'alpha' came from the red cards and how much of it came from the blue cards,
you could calculate the true count of the remaining red cards, the true count of
the remaining blue cards, and then construct the true count of the remaining pack.
The trick is to assume that the red and blue counts are each following
independent brownian diffusion processes. Don't think of integer numbers of
cards coming out of the shoe. Think of each red and blue card being cut up into a
million tiny cards, each with a 1/1000th fraction of the count. Deal these tiny
fractional cards out. After playing 'lambda' cards out of the 'q' sized pack, we
expect to have played 'n=lambda*k/q' red cards (or fractions thereof). Since we
are dealing the tiny cards, the law of large numbers will make sure that this
fraction is exact.
At this point assume that the standard deviation of the count of the red cards is:
sigma[red] = sqrt(10/13*n*(k-n)/k)
Note that it is not 'k-1' as is usual in the denominator for discrete cases, but only
'k'. That's the difference between counting discrete cards and the brownian
diffusion. This also is the key to the approximation. (Otherwise we get mired in
trying to mix in the probability that 'n-1' or 'n+1' or whatever red cards came
out.) But in addition to making the math work out better later, it happens that this
continuous version of sigma is actually a better estimate. It takes into account the
fact that we only know the expected number of cards that have been dealt. It lets
us meaningfully talk about dealing 3.4 cards or even 0.35 cards.
Similarly, you can write down sigma[blue]. It's the same except that you replace
'n' with 'lambda-n' and 'k' with 'd-k'.
The a priori probability of any combination of red and blue counts is now a
product of two Gaussians. We already have the sum of these two counts,
'alpha', and want to determine the most likely red and blue counts. Do this. You
should find yourself maximizing the quadratic term from the exponents of the
Gaussians.
Now that you have the most likely red and blue counts, compute the true count
for the remainder of the pack. (I've sprinkled enough numerical examples in that
you can check your results as you go, even before you've managed to simplify
them.)
Here's the AMAZING MAGIC SURPRISE: You can rearrange the resulting
formula to read:
true = (r*c + alpha) / (N - lambda/52)
for appropriate choices of 'r' and 'N'. These are the multiplier and
pseudo-decks that I talked about.
That's it. Enjoy and profit.
You might wonder about how good this approximation is. I mean, did we
assume that 'k' was large compared to 1 or something? The answer is that the
approximation is very robust and very good.
Having much more computer power available now than I had 15 years ago, I
finally wrote a program that computes the EXACT conditional probabilities. I
have found that the approximation formula is so close in every case that you will
never need a better one.
Here's an example you can try at home. (The bored reader better get off here.)
Suppose you count ONE card from a 6 deck shoe and its count is -1, i.e. it's a
good card. Suppose the dealer mixes it into 51 other cards from the shoe. Cut
the packet to the front and start to play. Now suppose that exactly 26 cards
have been dealt and the running count has dropped by 1. (I.e. the count of the 26
dealt cards is -1.)
Since 26 cards have been dealt from the 52, the probability that our card, the
'red' one, came out is 50%.
IF our card did indeed come out, then 25 blue cards also came out and they
have a count of zero. In this case, the true count is -1/5.5. This is clear since our
tracked card is gone, the running count is -1, and 5.5 decks remain.
IF our card did not come out, then 26 blue cards came out with a count of -1. In
this case the count of the remaining blue cards must be +2. In the next 26 cards,
we expect a count drop of -1 from our red card and a rise of 2*25/285 from the
blue cards. So the true in this case is (1-2*25/285)/0.5.
So the a priori probability that 25 of the 26 cards would be blue is 50%. The
probability that they would have a count of zero is given by:
P[0] = sum(binom(120,i)*binom(72,25-2*i)*binom(119,i),i=0..12) /
binom(311,25) = .09402636
The a priori probability that all 26 cards would be blue is also 50%. The
probability that they would have a count of -1 is:
P[-1] = sum(binom(120,i)*binom(72,25-2*i)*binom(119,i+1),i=0..12) /
binom(311,26) = .08957166
From these we can we can construct the conditional probability that the red card
came out given that the present running count is -1. This is:
P[gone] = P[0] / (P[0] + P[-1]) = 51.21317%
So, given that the running count is -1 we can say that it's slightly more probable
that our red card came out. (Great, but the power of shuffle tracking is that we're
not sure. There's still a significant, 49.8%, chance that we still have our card to
look forward to!)
Now we can conclude that the true count at this point is:
t = P[gone] * (-1 / 5.5) + (1 - P[gone]) * ((1-2*25/285)/0.5) = .711440
That wasn't too difficult, but in general there are hundreds of probabilities to
compute to solve such a problem.
Now the NRS Formula would have given us: r = 4.643 and N = 5.554 decks.
Thus we would have calculated:
t = (r*1 - 1) / (N - 0.5) = 3.643 / 5.054 = .7208
Not bad. Of course in a real game if you saw the ace of hearts go into a deck
that you cut to the front, you would hopefully take advantage of the fact that it's
an ace instead of a ten, and also be better able to estimate whether it had come
out! The point here is that even in this very extreme case of only one tracked
card, the diffusion approximation works very well.
Again, please note the power of this stuff. We put ONE card into a single deck,
and until the (naïve) running count gets down to -5 we are still playing at a
positive true count. The converse is also true. If you put one bad card (2-6) into
the deck in the front, you'll have to see five of them come out before you can call
the true count positive!
Return to: Alternative Strategies