Permutation with local maxima

1k Views Asked by At

I'm trying solve this problem:

Permutation of numbers $1$ to $n$ has a local maximum on $j^{th}$ position if number on $j^{th}$ position is bigger than both its neighbours. For first and last number of a permutation, local maximum exists if that number is bigger than its only neighbour. Knowing that every of $n!$ permutations is equally expected, calculate expected number of local maxima.

I tried defining $X$ (variable) with $X_i$ equal to number of local maxima on $i^{th}$ position, but couldn't continue past that.