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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 Andersen's number of positives of a signed permutation.
For $\pi$ a signed permutation of length $n$, first create the tuple $x = (x_1, \dots, x_n)$, where $x_i = c_{|\pi_1|} \operatorname{sgn}(\pi_{|\pi_1|}) + \cdots + c_{|\pi_i|} \operatorname{sgn}(\pi_{|\pi_i|})$ and $(c_1, \dots ,c_n) = (1, 2, \dots, 2^{n-1})$. The actual value of the c-tuple for Andersen'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} \frac{n!}{2^n}$. This statistic is equidistributed with Sparre Andersen's `Position of Maximum' statistic.
References
[1] Andersen, E. S. On the fluctuations of sums of random variables DOI:10.7146/math.scand.a-10385
[2] Andersen, E. S. On the fluctuations of sums of random variables II DOI:10.7146/math.scand.a-10407
[3] Jacobs, K. Discrete Stochastics DOI:10.1007/978-3-0348-8645-1
[4] Triangle T(m,s), m >= 0, 0 <= s <= m, arising in the computation of certain integrals. OEIS:A059366
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|} sgn(pi_{|pi_1|}) + ... + c_{|pi_i|} sgn(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
Aug 14, 2024 at 10:48 by Arvind Ayyer