%I #10 Feb 03 2015 14:20:59
%S 0,2,0,6,2,0,14,30,2,0,78,230,174,2,0,230,14094,4834,1092,2,0,1902,
%T 187106,3785126,114442,7188,2,0,6902,26185806,250560122,1225289412,
%U 2908990,48852,2,0,76110,557115782,682502468094,423419180642
%N Number of Hi-Lo arrangements HL(m,n) of a deck with n suits and m ranks in each suit, m>=1, n>=1.
%C 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.
%C 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).
%H Max Alekseyev, <a href="http://home.gwu.edu/~maxal/gpscripts/">PARI scripts for various problems</a>
%H Kipli's Cage: <a href="https://web.archive.org/web/20070811194657/http://kipliscage.powerblogs.com/posts/1143090752.shtml">Enumerating HiLo arrangements</a> (the definition there has some glitches - see correct version in this entry).
%e The table of values HL(m,n) starts:
%e 0 0 0 0 0 0 0 ...
%e 2 2 2 2 2 2 2 ...
%e 6 30 174 1092 7188 48852 339720 ...
%e 14 230 4834 114442 2908990 77538470 2138286650 ...
%e 78 14094 3785126 1225289412 442227602892 171398421245988 69859403814893544 ...
%e ...
%o (PARI) \r nseqadj.gp
%o { f(m,n,k) = sum(j=0, k, (-1)^j * binomial(k,j) * binomial(k-j,n)^m ) }
%o { 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
%o { 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
%o { HL(m,n) = if(m%2, HL1(m,n), HL0(m,n) ) }
%Y Rows: A000004, A007395, A110706. Bisection of the first column: HL(2m, 1) = A048163(m+1).
%K nonn,tabl
%O 1,2
%A _Max Alekseyev_, Aug 11 2008, Aug 17 2008