# number of Hi-Lo arrangements

Max Alekseyev maxale at gmail.com
Mon Aug 11 12:09:28 CEST 2008

```Somewhat interesting sequence of deck arrangements, jfyi:

%I A143381
%S A143381 0,2,0,6,2,0,14,30,2,0,78,230,174,2,0,230,14094,4834,1092,2,0,1902,187106,3785126,114442,7188,2,0,6902,
%T A143381 26185806,250560122,1225289412,2908990,48852,2,0,76110,557115782,682502468094,423419180642,442227602892,
%U A143381 77538470,339720,2,0,329462,140147007102,94792743206434,23852275126257012,819249107177006,171398421245988
%N A143381 Number of Hi-Lo arrangements HL(m,n) of a deck with n suits
and m ranks in each suit.
%C A143381 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 A143381 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 A143381 Kipli's Cage: <a
href="http://kipliscage.powerblogs.com/posts/1143090752.shtml">Enumerating
HiLo arrangements</a> (the definition there has some glitches - see
correct version in this entry).
%H A143381 Max Alekseyev, <a
href="http://www.cs.ucsd.edu/users/maxal/gpscripts/">PARI scripts for
various problems</a>
%e A143381 The table of values HL(m,n) starts:
%e A143381 0 0 0 0 0 0 0 ...
%e A143381 2 2 2 2 2 2 2 ...
%e A143381 6 30 174 1092 7188 48852 339720 ...
%e A143381 14 230 4834 114442 2908990 77538470 2138286650 ...
%e A143381 78 14094 3785126 1225289412 442227602892 171398421245988
69859403814893544 ...
%e A143381 ...
%Y A143381 Rows: A000004, A007395, A110706. Bisection of the first
column: HL(m,1) = A048163(m+1).
{ 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) ) }
%K A143381 nonn,tabl
%O A143381 1,2
%A A143381 Max Alekseyev (maxal(AT)cs.ucsd.edu), Aug 11 2008

Regards,
Max

```