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[-4,3,-1,-2]=>0 [-4,-3,1,2]=>4 [-4,-3,1,-2]=>0 [-4,-3,-1,2]=>4 [-4,-3,-1,-2]=>0 [4,3,2,1]=>4 [4,3,2,-1]=>0 [4,3,-2,1]=>4 [4,3,-2,-1]=>0 [4,-3,2,1]=>4 [4,-3,2,-1]=>0 [4,-3,-2,1]=>4 [4,-3,-2,-1]=>0 [-4,3,2,1]=>4 [-4,3,2,-1]=>0 [-4,3,-2,1]=>4 [-4,3,-2,-1]=>0 [-4,-3,2,1]=>4 [-4,-3,2,-1]=>0 [-4,-3,-2,1]=>4 [-4,-3,-2,-1]=>0
search for individual values
searching the database for the individual values of this statistic
/ search for generating function
searching the database for statistics with the same generating function
click to show known generating functions       
Description
Sparre Anderson's `Number of Positives' statistic.
For $\pi$ a signed permutation of length $n$, first create the tuple $x = (x_1, \dots, x_n)$, where $x_i = c_{|\pi_1|} \pi_{|\pi_1|} + \cdots + c_{|\pi_i|} \pi_{|\pi_i|}$ and $(c_1, \dots ,c_n) = (1, 2, \dots, 2^{n-1})$. The actual value of the c-tuple for Sparre Anderson's statistic does not matter so long as no sums or differences of any subset of the $c_i$'s is zero. The choice of powers of $2$ is just a convenient choice.
This returns the number of strictly positive values in the $x$-tuple. This is related to the discrete arcsin distribution. The number of signed permutations with value equal to $k$ is given by $\binom{2k}{k} \binom{2n-2k}{n-k}$. This statistic is equidistributed with Sparre Anderson's `Position of Maximum' statistic.
References
[1] Jacobs, K. Discrete Stochastics DOI:10.1007/978-3-0348-8645-1
[2] oeis:A059366
WARNING - could not verify link <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)>
error fetching oeis.org/search?q=A059366&n=1&fmt=text [3] WARNING - could not verify link <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)>
[4] error fetching https://oeis.org/search?q=A059366&n=1&fmt=text
Code
def CumulativeSums(pi):
    r"""
    For pi a signed permutation of length n, returns 
    the tuple (x_1, ..., x_n),
    where x_i = c_{|pi_1|} pi_{|pi_1|} + ... + c_{|pi_i|} pi_{|pi_i|} and 
    (c_1, ... ,c_n) = (1, 2, ..., 2^{n-1}).

    The actual value of the c-tuple for these statistics 
    does not matter so long as no sums or differences 
    of any subset of the c_i's is zero.
    """
    n = len(pi)
    c = [2**i for i in range(n)]
    return [sum(c[abs(pi[i]) - 1]*sgn(pi[abs(pi[i]) - 1]) for i in range(j)) for j in range(n+1)]

    
def statistic(pi):
    r"""
    For pi a signed permutation of length n, returns the number
    of strictly positive terms in CumulativeSums(pi)
    """
    
    cumul = CumulativeSums(pi)
    return sum(1 for i in range(len(pi)+1) if cumul[i] > 0)
Created
Sep 12, 2023 at 11:02 by Arvind Ayyer
Updated
Sep 12, 2023 at 11:02 by Arvind Ayyer