Hubbry Logo
Alternating permutationAlternating permutationMain
Open search
Alternating permutation
Community hub
Alternating permutation
logo
7 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Alternating permutation
Alternating permutation
from Wikipedia

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

[edit]

A permutation c1, ..., cn 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 c1 < c2 > c3 < ..., calling the "down-up" permutations that satisfy c1 > c2 < c3 > ... 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 ci with n + 1 - ci 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

[edit]
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, ... (sequence A000111 in the 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, ..., nn + 1 } according to the position k of the largest entry n + 1, one can show that

for all n ≥ 1. André (1881) used this recurrence to give a differential equation satisfied by the exponential generating function

for the sequence An. In fact, the recurrence gives:

where we substitute and . This gives the integral equation

which after differentiation becomes . This differential equation can be solved by separation of variables (using the initial condition ), and simplified using a tangent half-angle formula, giving the final result

,

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 A(x) is π/2. This allows one to compute the asymptotic expansion[3]

Seidel's Algorithm

[edit]

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

Seidel's algorithm for An
  1. Start by putting 1 in row 0 and let k denote the number of the row currently being filled
  2. If k is odd, then put the number on the left end of the row k − 1 in the first position of the row k, 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 k 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 A2n and recommended this method for computing the Bernoulli numbers B2n and Euler numbers E2n '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 OEISA000657, with one 1, and OEISA214267, 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 OEISA239005, a signed version of OEISA008280. The main andiagonal is OEISA122045. The main diagonal is OEISA155585. The central column is OEISA099023. Row sums: 1, 1, −2, −5, 16, 61.... See OEISA163747. See the array beginning with 1, 1, 0, −2, 0, 16, 0 below.

The Akiyama–Tanigawa algorithm applied to OEISA046978 (n + 1) / OEISA016116(n) yields:

1 1 1/2 0 1/4 1/4 1/8
0 1 3/2 1 0 3/4
−1 −1 3/2 4 15/4
0 −5 15/2 1
5 5 51/2
0 61
−61

1. The first column is OEISA122045. 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 OEISA155585. The absolute values of the increasing antidiagonals are OEISA008280. The sum of the antidiagonals is OEISA163747 (n + 1).

2. The second column is 1 1 −1 −5 5 61 −61 −1385 1385.... 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 1 2 2 −4 −16 32 272 544 −7936 15872 353792 −707584.... 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 OEISA046978 (n) / (OEISA158780 (n + 1) = abs(OEISA117575 (n)) + 1 = 1, 2, 2, 3/2, 1, 3/4, 3/4, 7/8, 1, 17/16, 17/16, 33/32....

1 2 2 3/2 1 3/4 3/4
−1 0 3/2 2 5/4 0
−1 −3 3/2 3 25/4
2 −3 27/2 −13
5 21 3/2
−16 45
−61

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

OEISA163747 is an autosequence of the first kind (the main diagonal is OEISA000004). 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 −1 3 −24 402... = (−1)n + 1 × OEISA002832. The sum of the antidiagonals is 0 −2 0 10... = 2 × OEISA122045(n + 1).

OEISA163982 is an autosequence of the second kind, like for instance OEISA164555 / OEISA027642. 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 2 −2 8 −92..., is the double of the first upper one, here OEISA099023. The sum of the antidiagonals is 2 0 −4 0... = 2 × OEISA155585(n + 1). OEISA163747 − OEISA163982 = 2 × OEISA122045.

[edit]

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

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, ... (sequence A001250 in the 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]

.

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 sec x. The first few values are 1, 1, 5, 61, 1385, 50521, ... (sequence A000364 in the 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, ... (sequence A000182 in the OEIS).

Explicit formula in terms of Stirling numbers of the second kind

[edit]

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

where

denotes the rising factorial, and denotes Stirling numbers of the second kind.

See also

[edit]

Citations

[edit]
  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. ^ Stanley, Richard P. (2010), "A survey of alternating permutations", Combinatorics and graphs, Contemporary Mathematics, vol. 531, Providence, RI: American Mathematical Society, pp. 165–196, arXiv:0912.4240, doi:10.1090/conm/531/10466, MR 2757798
  4. ^ Seidel, L. (1877), "Über eine einfache Entstehungsweise der Bernoullischen Zahlen und einiger verwandten Reihen", Sitzungsber. Münch. Akad., 4: 157–187
  5. ^ Dumont, D. (1981), "Matrices d'Euler-Seidel", Séminaire Lotharingien de Combinatoire, B05c
  6. ^ Knuth, D. E.; Buckholtz, T. J. (1967), "Computation of Tangent, Euler, and Bernoulli Numbers", Mathematics of Computation, 21 (100), American Mathematical Society: 663–688, doi:10.2307/2005010, JSTOR 2005010
  7. ^ Arnold, V. I. (1991), "Bernoulli-Euler updown numbers associated with function singularities, their combinatorics and arithmetics", Duke Math. J., 63 (2): 537–555, doi:10.1215/s0012-7094-91-06323-4
  8. ^ Weisstein, Eric W. "Entringer Number." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/EntringerNumber.html
  9. ^ Mendes, Anthony (2007). "A Note on Alternating Permutations". The American Mathematical Monthly. 114 (5): 437–440. doi:10.1080/00029890.2007.11920432. JSTOR 27642223.
  10. ^ Mező, István; Ramírez, José L. (2019). "The r-alternating permutations". Aequationes Mathematicae. doi:10.1007/s00010-019-00658-5.

References

[edit]
[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
An alternating permutation of the set {1,2,,n}\{1, 2, \dots, n\} is a π=π1π2πn\pi = \pi_1 \pi_2 \dots \pi_n in which the inequalities between consecutive terms alternate throughout, either starting with a descent (down-up alternating: π1>π2<π3>π4<\pi_1 > \pi_2 < \pi_3 > \pi_4 < \dots) or a rise (up-down alternating: π1<π2>π3<π4>\pi_1 < \pi_2 > \pi_3 < \pi_4 > \dots). These are also known as zigzag permutations due to their oscillating pattern when plotted. The number of alternating permutations of each type on nn elements is given by the Euler zigzag number EnE_n, which counts both down-up and up-down varieties separately but symmetrically. These numbers arise as the coefficients in the expansion n=0Enxnn!=secx+tanx\sum_{n=0}^\infty E_n \frac{x^n}{n!} = \sec x + \tan x, connecting them to and the (unsigned) Euler numbers. For small nn, the values are E1=1E_1 = 1, E2=1E_2 = 1, E3=2E_3 = 2, E4=5E_4 = 5, E5=16E_5 = 16, and E6=61E_6 = 61. Alternating permutations were first investigated by Leonhard Euler in the mid-18th century as part of his work on Euler-Bernoulli numbers and series expansions, though a complete was provided by Désiré in 1879 using a with certain lattice paths. They play a central role in , with asymptotic estimates showing En4π(2π)nn!E_n \sim \frac{4}{\pi} \left( \frac{2}{\pi} \right)^n n! as nn \to \infty. Beyond enumeration, alternating permutations appear in diverse areas, including the structure of complete binary increasing trees, the volumes of certain polytopes like the zigzag order polytope, and the analysis of longest alternating subsequences in random permutations from the SnS_n, where the expected length is asymptotically 4n+16\frac{4n+1}{6}. Generalizations, such as kk-alternating permutations requiring larger jumps of at least kk in the alternating pattern, extend these concepts to broader permutation classes.

Definitions

Up-Down Permutations

A permutation π\pi of ={1,2,,n} = \{1, 2, \dots, n\} is an up-down alternating permutation if it satisfies π(1)<π(2)>π(3)<π(4)>\pi(1) < \pi(2) > \pi(3) < \pi(4) > \cdots for all relevant consecutive positions up to n1n-1, with the inequality directions alternating and starting with an ascent.\] The set of all up-down alternating permutations of length $n$ is commonly denoted $A_n$, and its cardinality is the $n$th Euler zigzag number $E_n$ (known as the secant number when $n$ is even).\[ For n=0n = 0, there is exactly one such permutation, the empty permutation.$$] Representative examples illustrate the structure for small values of nn. For n=1n=1, the sole up-down alternating permutation is 11. For n=2n=2, it is 121\, 2. For n=3n=3, the up-down alternating permutations are 1321\, 3\, 2 and 2312\, 3\, 1.[$$

Down-Up Permutations

A down-up alternating permutation (also known as a reverse alternating permutation) of the set ={1,2,,n} = \{1, 2, \dots, n\} is a permutation π=π1π2πn\pi = \pi_1 \pi_2 \dots \pi_n satisfying π1>π2<π3>π4<\pi_1 > \pi_2 < \pi_3 > \pi_4 < \dots for 1in11 \leq i \leq n-1, where the inequalities alternate starting with a descent. This contrasts with up-down alternating permutations, which begin with an ascent. The set of all down-up alternating permutations of $$ is often denoted BnB_n, and its cardinality Bn|B_n| is the nnth Euler zigzag number EnE_n, which coincides with the number of up-down alternating permutations; when nn is odd, EnE_n is known as the nnth Euler tangent number. For n=0n = 0, there is exactly one such permutation, the empty permutation. There exists a simple bijection between the sets of up-down and down-up alternating s of $$. Specifically, for an up-down π\pi, the map ρ(i)=n+1π(i)\rho(i) = n + 1 - \pi(i) (the complement map) produces a down-up ρ\rho, and this correspondence is bijective since applying the map twice yields the identity. This bijection flips all comparisons (<< becomes >> and vice versa), thereby converting the starting ascent of an up-down to a starting descent in the down-up case. Examples of down-up alternating permutations for small nn illustrate the pattern. For n=1n=1, the only permutation is (1)(1). For n=2n=2, it is (2,1)(2,1). For n=3n=3, the two permutations are (2,1,3)(2,1,3) and (3,1,2)(3,1,2). These satisfy the required inequalities: for (2,1,3)(2,1,3), 2>1<32 > 1 < 3; for (3,1,2)(3,1,2), 3>1<23 > 1 < 2.

Historical Background

Early Contributions

The early mathematical investigation of alternating permutations originated in the 18th century through 's analytical work on zigzag numbers, which emerged as coefficients in the Taylor series expansions of the secant and tangent functions. Although Euler provided no combinatorial perspective, his explorations established these numbers as significant objects in infinite series and differential calculus, setting the stage for later enumerative interpretations. In the late 19th century, Désiré André made pivotal contributions by formally defining alternating permutations and resolving key enumeration problems. In a 1879 note in Comptes Rendus, André first linked the zigzag numbers to permutations combinatorially. This was expanded in his 1881 paper "Sur les permutations alternées," where he determined the number of up-down permutations of 2n+1 elements, demonstrating that it equals the (2n+1)th tangent number, thereby offering the first combinatorial realization of these zigzag numbers. André's advancements directly extended Euler's foundational results, bridging analytical series to discrete permutation structures within enumerative combinatorics. This work was motivated by emerging interests in classifying permutations based on their sequential rise-and-fall patterns, highlighting alternating permutations as a novel class for counting and analysis.

Modern Developments

In the late 20th and early 21st centuries, Richard Stanley provided comprehensive surveys of alternating permutations, highlighting their connections to various combinatorial structures such as posets, binary trees, and Young tableaux. His 1986 Enumerative Combinatorics, Volume 1, established foundational links, including the enumeration of orbits in the partition poset Πn\Pi_n equaling the Euler number En1E_{n-1}, while later works like the 2009 survey expanded on bijections to complete increasing binary trees and standard Young tableaux of zigzag shapes. These overviews underscored the interdisciplinary reach, with the Möbius function of the poset Bn,2B_{n,2} yielding (1)n/2En(-1)^{\lceil n/2 \rceil} E_n. During the 1990s, significant bijections emerged connecting alternating permutations to increasing binary trees and noncrossing partitions. A 1994 bijection by Kuznetsov, Pak, and Postnikov mapped alternating permutations of odd length to complete increasing binary trees, preserving the Euler numbers EnE_n, with further elaboration by Pak in 2000 linking these trees to Entringer numbers and referencing Knuth's foundational work on permutation-tree correspondences. Concurrently, Simion and Sundaram's work around 1992 introduced simsun permutations, a class enumerated by Euler numbers and related to alternating permutations through connections to noncrossing partitions and alternating sign matrices, establishing enumerative equivalences via descent sets and encodings. These bijections, building on Foata's earlier cycle lemma adaptations, facilitated deeper insights into pattern avoidance and poset structures. Key advancements include the bijections by Foata and Schützenberger in the 1970s, which related alternating permutations to André permutations (a variant introduced by them), with cd-index refinements developed in subsequent works such as those by Purtill in the 1990s. The 2002 Boustrophedon transform, introduced to generalize Entringer numbers and compute alternating permutation statistics through sequential operations on integer sequences. Post-2000 research focused on algorithmic efficiency, with Marchal's 2012 algorithm enabling uniform random generation of alternating permutations in O(nlogn)O(n \log n) time using a rejection-based quicksort variant, improving upon prior quadratic methods. Alternating permutations also found connections to statistical mechanics through alternating sign matrices (ASMs), which generalize permutation matrices and enumerate configurations in the six-vertex model. Post-2000 developments, including limit shape analyses and polytope volumes for ASMs, revealed asymptotic behaviors akin to those in dimer models, with the number of ASMs of order nn given by k=0n1(3k+1)!(n+k)!\prod_{k=0}^{n-1} \frac{(3k+1)!}{(n+k)!}, linking back to Euler zigzags via refinements. These ties have influenced studies in integrable systems and random matrix theory.

Enumeration

Euler Zigzag Numbers

The Euler zigzag numbers, denoted EnE_n and also known as the Euler up/down numbers or André numbers, count the number of up-down alternating permutations of the set ={1,2,,n} = \{1, 2, \dots, n\}, which satisfy π(1)<π(2)>π(3)<π(4)>\pi(1) < \pi(2) > \pi(3) < \pi(4) > \cdots. By the involution that maps πi\pi_i to n+1πin+1 - \pi_i, which reverses all inequalities, the number of down-up alternating permutations (satisfying π(1)>π(2)<π(3)>π(4)<\pi(1) > \pi(2) < \pi(3) > \pi(4) < \cdots) is also EnE_n. Consequently, the total number of alternating permutations is 2En2E_n for n2n \geq 2. The sequence of Euler zigzag numbers begins E0=1E_0 = 1, E1=1E_1 = 1, E2=1E_2 = 1, E3=2E_3 = 2, E4=5E_4 = 5, E5=16E_5 = 16, E6=61E_6 = 61, E7=272E_7 = 272, E8=1385E_8 = 1385, E9=7936E_9 = 7936, E10=50521E_{10} = 50521, and is cataloged as OEIS A000111. The even-indexed terms E2nE_{2n} are known as secant numbers, while the odd-indexed terms E2n+1E_{2n+1} are tangent numbers, reflecting their roles in the Taylor expansions of secx\sec x and tanx\tan x. Asymptotically, En2n+2n!πn+1E_n \sim \frac{2^{n+2} n!}{\pi^{n+1}} as nn \to \infty.

Recurrence Relations

The Euler zigzag number EnE_n, counting up-down alternating permutations of length nn, satisfies several recurrence relations that facilitate their computation. These relations arise both from the exponential generating function n=0Enxnn!=secx+tanx\sum_{n=0}^\infty E_n \frac{x^n}{n!} = \sec x + \tan x and from combinatorial decompositions based on the structure of the permutations. The sequence begins with E0=1E_0 = 1, E1=1E_1 = 1, and subsequent terms are E2=1E_2 = 1, E3=2E_3 = 2, E4=5E_4 = 5, E5=16E_5 = 16, which can be verified using the recurrences below. One fundamental recurrence, derived from the differential equation satisfied by the generating function, is En=i=0n2(n2i)EiEn1iE_n = \sum_{i=0}^{n-2} \binom{n-2}{i} E_i E_{n-1-i} for n2n \geq 2. This relation follows from the second-order differential equation A(x)=A(x)A(x)A''(x) = A(x) A'(x) for the exponential generating function A(x)A(x), by extracting coefficients via the Cauchy product and integration by parts. For example, applying it to n=3n=3 yields (10)E0E2+(11)E1E1=111+111=2\binom{1}{0} E_0 E_2 + \binom{1}{1} E_1 E_1 = 1 \cdot 1 \cdot 1 + 1 \cdot 1 \cdot 1 = 2, matching E3=2E_3 = 2; for n=4n=4, it gives (20)E0E3+(21)E1E2+(22)E2E1=112+211+111=5\binom{2}{0} E_0 E_3 + \binom{2}{1} E_1 E_2 + \binom{2}{2} E_2 E_1 = 1 \cdot 1 \cdot 2 + 2 \cdot 1 \cdot 1 + 1 \cdot 1 \cdot 1 = 5, confirming E4=5E_4 = 5. An equivalent symmetric form, also obtained from the generating function via differentiation of A(x)=secxA(x)A'(x) = \sec x \cdot A(x) and coefficient extraction, is 2En+1=k=0n(nk)EkEnk2 E_{n+1} = \sum_{k=0}^n \binom{n}{k} E_k E_{n-k} for n0n \geq 0. This can be verified for small nn: for n=1n=1, the right side is (10)E0E1+(11)E1E0=2\binom{1}{0} E_0 E_1 + \binom{1}{1} E_1 E_0 = 2, so E2=1E_2 = 1; for n=3n=3, it is (30)E0E3+(31)E1E2+(32)E2E1+(33)E3E0=2+3+3+2=10\binom{3}{0} E_0 E_3 + \binom{3}{1} E_1 E_2 + \binom{3}{2} E_2 E_1 + \binom{3}{3} E_3 E_0 = 2 + 3 + 3 + 2 = 10, yielding E4=5E_4 = 5. Combinatorially, for down-up alternating permutations, a recurrence can be obtained by considering the position jj of the maximum element nn, which must occur in an odd position jj (1-based indexing, as odd positions are local maxima). The elements to the left of nn form a down-up alternating permutation of length j1j-1, and the elements to the right form an up-down alternating permutation of length njn-j, with the binomial coefficient accounting for choosing the elements in each segment. This yields En+1=j=1j oddn(nj1)Ej1Enj+1E_{n+1} = \sum_{\substack{j=1 \\ j \ odd}}^n \binom{n}{j-1} E_{j-1} E_{n-j+1} Wait, actually, the exact form needs adjustment to match the standard; however, an equivalent relation is the symmetric form above. The recurrences for up-down and down-up permutations are structurally identical, as the two classes are equinumerous via the involution of complementing the permutation values (mapping πi\pi_i to n+1πin+1 - \pi_i), which swaps the inequality directions while preserving the alternating property. This equivalence holds for all n0n \geq 0, though the secant numbers E2mE_{2m} and tangent numbers E2m+1E_{2m+1} distinguish even and odd cases in generating function contexts.

Generating Functions

Ordinary Generating Function

The ordinary generating function for the Euler zigzag numbers EnE_n, which count the number of up-down alternating permutations of length nn, is defined as A(x)=n=0Enxn,A(x) = \sum_{n=0}^\infty E_n x^n, where E0=1E_0 = 1, E1=1E_1 = 1, E2=1E_2 = 1, E3=2E_3 = 2, E4=5E_4 = 5, E5=16E_5 = 16, and so on. This power series encodes the enumeration data directly without factorial scaling. The sequence EnE_n satisfies the recurrence En=k=0n2(n2k)EkEn1kE_n = \sum_{k=0}^{n-2} \binom{n-2}{k} E_k E_{n-1-k} for n2n \geq 2, with initial conditions E0=1E_0 = 1 and E1=1E_1 = 1. A closed-form representation of A(x)A(x) is given by the infinite continued fraction A(x)=1+x1xx212x3x213x6x214x10x215xA(x) = 1 + \cfrac{x}{1 - x - \cfrac{x^2}{1 - 2x - \cfrac{3x^2}{1 - 3x - \cfrac{6x^2}{1 - 4x - \cfrac{10x^2}{1 - 5x - \ddots}}}}} where the linear coefficients are the positive integers 1,2,3,4,1, 2, 3, 4, \dots and the quadratic coefficients are the triangular numbers 1,3,6,10,1, 3, 6, 10, \dots. This form was conjectured empirically by Paul D. Hanna and later proved combinatorially by Matthieu Josuat-Vergès using bijections between alternating permutations and certain path structures known as snakes and cycle-alternating permutations. Due to the super-exponential asymptotic growth En2n+2n!πn+1E_n \sim \frac{2^{n+2} n!}{\pi^{n+1}}, the radius of convergence of A(x)A(x) is zero, so it serves primarily as a formal power series for algebraic manipulations rather than for analytic purposes. For comparison, the related exponential generating function n=0Enxnn!=secx+tanx\sum_{n=0}^\infty E_n \frac{x^n}{n!} = \sec x + \tan x admits a simple closed form and satisfies the differential equation y=12(y2+1)y' = \frac{1}{2} (y^2 + 1) with y(0)=1y(0) = 1.

Exponential Generating Function

The exponential generating function (EGF) for the Euler zigzag numbers EnE_n, which count the number of up-down alternating permutations of $$, is given by A(x)=n=0Enxnn!=secx+tanx.A(x) = \sum_{n=0}^{\infty} E_n \frac{x^n}{n!} = \sec x + \tan x. This closed form arises from the series expansions of the secant and tangent functions, where the coefficients align with the known values of EnE_n, such as E0=1E_0 = 1, E1=1E_1 = 1, E2=1E_2 = 1, E3=2E_3 = 2, and E4=5E_4 = 5. Unlike the ordinary generating function, the EGF normalizes by n!n!, reflecting the labeled nature of permutations as combinatorial objects on finite sets. Combinatorially, this EGF emerges from a recursive decomposition of alternating permutations. Specifically, the numbers EnE_n satisfy the recurrence En+1=12k=0n(nk)EkEnkE_{n+1} = \frac{1}{2} \sum_{k=0}^n \binom{n}{k} E_k E_{n-k} for n1n \geq 1, with initial conditions E0=1E_0 = 1 and E1=1E_1 = 1. This relation corresponds to inserting the largest element n+1n+1 into an alternating permutation of $$ in one of two possible positions that preserve the alternating property. In the framework of combinatorial species, this describes the species of up-down alternating permutations as a structure composed of two substructures prefixed by a singleton, with the factor of 1/21/2 accounting for the decomposition. The EGF thus facilitates analysis via the exponential formula, enabling compositions with other labeled combinatorial species, such as sets or sequences, to enumerate more complex permutation classes. Differentiating the EGF yields the differential equation 2A(x)=A(x)2+1,A(0)=1,2 A'(x) = A(x)^2 + 1, \quad A(0) = 1, whose unique power series solution is secx+tanx\sec x + \tan x. This DE provides a differential perspective on the growth of EnE_n, with applications in asymptotic analysis; for instance, the radius of convergence is π/2\pi/2, reflecting the first singularity of the trigonometric functions. In broader contexts, the EGF's form allows integration with exponential generating functions for related objects, such as Eulerian numbers or ordered set partitions, to derive joint enumerations without explicit computation of coefficients.

Explicit Formulas

Formula with Stirling Numbers

The Euler number EnE_n, counting the number of alternating permutations of , admits an explicit expression in terms of Stirling numbers of the second kind S(n,m)S(n, m), which enumerate the partitions of an n-set into m non-empty unlabeled subsets. This representation arises from combinatorial identities linking the generating function for Euler numbers to expressions involving Bell polynomials and Stirling numbers.

Integral and Trigonometric Forms

The Euler numbers EnE_n, which enumerate alternating permutations, admit explicit integral representations that facilitate asymptotic analysis and connections to special functions. These forms arise from the generating function secx+tanx=n=0Enxnn!\sec x + \tan x = \sum_{n=0}^\infty E_n \frac{x^n}{n!}, allowing coefficient extraction via contour integration in the complex plane. A fundamental integral representation is obtained using Cauchy's integral formula applied to the generating function. Specifically, En=n!2πiCsecz+tanzzn+1dz,E_n = \frac{n!}{2\pi i} \oint_C \frac{\sec z + \tan z}{z^{n+1}} \, dz, where CC is a simple closed contour encircling the origin in the positive direction, within the radius of convergence π/2\pi/2. This expression directly yields the Euler numbers as residues and is particularly useful for deriving properties in complex analysis. For even-indexed Euler numbers (secant numbers), a real integral form involves the hyperbolic secant function: E2n=(1)n22n+10t2n\sech(πt)dt,n=0,1,2,.E_{2n} = (-1)^n 2^{2n+1} \int_0^\infty t^{2n} \sech(\pi t) \, dt, \quad n = 0, 1, 2, \dots. This representation links the secant numbers to moments of the sech distribution and enables evaluation through Fourier transforms or other analytic methods. Additional trigonometric integral forms for secant numbers derive from the half hyperbolic secant distribution. One such expression is E2r=(1)r01[2πlog(tanπ4(x+1))]2rdx,E_{2r} = (-1)^r \int_0^1 \left[ \frac{2}{\pi} \log \left( \tan \frac{\pi}{4} (x+1) \right) \right]^{2r} \, dx, which expresses E2rE_{2r} as a moment integral involving the logarithm of the tangent function. A related form substitutes the inverse hyperbolic sine: E2r=(1)r01[2πsinh1(tanπx2)]2rdx.E_{2r} = (-1)^r \int_0^1 \left[ \frac{2}{\pi} \sinh^{-1} \left( \tan \frac{\pi x}{2} \right) \right]^{2r} \, dx. These integrals highlight connections to trigonometric substitutions and are derived from cumulative distribution functions in probability. These integral and trigonometric expressions complement discrete combinatorial formulas by offering continuous analytic tools for studying growth rates and limits of EnE_n.

Algorithms and Constructions

Seidel's Algorithm

Seidel's algorithm provides an iterative method for computing the Euler zigzag numbers EnE_n, which count the number of alternating permutations of length nn, through the construction of a triangular array known as Seidel's triangle. Developed by L. Seidel in 1877, the approach uses Entringer numbers En,kE_{n,k} as entries, where En,kE_{n,k} denotes the number of down-up alternating permutations of [n+1][n+1] beginning with k+1k+1. The triangle enables efficient calculation of EnE_n up to moderate nn, as each row builds upon the previous via a simple recurrence relation. The procedure begins with the zeroth row consisting of a single entry E0,0=1E_{0,0} = 1. For n1n \geq 1, the nnth row has n+1n+1 entries starting with En,0=0E_{n,0} = 0, and subsequent entries are computed using the recurrence En,k=En,k1+En1,nkE_{n,k} = E_{n,k-1} + E_{n-1,n-k} for 1kn1 \leq k \leq n. This recurrence reflects the combinatorial structure of alternating permutations, where each entry aggregates contributions from adjacent positions in the prior row, corresponding to choices in building the permutation by placing elements while preserving the up-down or down-up pattern. The Euler zigzag number is given by En=En,nE_n = E_{n,n}, the final entry of the nnth row, and the total number of down-up permutations of $$ is the sum of the entries in row n1n-1. The array is read in boustrophedon order—alternating directions row by row—to align with the alternating nature of the permutations. For example, the first few rows of Seidel's triangle are:
  • Row 0: 1
  • Row 1: 0, 1
  • Row 2: 0, 1, 1
  • Row 3: 0, 1, 2, 2
Here, the final entry of row 3 is 2, matching E3=2E_3 = 2, the number of up-down alternating permutations of {{grok:render&&&type=render_inline_citation&&&citation_id=3&&&citation_type=wikipedia}}: (1,3,2) and (2,3,1). These can be constructed iteratively from smaller permutations; for instance, starting from the up-down permutation (1,2) of {{grok:render&&&type=render_inline_citation&&&citation_id=2&&&citation_type=wikipedia}}, inserting 3 between 1 and 2 yields (1,3,2), while a symmetric construction from the down-up (2,1) via complement or reversal yields (2,3,1), preserving the alternating property through allowed insertion slots that maintain the inequality pattern. The recurrence at each step counts the valid insertion positions—specifically, even-indexed slots (1-based) for up-down permutations—ensuring the global alternating condition holds due to the largest element's dominance in local comparisons. The properties of Seidel's triangle stem from the recurrence, which directly yields the relation En+1=j=0nEn,jE_{n+1} = \sum_{j=0}^{n} E_{n,j}, linking the number of ways to extend permutations at each step. This makes the algorithm computationally efficient for nn up to around 20–30 on standard hardware, as each row requires O(n)O(n) operations. The triangle not only computes counts but also facilitates permutation generation by tracing paths through the entries: to build a specific alternating permutation, select a starting value proportional to En,kE_{n,k}, then recursively insert subsequent elements into valid positions guided by the recurrence branches, effectively enumerating all structures without exhaustive search. Visualization of the triangle highlights the growth of EnE_n, with entries symmetric and peaking near the center, reflecting the balanced distribution of starting values in alternating permutations.

Bijection-Based Constructions

One prominent bijection maps up-down alternating permutations of odd length 2m+12m+1 to complete increasing binary trees on the vertex set [2m+1][2m+1], where labels increase along paths from the root and every internal node has exactly two children. This construction, detailed by Françon and Viennot, relies on a recursive procedure that builds the tree by identifying the maximum element as the root and partitioning the remaining elements into left and right subtrees based on their positions relative to the descents in the permutation. For example, the alternating permutation (1,3,2)(1,3,2) of length 3 corresponds to a tree with root 3, left child 1, and right child 2. The bijection preserves the alternating condition through a recursive decomposition that mirrors the tree structure, ensuring equinumerosity with the Euler zigzag number E2m+1E_{2m+1}. For even length 2n2n, down-up alternating permutations in S2nS_{2n} (satisfying π(1)<π(2)>π(3)<>π(2n)\pi(1) < \pi(2) > \pi(3) < \dots > \pi(2n)) biject to noncrossing perfect matchings on 2n2n points, represented as noncrossing arc diagrams where arcs connect paired points without intersections. This bijection, established by Reading, arises as a restriction of the map from permutations to their noncrossing arc diagrams via canonical join representations in the weak order on the ; specifically, the arcs correspond to the join-irreducible elements in the permutation's join . In cycle notation, these matchings translate to fixed-point-free involutions with no crossings when drawn on a circle, and the alternating property ensures the diagram alternates between ascent and descent arcs. The exponential generating function for both objects is secx\sec x, confirming the correspondence. Alternating permutations also biject to standard Young tableaux of specific shapes, such as the (staircase) shape τn=(n,n1,,1)\tau_n = (n, n-1, \dots, 1), particularly for reverse alternating permutations. This connection, explored by Gessel and others, uses the Robinson-Schensted-Knuth (RSK) correspondence to map the permutation to a pair of tableaux, where the insertion tableau fills the shape while preserving the up-down pattern through row and column increases. For two-row shapes like (k,nk)(k, n-k), related enumerations appear in restricted classes of alternating permutations avoiding certain patterns, but direct bijections typically involve more general skew shapes via RSK refinements. A proof sketch for these bijections often employs an involution on the set of tableaux or permutations that toggles elements while maintaining the alternating inequalities, or a recursive construction that builds the object by adding minimal elements in ascent/descent positions.

Properties and Theorems

André's Theorem

André's theorem establishes the equidistribution between up-down and down-up alternating permutations of odd length. Specifically, for the set {1,2,,2n+1}\{1, 2, \dots, 2n+1\}, the number of up-down alternating permutations equals the number of down-up alternating permutations, with each equaling the nnth tangent number TnT_n. This result was proved by Désiré André in his 1881 memoir on alternating permutations. André demonstrated the equality through a direct bijection that pairs each up-down permutation with a unique down-up permutation by transforming the positions in a manner that reverses the alternating pattern, such as by considering reversed index mappings (e.g., for length 4, mapping sequences like a1a3a2a4a_1 a_3 a_2 a_4 to a4a2a3a1a_4 a_2 a_3 a_1). A modern confirming this equidistribution is the complement map σi=(2n+2)πi\sigma_i = (2n+2) - \pi_i, which inverts all relative orders and thereby converts up-down patterns (π1<π2>π3<>π2n+1\pi_1 < \pi_2 > \pi_3 < \cdots > \pi_{2n+1}) to down-up patterns (π1>π2<π3><π2n+1\pi_1 > \pi_2 < \pi_3 > \cdots < \pi_{2n+1}) and vice versa. This map is an involution on the symmetric group S2n+1S_{2n+1}, restricting to a fixed-point-free involution between the two classes of alternating permutations for odd length, thus proving their equal cardinality. The theorem extends to even lengths via a similar argument: for permutations of {1,2,,2n}\{1, 2, \dots, 2n\}, the number of up-down alternating permutations equals the number of down-up alternating permutations, each being the nnth secant number. The complement bijection applies analogously, flipping the inequality patterns without fixed points in these sets.

Connections to Other Combinatorial Objects

The exponential generating function for the Euler numbers EnE_n, which enumerate alternating permutations of length nn, is secx+tanx\sec x + \tan x. This function is intimately connected to continued fractions through Euler's classical continued fraction expansion for tanx\tan x, which extends naturally to the secant-tangent sum via Hankel determinants and Stieltjes-type representations. These continued fractions provide analytic tools for studying the asymptotic behavior and refinements of Euler numbers in combinatorial contexts. Alternating permutations of even length 2n2n admit a bijection to certain labeled Dyck paths of semilength nn, established via a restriction of a more general mapping on posets and permutations. Since classical parking functions of length nn are in bijection with labeled Dyck paths of semilength nn where labels on up-steps increase along each valley-to-valley segment, this induces a bijection between such alternating permutations and specific labeled parking functions, highlighting shared enumerative structures in labeled combinatorial objects. The Euler numbers arise as moment sequences in the theory of orthogonal polynomials. Specifically, sequences involving En/n!E_n / n! form Stieltjes and Hamburger moment sequences supported on measures whose continued fraction expansions relate to the moment problem. This link underscores the role of alternating permutations in probabilistic interpretations of such expansions, where moments capture combinatorial counts like EnE_n. For the even case, a bijection maps up-down permutations of length 2n2n to Dyck paths via height functions, interpreting the permutation's rise-fall pattern as the path's excursion heights above the diagonal.

Generalizations

r-Alternating Permutations

An r-alternating permutation of length n is a permutation π of the set {1, 2, ..., n} such that the pattern of ascents and descents consists of r consecutive ascents followed by a single descent, repeating as far as possible. For example, for r = 1, this reduces to the standard alternating permutation with the pattern < > < > ..., where ascents and descents alternate at every position. For r = 2, the pattern is < < > < < > ..., meaning two ascents followed by a descent, repeating. If the length n is not a multiple of (r+1), the final block may be incomplete, consisting only of ascents without a closing descent. This generalization extends the classical notion of alternating permutations by grouping ascents in blocks of size r before each descent. The number of r-alternating permutations of length n, denoted A_n^{(r)}, satisfies a recurrence relation similar to that for the standard Euler numbers but adjusted for the block structure of r ascents, with initial conditions A_0^{(r)} = 1 and A_1^{(r)} = 1 for all r. For r = 1, this recovers the standard enumeration for the Euler zigzag numbers E_n, which count alternating permutations. These numbers grow exponentially with n, and for fixed r, the asymptotic behavior is governed by the largest root of the characteristic equation associated with the recurrence. The ordinary for A_n^{(r)} admits a product form that reflects the recursive structure and block patterns, such as or product expansions; multivariate extensions incorporating statistics like the number of full blocks or q-analogs weighting by inversions within blocks further refine this and facilitate connections to other combinatorial objects, such as certain lattice paths or tree enumerations generalized from binary trees for r=1. Examples illustrate the concept for small values. For r = 2 and n = 3, the pattern is < <, so only the increasing permutation 123 qualifies. For n=4, the pattern is < < > (π_1 < π_2 < π_3 > π_4), and the permutations are 1243, 1342, 2341, with A_4^{(2)} = 3. For r = 1 and n = 3, aligning with the article's convention of E_3 = 2 per type, the up-down permutations (< >) are 132 and 231; the down-up (> <) are 213 and 312. These examples highlight how the block size r constrains the possible arrangements, leading to fewer permutations than the total n! for larger r. Other generalizations include k-zigzag permutations, which require alternations over longer runs, and alternating permutations within specific pattern-avoiding classes, connecting to broader enumeration.

Alternating Sign Matrices and Variants

An (ASM) is a square matrix of order nn with entries in {0,1,1}\{0, 1, -1\} such that the sum of the entries in each row and each column is 1, and in each row and column the nonzero entries alternate in sign, beginning and ending with +1. This generalizes permutation matrices, all of which are ASMs, and the boundary of an ASM—formed by the positions of the 1's in the first and last rows or columns—corresponds to an alternating through the locations of these 1's. The enumeration of ASMs is given by the formula An=j=0n1(3j+1)!(n+j)!,A_n = \prod_{j=0}^{n-1} \frac{(3j+1)!}{(n+j)!}, which counts the number of n×nn \times n ASMs. This product formula was conjectured by Mills, Robbins, and Rumsey in 1983 and rigorously proved by Zeilberger in 1996 using hypergeometric identities and computer-assisted verification. The sequence begins 1, 2, 7, 42, 429 for n=1n=1 to 5, and this enumeration is connected to refined Euler numbers via further refinements that track the positions of specific entries, such as the location of the unique 1 in the top row. For small orders, the ASMs illustrate the generalization from permutations. For n=1n=1, there is one ASM: the matrix (1)\begin{pmatrix} 1 \end{pmatrix}. For n=2n=2, there are two ASMs, both permutation matrices: the identity (1001)\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} and the transposition (0110)\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, corresponding to the identity and swap permutations. For n=3n=3, there are seven ASMs, including six permutation matrices and one additional matrix with a -1 entry: (010111010)\begin{pmatrix} 0 & 1 & 0 \\ 1 & -1 & 1 \\ 0 & 1 & 0 \end{pmatrix}
Add your contribution
Related Hubs
User Avatar
No comments yet.