Permutation Run

Author

Eric W. Weisstein
March 2, 2002

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Combinatorics/PermutationRun.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/PermutationRun.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Initialization

<<DiscreteMath`Combinatorica`

?Runs

n=2

{#,Runs[#]}&/@Permutations[2]//ColumnForm

Count[Length[Runs[#]]&/@Permutations[2],#]&/@Range[0,2]

Table[Eulerian[2,k-1],{k,0,2}]

n=3

{#,Runs[#]}&/@Permutations[3]//ColumnForm

Count[Length[Runs[#]]&/@Permutations[3],#]&/@Range[0,3]

Table[Eulerian[3,k-1],{k,0,3}]

Count[Length[Runs[#]]-1&/@Permutations[3],#]&/@Range[0,3]

A[n_,k_]:=Eulerian[n,k-1]

With[{n=3},
Table[A[n,k],{k,3}]
]

With[{n=3},
Table[Eulerian[n,k],{k,3}]
]