DR.WANG Mathematics中文

2026 Euclid · Question 10

Counting & combinatorics · permutations · Counting by cases

Problem outline

Call position jj of a permutation a peak when it lies strictly between its neighbours in position and its entry exceeds both neighbouring entries. Count permutations with exactly one peak, at the specified position: (a) n=5n=5, position 33; (b) general n≥5n\ge5, position 22; (c) general n≥5n\ge5, position 33. Give closed forms.

Show answer and methods 1 methods

Answer

(a) 4040. (b) (n−2)2n−2(n-2)2^{n-2}. (c) n(n−3)2n−3n(n-3)2^{n-3}.

Method 1 Cut into two peak-free blocks

On a fixed set of mm entries a peak-free permutation first decreases to its minimum and then increases. Choose which of the other m−1m-1 entries go to the left; their order and that of the right-hand entries are forced. Thus there are 2m−12^{m-1} such permutations.

Write SjS_j for the number with a unique peak at jj, putting S1=0S_1=0. Split after the first j−1j-1 entries, requiring both blocks to be peak-free. Choosing the first block’s entries and ordering both gives (nj−1)2j−22n−j=(nj−1)2n−2\binom{n}{j-1}2^{j-2}2^{n-j}=\binom{n}{j-1}2^{n-2} permutations.

In any such permutation the only possible global peaks are j−1j-1 and jj; consecutive positions cannot both be peaks. Conversely every permutation with either one of these peaks alone, or no peaks anywhere, satisfies the block conditions. Subtracting the 2n−12^{n-1} peak-free permutations gives Sj−1+Sj=((nj−1)−2)2n−2S_{j-1}+S_j=(\binom{n}{j-1}-2)2^{n-2}.

For j=2j=2 this gives S2=(n−2)2n−2S_2=(n-2)2^{n-2}. For j=3j=3 it gives S3=((n2)−n)2n−2=n(n−3)2n−3S_3=(\binom{n}{2}-n)2^{n-2}=n(n-3)2^{n-3}. Setting n=5n=5 yields 4040.

Source and attribution

The outline and worked methods on this page were prepared for DR.WANG Mathematics.

Original question (external)