Identifier
Identifier
Values
[1,0] generating graphics... => 1
[1,0,1,0] generating graphics... => 1
[1,1,0,0] generating graphics... => 2
[1,0,1,0,1,0] generating graphics... => 1
[1,0,1,1,0,0] generating graphics... => 2
[1,1,0,0,1,0] generating graphics... => 2
[1,1,0,1,0,0] generating graphics... => 1
[1,1,1,0,0,0] generating graphics... => 3
[1,0,1,0,1,0,1,0] generating graphics... => 1
[1,0,1,0,1,1,0,0] generating graphics... => 2
[1,0,1,1,0,0,1,0] generating graphics... => 2
[1,0,1,1,0,1,0,0] generating graphics... => 1
[1,0,1,1,1,0,0,0] generating graphics... => 3
[1,1,0,0,1,0,1,0] generating graphics... => 2
[1,1,0,0,1,1,0,0] generating graphics... => 2
[1,1,0,1,0,0,1,0] generating graphics... => 1
[1,1,0,1,0,1,0,0] generating graphics... => 1
[1,1,0,1,1,0,0,0] generating graphics... => 2
[1,1,1,0,0,0,1,0] generating graphics... => 3
[1,1,1,0,0,1,0,0] generating graphics... => 2
[1,1,1,0,1,0,0,0] generating graphics... => 1
[1,1,1,1,0,0,0,0] generating graphics... => 4
[1,0,1,0,1,0,1,0,1,0] generating graphics... => 1
[1,0,1,0,1,0,1,1,0,0] generating graphics... => 2
[1,0,1,0,1,1,0,0,1,0] generating graphics... => 2
[1,0,1,0,1,1,0,1,0,0] generating graphics... => 1
[1,0,1,0,1,1,1,0,0,0] generating graphics... => 3
[1,0,1,1,0,0,1,0,1,0] generating graphics... => 2
[1,0,1,1,0,0,1,1,0,0] generating graphics... => 2
[1,0,1,1,0,1,0,0,1,0] generating graphics... => 1
[1,0,1,1,0,1,0,1,0,0] generating graphics... => 1
[1,0,1,1,0,1,1,0,0,0] generating graphics... => 2
[1,0,1,1,1,0,0,0,1,0] generating graphics... => 3
[1,0,1,1,1,0,0,1,0,0] generating graphics... => 2
[1,0,1,1,1,0,1,0,0,0] generating graphics... => 1
[1,0,1,1,1,1,0,0,0,0] generating graphics... => 4
[1,1,0,0,1,0,1,0,1,0] generating graphics... => 2
[1,1,0,0,1,0,1,1,0,0] generating graphics... => 3
[1,1,0,0,1,1,0,0,1,0] generating graphics... => 2
[1,1,0,0,1,1,0,1,0,0] generating graphics... => 1
[1,1,0,0,1,1,1,0,0,0] generating graphics... => 3
[1,1,0,1,0,0,1,0,1,0] generating graphics... => 1
[1,1,0,1,0,0,1,1,0,0] generating graphics... => 1
[1,1,0,1,0,1,0,0,1,0] generating graphics... => 1
[1,1,0,1,0,1,0,1,0,0] generating graphics... => 1
[1,1,0,1,0,1,1,0,0,0] generating graphics... => 2
[1,1,0,1,1,0,0,0,1,0] generating graphics... => 2
[1,1,0,1,1,0,0,1,0,0] generating graphics... => 2
[1,1,0,1,1,0,1,0,0,0] generating graphics... => 1
[1,1,0,1,1,1,0,0,0,0] generating graphics... => 3
[1,1,1,0,0,0,1,0,1,0] generating graphics... => 3
[1,1,1,0,0,0,1,1,0,0] generating graphics... => 3
[1,1,1,0,0,1,0,0,1,0] generating graphics... => 2
[1,1,1,0,0,1,0,1,0,0] generating graphics... => 2
[1,1,1,0,0,1,1,0,0,0] generating graphics... => 2
[1,1,1,0,1,0,0,0,1,0] generating graphics... => 1
[1,1,1,0,1,0,0,1,0,0] generating graphics... => 1
[1,1,1,0,1,0,1,0,0,0] generating graphics... => 1
[1,1,1,0,1,1,0,0,0,0] generating graphics... => 2
[1,1,1,1,0,0,0,0,1,0] generating graphics... => 4
[1,1,1,1,0,0,0,1,0,0] generating graphics... => 3
[1,1,1,1,0,0,1,0,0,0] generating graphics... => 2
[1,1,1,1,0,1,0,0,0,0] generating graphics... => 1
[1,1,1,1,1,0,0,0,0,0] generating graphics... => 5
[1,0,1,0,1,0,1,0,1,0,1,0] generating graphics... => 1
[1,0,1,0,1,0,1,0,1,1,0,0] generating graphics... => 2
[1,0,1,0,1,0,1,1,0,0,1,0] generating graphics... => 2
[1,0,1,0,1,0,1,1,0,1,0,0] generating graphics... => 1
[1,0,1,0,1,0,1,1,1,0,0,0] generating graphics... => 3
[1,0,1,0,1,1,0,0,1,0,1,0] generating graphics... => 2
[1,0,1,0,1,1,0,0,1,1,0,0] generating graphics... => 2
[1,0,1,0,1,1,0,1,0,0,1,0] generating graphics... => 1
[1,0,1,0,1,1,0,1,0,1,0,0] generating graphics... => 1
[1,0,1,0,1,1,0,1,1,0,0,0] generating graphics... => 2
[1,0,1,0,1,1,1,0,0,0,1,0] generating graphics... => 3
[1,0,1,0,1,1,1,0,0,1,0,0] generating graphics... => 2
[1,0,1,0,1,1,1,0,1,0,0,0] generating graphics... => 1
[1,0,1,0,1,1,1,1,0,0,0,0] generating graphics... => 4
[1,0,1,1,0,0,1,0,1,0,1,0] generating graphics... => 2
[1,0,1,1,0,0,1,0,1,1,0,0] generating graphics... => 3
[1,0,1,1,0,0,1,1,0,0,1,0] generating graphics... => 2
[1,0,1,1,0,0,1,1,0,1,0,0] generating graphics... => 1
[1,0,1,1,0,0,1,1,1,0,0,0] generating graphics... => 3
[1,0,1,1,0,1,0,0,1,0,1,0] generating graphics... => 1
[1,0,1,1,0,1,0,0,1,1,0,0] generating graphics... => 1
[1,0,1,1,0,1,0,1,0,0,1,0] generating graphics... => 1
[1,0,1,1,0,1,0,1,0,1,0,0] generating graphics... => 1
[1,0,1,1,0,1,0,1,1,0,0,0] generating graphics... => 2
[1,0,1,1,0,1,1,0,0,0,1,0] generating graphics... => 2
[1,0,1,1,0,1,1,0,0,1,0,0] generating graphics... => 2
[1,0,1,1,0,1,1,0,1,0,0,0] generating graphics... => 1
[1,0,1,1,0,1,1,1,0,0,0,0] generating graphics... => 3
[1,0,1,1,1,0,0,0,1,0,1,0] generating graphics... => 3
[1,0,1,1,1,0,0,0,1,1,0,0] generating graphics... => 3
[1,0,1,1,1,0,0,1,0,0,1,0] generating graphics... => 2
[1,0,1,1,1,0,0,1,0,1,0,0] generating graphics... => 2
[1,0,1,1,1,0,0,1,1,0,0,0] generating graphics... => 2
[1,0,1,1,1,0,1,0,0,0,1,0] generating graphics... => 1
[1,0,1,1,1,0,1,0,0,1,0,0] generating graphics... => 1
[1,0,1,1,1,0,1,0,1,0,0,0] generating graphics... => 1
[1,0,1,1,1,0,1,1,0,0,0,0] generating graphics... => 2
[1,0,1,1,1,1,0,0,0,0,1,0] generating graphics... => 4
[1,0,1,1,1,1,0,0,0,1,0,0] generating graphics... => 3
[1,0,1,1,1,1,0,0,1,0,0,0] generating graphics... => 2
[1,0,1,1,1,1,0,1,0,0,0,0] generating graphics... => 1
[1,0,1,1,1,1,1,0,0,0,0,0] generating graphics... => 5
[1,1,0,0,1,0,1,0,1,0,1,0] generating graphics... => 2
[1,1,0,0,1,0,1,0,1,1,0,0] generating graphics... => 3
[1,1,0,0,1,0,1,1,0,0,1,0] generating graphics... => 3
[1,1,0,0,1,0,1,1,0,1,0,0] generating graphics... => 2
[1,1,0,0,1,0,1,1,1,0,0,0] generating graphics... => 4
[1,1,0,0,1,1,0,0,1,0,1,0] generating graphics... => 2
[1,1,0,0,1,1,0,0,1,1,0,0] generating graphics... => 2
[1,1,0,0,1,1,0,1,0,0,1,0] generating graphics... => 1
[1,1,0,0,1,1,0,1,0,1,0,0] generating graphics... => 1
[1,1,0,0,1,1,0,1,1,0,0,0] generating graphics... => 2
[1,1,0,0,1,1,1,0,0,0,1,0] generating graphics... => 3
[1,1,0,0,1,1,1,0,0,1,0,0] generating graphics... => 2
[1,1,0,0,1,1,1,0,1,0,0,0] generating graphics... => 1
[1,1,0,0,1,1,1,1,0,0,0,0] generating graphics... => 4
[1,1,0,1,0,0,1,0,1,0,1,0] generating graphics... => 1
[1,1,0,1,0,0,1,0,1,1,0,0] generating graphics... => 2
[1,1,0,1,0,0,1,1,0,0,1,0] generating graphics... => 1
[1,1,0,1,0,0,1,1,0,1,0,0] generating graphics... => 0
[1,1,0,1,0,0,1,1,1,0,0,0] generating graphics... => 2
[1,1,0,1,0,1,0,0,1,0,1,0] generating graphics... => 1
[1,1,0,1,0,1,0,0,1,1,0,0] generating graphics... => 1
[1,1,0,1,0,1,0,1,0,0,1,0] generating graphics... => 1
[1,1,0,1,0,1,0,1,0,1,0,0] generating graphics... => 1
[1,1,0,1,0,1,0,1,1,0,0,0] generating graphics... => 2
[1,1,0,1,0,1,1,0,0,0,1,0] generating graphics... => 2
[1,1,0,1,0,1,1,0,0,1,0,0] generating graphics... => 2
[1,1,0,1,0,1,1,0,1,0,0,0] generating graphics... => 1
[1,1,0,1,0,1,1,1,0,0,0,0] generating graphics... => 3
[1,1,0,1,1,0,0,0,1,0,1,0] generating graphics... => 2
[1,1,0,1,1,0,0,0,1,1,0,0] generating graphics... => 2
[1,1,0,1,1,0,0,1,0,0,1,0] generating graphics... => 2
[1,1,0,1,1,0,0,1,0,1,0,0] generating graphics... => 2
[1,1,0,1,1,0,0,1,1,0,0,0] generating graphics... => 2
[1,1,0,1,1,0,1,0,0,0,1,0] generating graphics... => 1
[1,1,0,1,1,0,1,0,0,1,0,0] generating graphics... => 1
[1,1,0,1,1,0,1,0,1,0,0,0] generating graphics... => 1
[1,1,0,1,1,0,1,1,0,0,0,0] generating graphics... => 2
[1,1,0,1,1,1,0,0,0,0,1,0] generating graphics... => 3
[1,1,0,1,1,1,0,0,0,1,0,0] generating graphics... => 3
[1,1,0,1,1,1,0,0,1,0,0,0] generating graphics... => 2
[1,1,0,1,1,1,0,1,0,0,0,0] generating graphics... => 1
[1,1,0,1,1,1,1,0,0,0,0,0] generating graphics... => 4
[1,1,1,0,0,0,1,0,1,0,1,0] generating graphics... => 3
[1,1,1,0,0,0,1,0,1,1,0,0] generating graphics... => 4
[1,1,1,0,0,0,1,1,0,0,1,0] generating graphics... => 3
[1,1,1,0,0,0,1,1,0,1,0,0] generating graphics... => 2
[1,1,1,0,0,0,1,1,1,0,0,0] generating graphics... => 3
[1,1,1,0,0,1,0,0,1,0,1,0] generating graphics... => 2
[1,1,1,0,0,1,0,0,1,1,0,0] generating graphics... => 2
[1,1,1,0,0,1,0,1,0,0,1,0] generating graphics... => 2
[1,1,1,0,0,1,0,1,0,1,0,0] generating graphics... => 2
[1,1,1,0,0,1,0,1,1,0,0,0] generating graphics... => 3
[1,1,1,0,0,1,1,0,0,0,1,0] generating graphics... => 2
[1,1,1,0,0,1,1,0,0,1,0,0] generating graphics... => 2
[1,1,1,0,0,1,1,0,1,0,0,0] generating graphics... => 1
[1,1,1,0,0,1,1,1,0,0,0,0] generating graphics... => 3
[1,1,1,0,1,0,0,0,1,0,1,0] generating graphics... => 1
[1,1,1,0,1,0,0,0,1,1,0,0] generating graphics... => 1
[1,1,1,0,1,0,0,1,0,0,1,0] generating graphics... => 1
[1,1,1,0,1,0,0,1,0,1,0,0] generating graphics... => 1
[1,1,1,0,1,0,0,1,1,0,0,0] generating graphics... => 1
[1,1,1,0,1,0,1,0,0,0,1,0] generating graphics... => 1
[1,1,1,0,1,0,1,0,0,1,0,0] generating graphics... => 1
[1,1,1,0,1,0,1,0,1,0,0,0] generating graphics... => 1
[1,1,1,0,1,0,1,1,0,0,0,0] generating graphics... => 2
[1,1,1,0,1,1,0,0,0,0,1,0] generating graphics... => 2
[1,1,1,0,1,1,0,0,0,1,0,0] generating graphics... => 2
[1,1,1,0,1,1,0,0,1,0,0,0] generating graphics... => 2
[1,1,1,0,1,1,0,1,0,0,0,0] generating graphics... => 1
[1,1,1,0,1,1,1,0,0,0,0,0] generating graphics... => 3
[1,1,1,1,0,0,0,0,1,0,1,0] generating graphics... => 4
[1,1,1,1,0,0,0,0,1,1,0,0] generating graphics... => 4
[1,1,1,1,0,0,0,1,0,0,1,0] generating graphics... => 3
[1,1,1,1,0,0,0,1,0,1,0,0] generating graphics... => 3
[1,1,1,1,0,0,0,1,1,0,0,0] generating graphics... => 3
[1,1,1,1,0,0,1,0,0,0,1,0] generating graphics... => 2
[1,1,1,1,0,0,1,0,0,1,0,0] generating graphics... => 2
[1,1,1,1,0,0,1,0,1,0,0,0] generating graphics... => 2
[1,1,1,1,0,0,1,1,0,0,0,0] generating graphics... => 2
[1,1,1,1,0,1,0,0,0,0,1,0] generating graphics... => 1
[1,1,1,1,0,1,0,0,0,1,0,0] generating graphics... => 1
[1,1,1,1,0,1,0,0,1,0,0,0] generating graphics... => 1
[1,1,1,1,0,1,0,1,0,0,0,0] generating graphics... => 1
[1,1,1,1,0,1,1,0,0,0,0,0] generating graphics... => 2
[1,1,1,1,1,0,0,0,0,0,1,0] generating graphics... => 5
[1,1,1,1,1,0,0,0,0,1,0,0] generating graphics... => 4
[1,1,1,1,1,0,0,0,1,0,0,0] generating graphics... => 3
[1,1,1,1,1,0,0,1,0,0,0,0] generating graphics... => 2
[1,1,1,1,1,0,1,0,0,0,0,0] generating graphics... => 1
[1,1,1,1,1,1,0,0,0,0,0,0] generating graphics... => 6
click to show generating function       
Description
The difference of lower and upper interactions.
An upper interaction in a Dyck path is the occurrence of a factor $0^k 1^k$ with $k \geq 1$ (see St000331The number of upper interactions of a Dyck path.), and a lower interaction is the occurrence of a factor $1^k 0^k$ with $k \geq 1$. In both cases, $1$ denotes an up-step $0$ denotes a a down-step.
Code
def upper_interactions(x):
    interactions = 0
    i = 0
    count = 0
    while i < len(x):
        if x[i] == 0:
            if x[i-1] == 1:
                count = 0
            count = count + 1
        if x[i] == 1 and count > 0:
            interactions = interactions + 1
            count = count - 1
        i  = i + 1
    return interactions

def lower_interactions(x):
    interactions = 0
    i = 0
    count = 0
    while i < len(x):
        if x[i] == 1:
            if x[i-1] == 0:
                count = 0
            count = count + 1
        if x[i] == 0 and count > 0:
            interactions = interactions + 1
            count = count - 1
        i  = i + 1
    return interactions

def statistic(D):
    return lower_interactions(D) - upper_interactions(D)
Created
Dec 18, 2015 at 06:24 by Mike Gaudette
Updated
Dec 30, 2016 at 10:36 by Christian Stump