For a permutation π=(a1,a2,…,a10) of 1,2,…,10, call an index i with 2≤i≤9 a peak if ai>ai−1 and ai>ai+1. Let P(π) be the number of peaks of π. Find 9!1π∑P(π)2, where the sum is over all 10! permutations π.
Solution ApproachShowHide
Step-by-step approach
Use P(π)2=∑i,j1[i peak]1[j peak]. The expected value E[P2]=E[P]2+Var(P). For a permutation of n, Pr(i peak)=1/3 for interior i. For i=j, Pr(i and j 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.