Let S={1,2…,n} for some integer n>1. Say a permutation π of S has a local maximum at k∈S if
(i)(ii)(iii)π(k)>π(k+1)π(k−1)<π(k) and π(k)>π(k+1)π(k−1)Mπ(k)for k=1for 1<k<nfor k=n
(For example, if n=5 and π takes values at 1,2,3,4,5 of 2,1,4,5,3, then π has a local maximum of 2 as k=1, and a local maximum at k−4.)
What is the average number of local maxima of a permutation of S, averaging over all permuatations of S?