NumberthonNumberthon

SolveFire POTW

Bronze
combinatorics
5/11/2026
Problems sourced from solvefire.net
Problem
For a permutation π=(a1,a2,…,a10)\pi=(a_1,a_2,\ldots,a_{10}) of 1,2,…,101,2,\ldots,10, call an index ii with 2≤i≤92\le i\le9 a peak if ai>ai−1a_i>a_{i-1} and ai>ai+1a_i>a_{i+1}. Let P(π)P(\pi) be the number of peaks of π\pi. Find 19!∑πP(π)2\dfrac{1}{9!}\displaystyle\sum_{\pi}P(\pi)^2, where the sum is over all 10!10! permutations π\pi.
Solution ApproachShow

Step-by-step approach

Use P(π)2=∑i,j1[i peak]1[j peak]P(\pi)^2=\sum_{i,j}\mathbf{1}[i\text{ peak}]\mathbf{1}[j\text{ peak}]. The expected value E[P2]=E[P]2+Var(P)E[P^2]=E[P]^2+\text{Var}(P). For a permutation of nn, Pr⁡(i peak)=1/3\Pr(i\text{ peak})=1/3 for interior ii. For i≠ji\ne j, Pr⁡(i and j both peaks)\Pr(i\text{ and }j\text{ both peaks}) depends on their distance. Compute the sum.

Ready for more competition problems?

Practice the full SolveFire course and compete in ranked math battles — free to play.