OFFSET
1,2
COMMENTS
In High-Low card game, a card is turned over (from the top of a regular shuffled 52-card deck) and the player is asked to guess if the next card will be higher or lower than the one shown. A simple strategy to play the game would be to guess 'High' if the card is an Ace through 6 (consider Ace to be of rank 1), 'Low' if the card is 8 through 13 (King) and flip a coin if the card is a 7. Intuitively, the player is playing the best he can without memory. If we make the assumption that the player always gets the random coin flips correct, then the probability that he will get every turn correct through the entire deck equals HL(13,4)*4!^13/52! (~= 1.7*10^(-7)) where HL(m,n) is defined below.
Given a deck with n suits each ranked from 1 to m (for a total of mn cards in the deck), a Hi-Lo arrangement of the cards is an arrangement of ranks r(1),r(2),...,r(mn) that satisfies the following three properties: (i) if r(i) < (m+1)/2 then r(i+1) > r(i); (ii) if r(i) > (m+1)/2 then r(i+1) < r(i); and (iii) if r(i) = (m+1)/2 then r(i+1) is different from r(i). The number of Hi-Lo arrangements of a deck with m ranks and n suits is denoted HL(m,n).
LINKS
Max Alekseyev, PARI scripts for various problems
Kipli's Cage: Enumerating HiLo arrangements (the definition there has some glitches - see correct version in this entry).
EXAMPLE
The table of values HL(m,n) starts:
0 0 0 0 0 0 0 ...
2 2 2 2 2 2 2 ...
6 30 174 1092 7188 48852 339720 ...
14 230 4834 114442 2908990 77538470 2138286650 ...
78 14094 3785126 1225289412 442227602892 171398421245988 69859403814893544 ...
...
PROG
(PARI) \r nseqadj.gp
{ f(m, n, k) = sum(j=0, k, (-1)^j * binomial(k, j) * binomial(k-j, n)^m ) }
{ HL0(m, n) = 2 * sum(k=n, (m/2)*n, f(m/2, n, k) * (f(m/2, n, k) + f(m/2, n, k+1)) ) } \\ for even m
{ HL1(m, n) = sum(i=n, (m\2)*n, f(m\2, n, i) * sum(j=n, (m\2)*n, f(m\2, n, j) * M([n, i, j]) )) } \\ for odd m
{ HL(m, n) = if(m%2, HL1(m, n), HL0(m, n) ) }
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Max Alekseyev, Aug 11 2008, Aug 17 2008
STATUS
approved