An up-down permutation of an ordered set is a permutation such that as you move from left to right the permutation alternates up and down. For example
1, 5, 3, 4, 2
is an up-down permutation of 1, 2, 3, 4, 5 because
1 < 5 > 3 < 4 > 2.
Up-down permutations are also called alternating permutations for obvious reasons. The number of up-down permutations of a set of size n is often denoted A(n) because these permutations were first studied by Désiré André. It is also sometimes denoted En, where the E alludes to Euler.
André found the generating function for A(n):
You could read this as saying sec(x) + tan(x) is the exponential generating function for A(n) or as saying sec(x) + tan(x) is the ordinary generating function for
where P(n) is the proportion of all permutations of the digits 1 through n which are alternating permutations.
It’s amazing that up-down permutations have anything to do with trig functions, but they do.
Knowing the (exponential) generating function for A(n) lets us use generating function techniques to prove various things about these number. For example, we can use the generating function to discover their asymptotic behavior.
The secant and tangent functions are well behaved at 0, but both have a singularity at π/2. This means the generating function above is not just a formal power series but an analytic power series with radius of convergence π/2, the distance from the center of the power series to the closest singularity. It follows that
and so the proportion of permutations which are alternating permutations decreases exponentially for large n.