```Poker Odds for Arbitrary Decks
------------------------------  ```
```Copyright (c) 2004 by David R. Adaskin

```
```Abstract:
---------
The odds for various types of 5 card poker hands drawn from a standard
4-suit, 13 rank deck of playing cards are well known.  This paper gives
the odds of these hands for a deck of 5 suits, 6 suits, and finally, an
arbitrary number of suits and ranks.

```
```Introduction:
-------------
The object of the game of poker is to obtain the highest value combination
of 5 cards.  The value of the combinations is inversely proportional to
their occurrence.  The valuable combinations consist of n-tuple combinations
of cards of the same rank ("one pair", "two pair", "3 of a kind", "full
house", "4 of a kind"), 5 cards in rank sequence ("straight"), and 5 cards
of the same suit ("flush").  The combination of 5 cards in rank sequence
and of the same suit, called a "straight flush" is particularly valuable.    ```
```When forming a straight, the lowest rank ("A") is allowed to wrap around
and act as if it were higher than the highest rank.  Thus the highest
possible hand from a standard deck would be A-K-Q-J-10 of the same suit.
Some authors describe this as separate category ("royal flush") but for
the purposes of this paper this is considered the highest possible straight
flush.  ```
```Often in regular play some class of cards are designated as "wild cards",
meaning that they can take any rank or suit, at the holder's discretion,
to produce a more valuable hand. For the purposes of this paper the effect
of wild cards will not be considered.
```
`Table 1: Rank of Poker Hands from Standard Deck (4 suits, 13 ranks)  `
```Hand                  Occurrences
----                  ----------
1. Straight Flush            40
2. 4 of a kind              624
3. Full House             3,744
4. Flush                  5,108
5. Straight              10,200
6. 3 of a kind           54,902
7. 2 Pair               123,552
8. 1 Pair             1,098,240
9. Garbage            1,302,540
----------
Total                 2,598,960  ```
```(Source: "The New Complete Hoyle Revised"; Moorehead, Frey, et.al.; Doubleday;
1991)

```
```Using an Non-Standard Deck:
---------------------------
If roughly 2.6 million possible hands does not represent sufficient
diversity, one can multiply the variation by using a deck consisting of 5
suits, each having 13 ranks.  Such a deck is produced and sold by the company
Stardeck Games (http://www.stardeck.com).  The fifth suit is "star".  ```
`Using a deck with 5 or more suits opens up some more interesting combinations:  `
```The most obvious difference is that now a "5 of a kind" hand is now
possible without wild cards (or cheating).  ```
```A more subtle new combination is the "rainbow" variation of existing hands.
In a rainbow hand each card has a different suit.  All of the old combinations
now have rainbow and "hypochromatic" variations.  The exception to this is a
flush which, by definition, has all cards of only one suit.  (By definition,
5 of a kind is a rainbow hand.)  ```
```How do these new combinations rank compared with each other and the
standard combinations?  An exact answer can be determined, but it
involves considerable effort.  ```
```When doing combinatorial analysis the following shorthand is convenient:
The number of combinations (where order doesn't matter) of a objects taken b
at a time is shown as C(a,b).  The number of permutations (where order matters)
of a objects taken b at a time is P(a,b).  Standard combinatorial theory gives
the following expressions:  ```
```                   a!                     a!
C(a.b) = --------       P(a,b) = ------
b!(a-b)!                (a-b)!  ```
```where: n! is "n factorial" = n*(n-1)*(n-2)*...*3*2*1.

```
```Determining the relative ranking of hands with the stardeck involves some
unusual problems.  In particular, we will compute the number of occurrences
of 3 types of hands: rainbow one pair, rainbow (no pair), and hypochromatic
3 of a kind.
```
```(The following analyses are adapted from Evan Whitney's unpublished paper
"Rank of Cards for Stardeck", 2002)  ```
```1. Rainbow One Pair:  This hand consists of exactly one pair of any 2 of
the 5 available suits.  The remaining 3 cards are of the 3 remaining
suits but cannot form a pair or triplet.  ```
`   Number of possible pairs: C(5,2) = 10 for each rank, or 10 x 13 = 130  `
`   12 ways of choosing 3rd card (can't match pair in suit or rank).  `
`   11 ways of choosing 4th card (can't match others in suit or rank).  `
`   10 ways of choosing 5th card (can't match anything in suit or rank).  `
```   130 x 12 x 11 x 10 = 171600 unique hands of this type.
```
```2. Rainbow (No Pair): This hand consists of 5 cards, one of each suit, but
no n-tuples and no straights.  ```
```   13 ways to choose the first card (any rank from one suit).
12 ways to choose 2nd card (any other rank from any other suit).
11 ways to choose 3rd card (any unused rank from any unused suit)
10 ways to choose 4th card (any unused rank from any unused suit)
9 ways to choose final card (any unused rank from last available suit)  ```
`  13 x 12 x 11 x 10 x 9 = 154440    `
`  But this includes Rainbow Straights.    `
```  Number of Rainbow Straights:
Within any rank there can be 10 possible straights (A-2-3-4-5 through
10-J-Q-K-A).  The suits of the cards in each straight can be arranged
in P(5,5) = 5! = 120 ways.  Thus there are 1200 rainbow straights.  ```
```  So we have 154440 - 1200 = 153240 unique rainbow (no pair) hands
```
```3. Hypochromatic 3 of a Kind:  This hand consists of 3 cards of the same
rank and 2 cards of 2 other ranks.  At least 2 of these 5 cards are
of the same suit, since it is not a Rainbow 3 of a kind.  ```
```   For each rank there are P(5,3) ways of arranging the suits of the cards
in the triplet.  P(5,3) = 10   x 13 ranks  = 130.  ```
```   The other two cards are chosen from 60 cards in the deck, 5 suits x 13
ranks - 5 cards of the the triplet's rank.  Thus there is a pool of
C(60,5) = 1770 cards from which to choose the last 2 cards.  But these
2 cards cannot form a pair.  For each of the 12 remaining ranks there
are C(5,2)=10 possible pairs.  Thus there are 1770-12x10 = 1650 ways
to choose the last 2 cards.  ```
```   130 x 1650 = 214500 3 of a kind combinations including Rainbow 3 of a
kind.  ```
```   Number of Rainbow 3 of a kind: For each rank there are C(5,3) = 10
ways of choosing the triplet, or 13 x 10 = 130 ways of choosing the
triplet.  There are 12 ways to choose the 4th card (must be of different
rank and suit than any card in the triplet) and 11 ways to choose the
5th.  Thus, there are 130 x 12 x 11 = 17160 ways of choosing a Rainbow
3 of a kind.  ```
```   So, there are 214500 - 17160 = 19340 unique Hypochromatic 3 of a kind
hands.  ```
```(Note the combinatorial analysis for each type of hand are shown later in
this paper.)  ```
```So, a Rainbow (no pair) (153240) is more valuable than a Rainbow One Pair
(171600) and both are more valuable than a hypochromatic 3 of a kind
(197340).  This contradicts "common sense" which would have the more
Rainbow One Pair be more valuable than the plain Rainbow.  ```
```One way around this conundrum is to look at how a hand would actually
be played.  When determining the value of a hand, a player does not
have to declare the highest possible value, just a value higher than
that of any other players hand. For instance, a player can "degrade" a 4
of a Kind to a 3 of a Kind or a just a pair.  Adding the unique occurances
of any type of hand to the unique occurances of all the more valuable types
that can be degraded to this type produces a total that gives a more
intuitively pleasing ranking.  ```
`(Refer to Table B-1 in Appendix B for Hand Degradation information.)  `
```There are some variations of poker games (e.g. "Lowball") where the players
compete for the *least* valuable combination.  In this situation degrading
of hands would not be allowed and the "unique" rankings should be used.

```
```Table 2:   Unique and Total Occurrances of Hands for Stardeck
(5 suits, 13 ranks)  ```
```Hand                            Unique          Total
------------------------------  -------         ------
1.  5 of a Kind                     13             13
2.  Straight Flush                  50             50
3.  Rainbow 4 of a Kind            780            793
4.  Rainbow Straight             1,200          1,200
5.  Rainbow Full House           1,560          1,573
6.  Hypochromatic 4 of a Kind    3,120          3,913
7.  Flush                        6,385          6,435
8.  Hypochromatic Full House    14,040         15,613
9.  Rainbow 3 of a Kind         17,160         19,513
10. Rainbow 2 Pair              25,740         28,093
11. Hypochromatic Straight      30,000         31,250
12. Rainbow 1 Pair             171,600        216,853 *
13. Hypochromatic 3 of a Kind  197,340        234,013 *
14. Rainbow (Garbage)          153,240        371,293 *
15. Hypochromatic 2 Pair       403,260        448,513
16. Hypochromatic 1 Pair     3,403,400      4,238,013
17. Garbage                  3,831,000      8,259,888  ```
```* These hands would be ranked differently if only unique
occurrances were considered.  ```
```(Source: "Rank of Cards for Stardeck"; Whitney,Evan; 2002 (unpublished))

```
```The Next Step
-------------
Not to be outdone, the Empire Trading Card Company
(http://www.rightfast.com/empire/CAcards.htm), created a 6-suit deck.
Red "Crowns" and black "Anchors" suppliment the 4 suits of a standard deck.
The added suits allow for 21,111,090 possible 5 card hands.  ```
```As with the Stardeck, the Empire Deck allows for a natural 5 of a kind
and "Rainbow" variations of the standard hands.  As might be expected,
the ranked order of hands is slightly different for the Empire Deck than
for the Stardeck.

```
```Table 3:  Unique and Total Occurrances of Hands for Empire Deck
(6 suits, 13 ranks)  ```
```Hand                  			Unique          Total
------------------------------  -------         ------
1.  Straight Flush                   60             60
2.  5 of a Kind                      78             78
3.  Rainbow 4 of a Kind           4,680          4,758
4.  Rainbow Straight              7,200          7,200
5.  Flush                         7,662          7,722
6.  Rainbow Full House            9,360          9,438
7.  Hypochromatic 4 of a Kind     9,360         14,118
8.  Hypochromatic Full House     37,440         46,878
9.  Hypochromatic Straight       70,500         77,760
10. Rainbow 3 of a Kind         102,960        117,078
11. Rainbow 2 Pair              154,440        168,558
12. Hypochromatic 3 of a Kind   514,800        678,678
13. Hypochromatic 2 Pair      1,003,860      1,219,218 *
14. Rainbow 1 Pair            1,029,600      1,301,118 *
15. Rainbow                     919,440      2,227,758 *
16. Hypochromatic 1 Pair      8,236,800     11,103,378
17. Garbage                   9,002,850     21,111,090  ```
```* These hands would be ranked differently if only unique
occurrances were considered.

```
```Using an Arbitrary Deck
------------------------
To carry things to the extreme, how would a person compute the ranking
of hands for a deck with an arbitrary number of suits and ranks?  ```
```Below is a table with the appropriate combinatorial formulas for such
rankings.

```
`Table 4: Unique and Total Occurrances of Hands for an arbitrary deck  `
```         s = number of suits
r = number of ranks  ```
```1.  5 of a Kind:
Unique:  r*C(s,5)  (s >= 5)
Total:   r*C(s,5)  (s >= 5)  ```
```2.  Straight Flush:
Unique:  s(r-3)    (r >= 6)
Total:   s(r-3)    (r >= 6)  ```
```3.  Rainbow 4 of a Kind:
Unique:  5r(r-1)*C(s,5)   (s >= 5)
Total:   r(5r-4)*C(s,5)   (s >= 5)  ```
```4.  Rainbow Straight:
Unique:  (r-3)*P(s,5)     (s >= 5, r >= 6)
Total:   (r-3)*P(s,5)     (s >= 5, r >= 6)  ```
```5.  Rainbow Full House:
Unique:  10r(r-1)*C(s,5)  (s >= 5)
Total:   r(10r-9)*C(s,5)  (s >= 5)  ```
```6.  Hypochromatic 4 of a Kind:
Unique: 4r(r-1)*C(s,4)             (s >= 4)
Total:  (1/5)r(5sr-4s-4)*C(s,4)    (s >= 4)  ```
```7.  Flush:
Unique: s(C(r,5) - (r-3))          (r >= 6)
Total:  s*C(r,5)                   (r >= 6)  ```
```8.  Hypochromatic Full House:
Unique: r(r-1)*C(s,3)*[C(s,2) - C(s-3,2)]                  (s >= 3)
Total:  r*C(s,5)+r(r-1)*C(s,3)*C(s,2)                      (s >= 5)
r(r-1)*C(s,3)*C(s,2)                               (s >= 3)  ```
```9.  Rainbow 3 of a Kind:
Unique: 10*P(r,3)*C(s,5)                    (s >= 5)
Total:  r*C(s,5)[10r^2-15r+6]               (s >= 5)  ```
```10. Rainbow 2 Pair:
Unique: 90*C(r,3)*C(s,5)                    (s >= 5)
Total:  r*C(s,5)[15r^2 -30r+16]             (s >= 5)  ```
```11. Hypochromatic Straight:
Unique: (r-3)*(s^5 - s - P(s,5))     (s >= 5, r >= 6)
(r-3)*(s^5 - s)              (s >= 2, r >= 6)
Total:  (r-3)*(s^5)                  (s >= 2, r >= 6)  ```
```12. Rainbow 1 Pair:
Unique: 2*C(r,4)*P(s,5)                 (s >= 5, r >= 4)
Total:  r*C(s,5)[10r^3-35r^2+50r-24]    (s >= 5, r >= 4)  ```
```13. Hypochromatic 3 of a Kind:
Unique: r*C(s,3)[C(s(r-1),2)-(r-1)C(s,2)]           (s >= 3)
(above)-(Rainbow 3 of a Kind unique)        (s >= 5)
Total:  r*C(s,4)[sr-(4/5)(s+1)+(4/(s-3))*C(s(r-1),2)] (s >= 4)  ```
```14. Rainbow:
Unique: C(s,5)*P(r,5) -(r-3)*P(s,5)    (s >= 5)
Total:  r^5 * C(s,5)                   (s >= 5)  ```
```15. Hypochromatic 2 Pair:
Unique: 3(r-3)*C(s,2)[s*C(s,2) - C(s-2,2)*C(s-4,1)]            (s >= 4)
Total: (1/5)r(5sr-4s-4)*C(s,4)+(1/3)(3sr-4s-4)*C(r,2)*C(s,2)^2 (s >= 4)   ```
```16. Hypochromatic 1 Pair:
Unique: r*C(s,2)[C(s(r-1),3) - (r-1)*C(s,3)-s*P(r-1,2)*C(s,2) (s >= 3)
(above) - (Rainbow 1 Pair unique)                     (s >= 5)
Total:  (1/5)r(5sr-4s-4)*C(s,4)+
(1/3)r(sr-4)*C(s,2)*C((r-1)s,2)-
(1/3)(3sr-4s-4)*C(r,2)*C(s,2)^2                       (s >= 4)  ```
```17. Garbage:
Unique: C(rs,5) - (sum of all other unique hands)   (s >= 3)
Total:  C(rs,5)                                     (s >= 3)

```
```The formulae for the total hands were derived from the sum of the forumulae
for the appropriate unique hands, with a considerable amount of algebraic
manipulation to arrive at the form that was simplest to present.  ```
```The formulae for the unique hands were derived as follows:
(These derivations are generalizations of the derivations for Stardeck in
Evan Whitney's aforementioned paper.)  ```
```1. Five of a Kind:
For each rank choose 5 cards of the available suits. Thus, r*C(s,5).
Since there are no higher ranking hands that can be degraded to this
hand the number of total hands can be computed by the same formula
```
```   This forumula is only valid for values of s >= 5.
```
```2. Straight Flush:
For each suit there are r-3 possible straight sequences including low
card wrap around.  For instance, with a 13 rank deck a 5 card straight
could start with A, 2, 3, 4, 5, 6, 7, 8, 9, or 10.  The straight starting
with 10 would be: 10, J, Q, K, A.  ```
```   Therefore the number of unique straight flushes is: s(r-3).  Since there
are no higher ranking hands that can be degraded to this hand this formula
can also compute the total hands.    ```
`   This formula is only valid for values of r >=6.  `
```
3. Rainbow 4 of a Kind:
For each rank there can be C(s,4) possible quadruple combinations. The
fifth card can be of any other rank and any suit not included in the
quadruple (to be a rainbow) or (r-1)(s-4).  Thus the formula for the
number of unique hands is: r(r-1)(s-4)C(s,4) which is equivalent to
5r(r-1)C(s,5).    ```
```   A five of a kind hand could be degraded to a rainbow 4 of a kind, so the
formula for the total number of hands is the sum of the unique rainbow 4
of a kind and five of a kind or: r(5r-4)C(s,5).
```
```   These formulae are only valid for values of s >= 5.
```
```4. Rainbow Straight:
As with a straight flush there are r-3 possible ranks of straights.  In
this case, each rank of straight can be drawn from 5 out of all the suits
available. This is a rainbow hand, so only each suit can only be selected
once.  The order in which the suits are chosen matters (each is assigned
to a particular rank in the straight) so we use permutations instead of
combinations.  The complete formula is: (r-3)P(s,5).  ```
```   Since there are no higher ranking hands that can be degraded to this one,
the above forumula also computes the total number of hands.  ```
```   These formulae are only valid for values of s >= 5.

```
```5. Rainbow Full House:
There could be r triplets each having C(s,3) arrangements of suits,
leaving (r-1) pairs each having C(s-3,2)arragements of suits.  So the
formula for unique hands is: r(r-1)*C(s,3)*C(s-3,2).  This can be
algebraicly manipulated to 10r(r-1)*C(s,5).  ```
```   The number of total hands is the sum of the unique rainbow full house
hands and the number of 5 of a kind hands.  This works out to:
r(10r-9)*C(s,5)  ```
```   These formulae are only valid for values of s >= 5.
```
```6. Hypchromatic 4 of a Kind:
The quadruple could be formed in C(s,4) ways for each of the r ranks.
The remaining card can be of any of (r-1) ranks and s suits.  Thus:
sr(r-1)*C(s,4) is the number of *all* unique 4 of a kind hands.  To find
the number of unique hypochromatic 4 of a kind hands substract the number
of unique rainbow 4 of a kind hands to get: 4r(r-1)C(s,4).  ```
```   The total number of hands that could be degraded to a hypochromatic
4 of a kind is the sum of the uniques above, plus 5 of a kind, plus
rainbow 4 of a kind.  Algebraic manipulation yields:
(1/5)r(5sr-4s-4)*C(s,4).  ```
```   These formulae are valid for values of s >= 4.
```
```7. Flush:
For each suit there are 5 ranks chosen.  Order doesn't matter, so
the formula for *total* hands is s*C(r,5).  For the number of *unique*
hands subtract off the number of straight flushes: s(C(r,5) - (r-3)).  ```
```   These formulae are valid for values of r >= 6.
```
```8. Hypochromatic Full House:
For the triple: for each rank choose 3 suits.  For the pair: for each of
the remaining (r-1) ranks choose 2 of any suit.  Finally,
subtract off the number of rainbow full house hands, yielding:
r(r-1)*C(s,3)[C(s,2) - C(s-3,2)].  ```
```   For the total number of hands that can be degraded to hypochromatic full
house sum both types of full house hands and 5 of a kind hands for:
r*C(s,5) + r(r-1)*C(s,2)*C(s,3).  If your deck has less than 5 suits
you won't have 5 of a kind hands or any rainbow hands, so the total
hands is the same as the unique hands.  ```
```   These formulae are valid for values of s >= 5.
```
```9. Rainbow 3 of a Kind:
The triple will be 3 cards chosen from all the suits and the remaining
2 cards will be chosen from the remaining s-3 suits.  Three ranks will be
assigned to the triple and each remaining card by choosing 3 from the
r ranks, but order matters, so we have P(r,3)*C(s,3)*C(s-3,2).  This
simplifies to 10*P(r,3)*C(s,5).  ```
```   For the total rainbow 3 of a kind hands, sum up the rainbow 3 of a kind,
rainbow 4 of a kind and 5 of a kind.  After a lot of algebra this yields:
r(10r^2-15r+6)*C(s,5).  ```
```   These formulae are valid for values of s >= 5.
```
```10. Rainbow 2 Pair:
The suits of the first pair is 2 chosen from s suits, the suits of the
second pair is 2 chosen from the s-2 remaining suits.  The ranks are
assigned by choosing 2 from the r ranks.  The final card is chosen from
r-2 ranks and s-4 suits.  This yields: C(s,2)*C(s-2,2)*P(r,2)*(r-2)(s-4)
which simplifies to 90*C(r,3)*C(s,5).  ```
```    The total number of rainbow 2 pair hands is the sum of the unique
rainbow 2 pair, unique rainbow 3 of a kind, unique rainbow full house,
unique rainbow 4 of a kind, and 5 of a kind.  This yields:
r(15r^2-30r+16)*C(s,5).  ```
```    These formulae are valuid for values of s >= 5.
```
```11. Hypochromatic Straight:
There are (r-3) possible ranks of a straight, each of which can be
of any suit.  Thus (r-3)s^5 is the *total* number of hypchromatic
straights. Subtract straight flushes and rainbow flushes to get the
number of *unique* hypochromatic straights: (r-3)(s^5-s-P(s,5)).
For a deck with less than 5 suits, no rainbows are possible so this
formula simplifies to (r-3)(s^5-s).  ```
```    These formulae are valid for values of s >= 2 and values of r >= 6.
```
```12. Rainbow 1 Pair:
For each rank, there are C(s,2) pairs.  The suits of the remaining 3
cards are chosen from the remaining s-2 suits.  The ranks of these
cards are chosen from the remaining r-1 ranks, and order matters.
Thus the number of unique rainbow 1 pair hands is:
r*C(s,2)*C(s-2,3)*P(r-1,3)
which simplifies to:  2*C(r,4)*P(s,5).  ```
```    The total number of hands that could be degraded to a rainbow 1 pair
is the sum of unique rainbow 1 pair hands, 5 of a kind hands, and all
rainbow hands better than 1 pair except rainbow straight.  With some
algebraic manipulation this becomes: r(10r^3-35r^2+50r-24)*C(s,5).  ```
```    These formulae are valid for values of s >= 5 and values of r >= 4.
```
```13. Hypochromatic 3 of a Kind:
For each rank of the triplet choose 3 of the s suits.  The other 2 cards
can be chosen from the set of r*s cards less any of the s cards that are
the same rank as the triplet. The last 2 cards must not be one of the
pairs of r-1 ranks of 2 of the suits.  Expressed mathmatically:
r*C(s,3)*[C(sr-s,2) - (r-1)*C(s,2)].  From this, subtract the number
of rainbow 3 of a kind hands, yielding:
r*C(s,3)*[C(sr-s,2 - (r-1)*C(s,2) - (r-1)(r-2)*C(s-3,2)].  ```
```    The total number of hands that could be degraded to hypochromatic 3 of a
kind is the sum of unique hypochromatic and rainbow 3 of a kind hands,
unique hypochromatic and rainbow 4 of a kind hands, unique hypochromatic
and rainbow full house hands, and 5 of a kind hands, which simplfies to:
r*C(s,4)[sr-(4/5)(s+1)+(4/(s-3))*C(s(r-1),2)]  ```
```    These formulae are valid for values of s >=4.
```
```14. Rainbow:
Choose 5 of the s suits.  For each of these combinations the ranks can be
assigned by choosing 5, but order matters.  So C(s,5)*P(r,5) gives us all
the possible hands with 5 different suits.  Subtract the number of rainbow
straights to get the unique rainbow hands: C(s,5)*P(r,5)-(r-3)*P(s,5).  ```
```    The total number of hands that can be degraded to a rainbow is the sum
of all the rainbow hands including 5 of a kind: C(s,5)*r^5.  ```
```    These formulae are valid for values of s >= 5 and values of r >= 5
```
```15. Hypochromatic 2 Pair:
The suits for both pairs are 2 chosen from s suits.  The ranks are 2 chosen
from all r ranks. The remaining card could be of any of the s suits and the
remaining r-2 ranks.  So: s(r-2)*C(r,2)*C(s,2)*C(s,2) gives the number of
hypochromatic and rainbow 2 pair hands.  Subtracting the rainbows gives:
(r-2)*C(r,2)*C(s,2)*[s*C(s,2) - 3* C(s-2,3)]  ```
```    The total number of hands that can be degraded to a hypochromatic 2 pair
hands is the sum of hypochromatic/rainbow 2 pair, hypochromatic/rainbow
full house, hypochromatic/rainbow 4 of a kind, and 5 of a kind.  This
"simplifies" to:
(1/5)r(5sr-4s-4)*C(s,4)+(1/3)(3sr-4s-4)*C(r,2)*C(s,2)^2  ```
```    These formulae are valid for values of s >= 4.
```
```16. Hypochromatic 1 Pair:
For each of the r ranks there are 2 suits chosen from all s suits, giving
r*C(s,2).  The remaining 3 cards can be chosen from any of the suits of
the remaining r-1 ranks, exluding any triplets or pairs.  Triplets on
s suits and r-1 ranks is (r-1)*C(s,3).  Pairs and one extra card on
s suits and r-1 ranks is (r-1)*C(s,2)*(r-2)*C(s,1) or s(r-1)(r-2)*C(s,2).
Putting it all together we get:
r*C(s,2)*[C(rs-s,3)-(r-1)*C(s,3)-s(r-1)(r-2)*C(s,2)] -
the number of unique rainbow 1 pair hands derived in item 12 above  ```
```    The total number of hands that can be degraded to hypochromatic 1 pair
is the sum of all the unique hands except the hypochromatic/rainbow
straight, the flush, and the rainbow.  This "simplifies" to:
(1/5)r(5sr-4s-4)*C(s,4) +
(1/3)r(sr-4)*C(s,2)*C(rs-s,2) -
(1/3)(3sr-4s-4)*C(s,2)^2.  ```
```    These forumulae are valid for values of s >= 4.
```
```17. Garbage:
This is just the total number of hands less the number of hands
defined above.  ```
```    The total number of hands that can be degraded to garbage is, obviously
all possible hands.

```
```Appendix A: How These Results were Verified
-------------------------------------------
As I began to derive these formulae I discovered the need to have some
method of verifying the results.  Enumerating each situation by hand was
clearly not practical given the large number of combinations so I wrote
a computer program to do it.  ```
```The program PokerOdds.exe allows the user to select the number of suits and
number of ranks of an arbitrary deck, generates each possible hand, evaluates
which of the above categories the hand would fall into, and keeps a running
total of each category.  Finally a list sorted by the total number of hands
is displayed.  ```
```This program was written in Visual C++ 6.0 using MFC 4.0.

```
```Appendix B: Miscellaneous Results
---------------------------------
```
`Table B-1:  Hand Degradation  `
```Declared Hand               Could also have been
-------------               --------------------
Rainbow 4 of a Kind         5 of a Kind  ```
`Rainbow Full House          5 of a Kind  `
```Hypochromatic 4 of a Kind   Rainbow 4 of a Kind,
5 of a Kind  ```
`Flush                       Straight Flush  `
```Hypochromatic Full House    Rainbow Full House,
5 of a Kind  ```
```Rainbow 3 of a Kind         Rainbow Full House,
Rainbow 4 of a Kind,
5 of a Kind  ```
```Rainbow 2 Pair              Rainbow Full House,
Rainbow 4 of a Kind,
5 of a Kind  ```
```Hypochromatic Straight      Rainbow Straight,
Straight Flush  ```
```Rainbow 1 Pair              Rainbow 2 pair,
Rainbow 3 of a Kind,
Rainbow Full House,
Rainbow 4 of a Kind,
5 of a Kind  ```
```Hypochromatic 3 of a Kind   Hypochromatic Full House,
Hypochromatic 4 of a Kind,
Rainbow 3 of a Kind,
Rainbow 4 of a Kind,
Rainbow Full House,
5 of a Kind  ```
```Rainbow                     Rainbow 2 pair,
Rainbow 3 of a Kind,
Rainbow Full House,
Rainbow 4 of a Kind,
Rainbow Straight
5 of a Kind  ```
```Hypochromatic 2 Pair        Rainbow 2 pair,
Rainbow Full House,
Rainbow 4 of a Kind,
Hypochromatic Full House,
Hypochromatic 4 of a Kind,
5 of a Kind  ```
```Hypochromatic 1 Pair        Rainbow 1 pair,
Rainbow 2 pair,
Rainbow 3 of a Kind,
Rainbow Full House,
Rainbow 4 of a Kind,
Hypochromatic 2 pair,
Hypochromatic 3 of a Kind,
Hypochromatic Full House,
Hypochromatic 4 of a Kind,
5 of a Kind  ```
```Garbage                     Anything

```