Alternating permutation

From testwiki
Jump to navigation Jump to search

Template:Short description Template:Distinguish Template:Use mdy dates Template:Use American English

In combinatorial mathematics, an alternating permutation (or zigzag permutation) of the set {1, 2, 3, ..., n} is a permutation (arrangement) of those numbers so that each entry is alternately greater or less than the preceding entry. For example, the five alternating permutations of {1, 2, 3, 4} are:

  • 1, 3, 2, 4        because       1 < 3 > 2 < 4,
  • 1, 4, 2, 3        because       1 < 4 > 2 < 3,
  • 2, 3, 1, 4        because       2 < 3 > 1 < 4,
  • 2, 4, 1, 3        because       2 < 4 > 1 < 3, and
  • 3, 4, 1, 2        because       3 < 4 > 1 < 2.

This type of permutation was first studied by Désiré André in the 19th century.[1]

Different authors use the term alternating permutation slightly differently: some require that the second entry in an alternating permutation should be larger than the first (as in the examples above), others require that the alternation should be reversed (so that the second entry is smaller than the first, then the third larger than the second, and so on), while others call both types by the name alternating permutation.

The determination of the number An of alternating permutations of the set {1, ..., n} is called André's problem. The numbers An are known as Euler numbers, zigzag numbers, or up/down numbers. When n is even the number An is known as a secant number, while if n is odd it is known as a tangent number. These latter names come from the study of the generating function for the sequence.

Definitions

A permutation Template:Math is said to be alternating if its entries alternately rise and descend. Thus, each entry other than the first and the last should be either larger or smaller than both of its neighbors. Some authors use the term alternating to refer only to the "up-down" permutations for which Template:Math, calling the "down-up" permutations that satisfy Template:Math by the name reverse alternating. Other authors reverse this convention, or use the word "alternating" to refer to both up-down and down-up permutations.

There is a simple one-to-one correspondence between the down-up and up-down permutations: replacing each entry Template:Math with Template:Math reverses the relative order of the entries.

By convention, in any naming scheme the unique permutations of length 0 (the permutation of the empty set) and 1 (the permutation consisting of a single entry 1) are taken to be alternating.

André's theorem

The zigzag numbers in Bernoulli (1742), Opera Omnia vol. 4, p. 105

The determination of the number An of alternating permutations of the set {1, ..., n} is called André's problem. The numbers An are variously known as Euler numbers, zigzag numbers, up/down numbers, or by some combinations of these names. The name Euler numbers in particular is sometimes used for a closely related sequence. The first few values of An are 1, 1, 1, 2, 5, 16, 61, 272, 1385, 7936, 50521, ... Template:OEIS.

These numbers satisfy a simple recurrence, similar to that of the Catalan numbers: by splitting the set of alternating permutations (both down-up and up-down) of the set { 1, 2, 3, ..., n, n + 1 } according to the position k of the largest entry Template:Math, one can show that

2An+1=∑k=0n(nk)AkAn−k

for all Template:Math. Template:Harvtxt used this recurrence to give a differential equation satisfied by the exponential generating function

A(x)=∑n=0∞Anxnn!

for the sequence Template:Math. In fact, the recurrence gives:

2∑n≥1An+1xn+1(n+1)!=∑n≥1∑k=0nAkk!An−k(n−k)!xn+1n+1=∫(∑k≥0Akxkk!)(∑j≥0Ajxjj!)dx−x

where we substitute j=n−k and xn+1n+1=∫xk+jdx. This gives the integral equation

2(A(x)−1−x)=∫A(x)2dx−x,

which after differentiation becomes 2dAdx−2=A2−1. This differential equation can be solved by separation of variables (using the initial condition A(0)=A0/0!=1), and simplified using a tangent half-angle formula, giving the final result

A(x)=tan⁡(π4+x2)=sec⁡x+tan⁡x,

the sum of the secant and tangent functions. This result is known as André's theorem. A geometric interpretation of this result can be given using a generalization of a theorem by Johann Bernoulli.[2]

It follows from André's theorem that the radius of convergence of the series Template:Math is Template:Pi/2. This allows one to compute the asymptotic expansion[3]

An∼2(2π)n+1n!.

Seidel's Algorithm

In 1877 Philipp Ludwig von Seidel published an algorithm, which makes it simple to calculate Template:Math.[4]

Template:Image frame

  1. Start by putting 1 in row 0 and let Template:Math denote the number of the row currently being filled
  2. If Template:Math is odd, then put the number on the left end of the row Template:Math in the first position of the row Template:Math, and fill the row from the left to the right, with every entry being the sum of the number to the left and the number to the upper
  3. At the end of the row duplicate the last number.
  4. If Template:Math is even, proceed similar in the other direction.

Seidel's algorithm is in fact much more general (see the exposition of Dominique Dumont [5]) and was rediscovered several times thereafter.

Similar to Seidel's approach D. E. Knuth and T. J. Buckholtz gave a recurrence equation for the numbers Template:Math and recommended this method for computing the Bernoulli numbers Template:Math and Euler numbers Template:Math 'on electronic computers using only simple operations on integers'.[6]

V. I. Arnold[7] rediscovered Seidel's algorithm and later Millar, Sloane and Young popularized Seidel's algorithm under the name boustrophedon transform.

Triangular form:

1
1 1
2 2 1
2 4 5 5
16 16 14 10 5
16 32 46 56 61 61
272 272 256 224 178 122 61

Only Template:OEIS2C, with one 1, and Template:OEIS2C, with two 1s, are in the OEIS.

Distribution with a supplementary 1 and one 0 in the following rows:

1
0 1
−1 −1 0
0 −1 −2 −2
5 5 4 2 0
0 5 10 14 16 16
−61 −61 −56 −46 −32 −16 0

This is Template:OEIS2C, a signed version of Template:OEIS2C. The main andiagonal is Template:OEIS2C. The main diagonal is Template:OEIS2C. The central column is Template:OEIS2C. Row sums: 1, 1, −2, −5, 16, 61.... See Template:OEIS2C. See the array beginning with 1, 1, 0, −2, 0, 16, 0 below.

The Akiyama–Tanigawa algorithm applied to Template:OEIS2C (Template:Math) / Template:OEIS2C(Template:Math) yields:

1 1 Template:Sfrac 0 −Template:Sfrac −Template:Sfrac −Template:Sfrac
0 1 Template:Sfrac 1 0 −Template:Sfrac
−1 −1 Template:Sfrac 4 Template:Sfrac
0 −5 −Template:Sfrac 1
5 5 −Template:Sfrac
0 61
−61

1. The first column is Template:OEIS2C. Its binomial transform leads to:

1 1 0 −2 0 16 0
0 −1 −2 2 16 −16
−1 −1 4 14 −32
0 5 10 −46
5 5 −56
0 −61
−61

The first row of this array is Template:OEIS2C. The absolute values of the increasing antidiagonals are Template:OEIS2C. The sum of the antidiagonals is Template:Nowrap

2. The second column is Template:Nowrap. Its binomial transform yields:

1 2 2 −4 −16 32 272
1 0 −6 −12 48 240
−1 −6 −6 60 192
−5 0 66 32
5 66 66
61 0
−61

The first row of this array is Template:Nowrap. The absolute values of the second bisection are the double of the absolute values of the first bisection.

Consider the Akiyama-Tanigawa algorithm applied to Template:OEIS2C (Template:Math) / (Template:OEIS2C (Template:Math) = abs(Template:OEIS2C (Template:Mvar)) + 1 = Template:Nowrap.

1 2 2 Template:Sfrac 1 Template:Sfrac Template:Sfrac
−1 0 Template:Sfrac 2 Template:Sfrac 0
−1 −3 −Template:Sfrac 3 Template:Sfrac
2 −3 −Template:Sfrac −13
5 21 −Template:Sfrac
−16 45
−61

The first column whose the absolute values are Template:OEIS2C could be the numerator of a trigonometric function.

Template:OEIS2C is an autosequence of the first kind (the main diagonal is Template:OEIS2C). The corresponding array is:

0 −1 −1 2 5 −16 −61
−1 0 3 3 −21 −45
1 3 0 −24 −24
2 −3 −24 0
−5 −21 24
−16 45
−61

The first two upper diagonals are Template:Nowrap = Template:Math × Template:OEIS2C. The sum of the antidiagonals is Template:Nowrap = 2 × Template:OEIS2C(n + 1).

−Template:OEIS2C is an autosequence of the second kind, like for instance Template:OEIS2C / Template:OEIS2C. Hence the array:

2 1 −1 −2 5 16 −61
−1 −2 −1 7 11 −77
−1 1 8 4 −88
2 7 −4 −92
5 −11 −88
−16 −77
−61

The main diagonal, here Template:Nowrap, is the double of the first upper one, here Template:OEIS2C. The sum of the antidiagonals is Template:Nowrap = 2 × Template:OEIS2C(Template:Math1). Template:OEIS2C − Template:OEIS2C = 2 × Template:OEIS2C.

The odd-indexed zigzag numbers (i.e., the tangent numbers) are closely related to Bernoulli numbers. The relation is given by the formula

B2n=(−1)n−12n42n−22nA2n−1

for n > 0.

If Zn denotes the number of permutations of {1, ..., n} that are either up-down or down-up (or both, for n < 2) then it follows from the pairing given above that Zn = 2An for n ≥ 2. The first few values of Zn are 1, 1, 2, 4, 10, 32, 122, 544, 2770, 15872, 101042, ... Template:OEIS.

The Euler zigzag numbers are related to Entringer numbers, from which the zigzag numbers may be computed. The Entringer numbers can be defined recursively as follows:[8]

E(0,0)=1
E(n,0)=0for n>0
E(n,k)=E(n,k−1)+E(n−1,n−k).

The nth zigzag number is equal to the Entringer number E(n, n).

The numbers A2n with even indices are called secant numbers or zig numbers: since the secant function is even and tangent is odd, it follows from André's theorem above that they are the numerators in the Maclaurin series of Template:Math. The first few values are 1, 1, 5, 61, 1385, 50521, ... Template:OEIS.

Secant numbers are related to the signed Euler numbers (Taylor coefficients of hyperbolic secant) by the formula E2n = (−1)nA2n. (En = 0 when n is odd.)

Correspondingly, the numbers A2n+1 with odd indices are called tangent numbers or zag numbers. The first few values are 1, 2, 16, 272, 7936, ... Template:OEIS.

Explicit formula in terms of Stirling numbers of the second kind

The relationships of Euler zigzag numbers with the Euler numbers, and the Bernoulli numbers can be used to prove the following [9] [10]

Ar=−4rar∑k=1r(−1)kS(r,k)k+1(34)(k)

where

ar={(−1)r−12(1+2−r)if r is odd(−1)r2if r is even,

(x)(n)=(x)(x+1)⋯(x+n−1) denotes the rising factorial, and S(r,k) denotes Stirling numbers of the second kind.

See also

Citations

Template:Reflist

References

  1. ↑ Jessica Millar, N. J. A. Sloane, Neal E. Young, "A New Operation on Sequences: the Boustrouphedon Transform" Journal of Combinatorial Theory, Series A 76(1):44–54 (1996)
  2. ↑ Philippe Henry, Gerhard Wanner, "Zigzags with Bürgi, Bernoulli, Euler and the Seidel–Entringer–Arnol’d triangle", Elemente der Mathematik 74 (4) : 141–168 (2019)
  3. ↑ Template:Citation
  4. ↑ Template:Citation
  5. ↑ Template:Citation
  6. ↑ Template:Citation
  7. ↑ Template:Citation
  8. ↑ Weisstein, Eric W. "Entringer Number." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/EntringerNumber.html
  9. ↑ Template:Cite journal
  10. ↑ Template:Cite journal