Principles of Computer Cribbage

Principles   of   Computer   Cribbage

Expectation
Optimization The principles optimization, maximization, and minimization are dependent on the principle of expectation.
Maximization
Minimization
Acquisition Acquisition and prevention are special cases of maximization and minimization as it relates to a single card in pegging.
Prevention
Latency Latency and potency are special cases of and maximization and minimization as it relates to the entire hand for pegging purposes when discarding.
Potency
Exclusion
Inference The principles of scope and inference are special cases of exclusion.
Scope
Restriction
Game Theory


Expectation is THE FUNDAMENTAL principle used by HALSCRIB in making discard and pegging decisions.

Any single decision based on expectation is subject to chance, but in the long run its effects are eliminated.

A game of Roulette commonly has 38 numbers, 00, 0, 1 to 36.   The payback is 2 on a bet of 1 on an EVEN, ODD, BLACK, or RED bet.   The numbers 00 and 0 are not EVEN, ODD, RED nor BLACK so there is a slightly less than 1 in 2 chance of winning on any particular spin of the wheel.   These numbers provide the house edge.

The expected value or simply expectation of a bet can be expressed as follows:

   Expected Value = payoff * probability of payoff 

If $100 is bet on any ODD number, then the expected value (short-cut method) is 100 * (18 / 38) = $94 (actually it is $94.7368421 ... so if you are playing Roulette and there are 38 numbers, bet in units of 38).

The expectation (general method) is calculated by taking each possible outcome, accumulating the outcome value (frequency * payback), then dividing by the total number of outcomes, 38 in all, as follows:


        Value Outcome Frequency Payback
           0      00      1         0
           0       0      1         0
           2       1      1         2
          ...
           0      12      1         0
           2      13      1         2
           0      14      1         0
          ...       
           0      36      1         0         
=======================================
Totals  3600             38

Expected Value = Total Value / Total Frequency = 3600 / 38 = 94.7368421
If you started with $40000 and bet $100 each time, it would take you about 1680 bets - "the long run" - to lose your entire stake.

A cribbage discarding example: the expected value (points) of a hand, A, A, 5, 9 (discard 2, 7) can be calculated as follows:


        Value Starter Frequency  Points
          24       A      2        12
          18       2      3         6
          24       3      4         6
          32       4      4         8
          36       5      3        12 
          32       6      4         8  
          18       7      3         6 
          32       8      4         8 
          36       9      3        12
          32      10      4         8
          32       J      4         8
          32       Q      4         8
          32       K      4         8
=======================================
Totals   380              46              

Expected Value = Total Value / Total Frequency = 380 / 46 = 8.2608695
If you had this hand 1000 times, you could expect a total of about 8261 points.

The expected value (points) can be calculated for the crib also.   It requires considerable more calculation than a person can manage, but is easily done by a computer.   A person can memorize a table of "discard pair" expected values, 91 in all, or estimate the value of a 3-card crib by taking each possible starter into account.   When discarding as Dealer the expected crib value is positive and as Pone negative.

The expected value (points) for pegging is used by HALSCRIB.   When discarding, a look-up table of expected values is used to approximate it.   The scope used to obtain these values was 100%.   In the play, the expected value is computed using a granularity that is dependent on the number of opponent cards seen.   Initially it is 15% (until 4th street where it is optional) and increases to 100% after opponent's 2nd card has been played.

HALSCRIB adds the expected values of hand, crib, and pegging into a combined expected value for discarding.

Board position determines which principle, optimization, minimization, or maximization is to be used for the combined expected value.


Optimization occurs in pegging when a player plays a card with the purpose of maximizing the difference between the player's expected value of pegging points and the opponent's value.   This commonly occurs when there is a choice of plays that score no points or plays that do score points.

In discarding, the difference between the player's and opponent's expected pegging values is added to the combined expected value.


Maximization occurs in pegging when a player plays a card with the purpose of maximizing the expected value of the turn.   This commonly occurs when scoring 15-2, a pair, a run, or 31-2. Optimization is used to break any ties.

In discarding, the player's expected pegging value is added to the combined expected value.


Minimization occurs in pegging when a player plays a card with the purpose of minimizing the expected value of the opponent's reply.   This commonly occurs when leading from a pair. Optimization is used to break any ties.

In discarding, the opponent's expected pegging value is subtracted from the combined expected value.


Acquisition commonly occurs when a player plays a card which may be scoreable.   If scored, then the player's reply also scores.

For example, after leading 8 from 8 9 10 J, dealer plays a 7.   Pone's acquisition play would be the 9, even though this may lead to opponent's 30-4, followed possibly by 31-2.


Prevention commonly occurs when Pone plays a card which can not be paired.   This prevents a run-trap when Pone's second card is close to a high Dealer's first card.

For example, Pone leads the 8 from 8 9 10 J, Dealer plays a Q.   Pone's prevention play would be the J.   By way of contrast, Pone's acquisition play would be the 9, hope for a Go then pair Dealer's possible lead of a 10 or J in the next series.


Latency is a measure of how well a hand can minimize opponent's pegging.

Potency is a measure of how well a hand can maximize one's own pegging.

In end games including skunk potential and avoidance, pegging latency and or potency may be the only criteria used in selecting discards.


Exclusion commonly occurs in pegging.   Dealer can have up to 1820 different hands that Pone could use in deciding what to lead.   Scope reduces this to a more manageable 60 - 250.

Impossible hands are automatically excluded, for example opponent can not have 4 5 5 6 if you hold J 5 5 5.   A Go makes some hands impossible.

In end-game pegging when three of Pone's cards have been played Dealer must choose from two (or more cards) each of which may be scoreable.   Dealer can exclude Pone's winning hands.

Normally if opponent passes up risk-free points, a hand with that card can be excluded. This is exclusion by inference.


Restriction occurs when an opponent must play a card under possibly unfavorable conditions.   This occurs quite often when the count exceeds 21 where only one card is playable.   It also includes those situations when opponent has no playable cards.

Restriction is the basis for most pegging traps.


Scope is the percentage of included (probable) hands from all possible hands that HALSCRIB uses in calculations of expected pegging values.

The number of possible hands (ignoring suit) that opponent may have is at most 1820 (no opponent cards seen), 455 (one card seen), 91 (two cards seen), and 13 (three cards seen).

On lead HALSCRIB uses a scope of approximately 15%.   These probable Dealer hands occur approximately 25% of the time.

Late in pegging other hands can be excluded, for example if opponent's 3 cards seem to be part of a likely flush, then the scope of flush cards may be reduced from a maximum of 13 to an absolute minimum of 6, depending on other cards of the same suit still available.


Game Theory may be used to make decisions when opponent's play is predictable.   For example, if opponent as Pone always leads from a pair, then Dealer should wait and pair the second play of Pone's lead.   Similarly, if Dealer never pairs Pone's opening lead, Pone could safely lead from a non-pair knowing it would not be paired, play the pair later and possibly trap Dealer in restriction.

Game Theory suggests that when Pone uses minimization and Dealer maximization, Dealer should pair 66% of the time.   Pone should lead from a pair 60% of the time.


Email me if you have any comments or questions.