# Expected value of number of local maxima of numbers randomly placed on a circle

So I just came across this question and can find nothing like it online.

Suppose you have the numbers $$1- 18$$ and you randomly distribute them around a circle. What is the expected number of numbers that are greater than both numbers next to them? For example, if you had the sequence $$. . . 3 6 4 . . .$$, $$6$$ fulfills the condition but $$3$$ and $$4$$ cannot.

You need to do each number individually. I thought for any number $$i$$ the probability is $$1/3$$ as it needs to be greater than both of them. However, I think this is wrong. The probability it is greater than any one of its neighbors is obviously $$1/2$$, but the condition of being greater than one of the neighbors changes the condition of being greater than the second one I assume.

If I found this, then the expected value would just be $$18$$ times this number. Does anyone have ideas for this? Thanks

• The probability of fulfilling the criterion is not the same for every number. In the extreme cases $18$ fulfils the criterion with probability $1$ and $1$ fulfils it with probabilty $0$. Commented Aug 12 at 22:07
• Don't do it for each number, but do it for each space. That's the idea (indicator variable) that I think you're going for. Commented Aug 12 at 22:11
• Re Will's answer, see Linearity of Expectation, which includes a proof that the formula applies even when the events are not independent of each other. Commented Aug 12 at 22:24
• – Amir
Commented Aug 14 at 15:31

By linearity of the expected value it is indeed $$18$$ times the probability that a number at a given position is greater than its neighbours.
By symmetry that probability is $$1/3$$.
So the answer is $$18/3=6$$.
• $X$ is either the largest, in the middle or the lowest among three distinct numbers $X$, $Y$, $Z$. By symmetry those three possibilities happen with the same probability, hence $1/3$. I don't know if that's more elegant than what you wrote, maybe yes if you consider the fewer calculation, the more elegant :)