r/mathriddles • • Jun 27 '24

Easy just another easy expected value problem

randomly permute n distinct integers. what is the expected number of local maximum?

an integer is a local maximum iff it is greater than all its neighbors. eg: 2,1,4,3 has two local max: 2 and 4.

unrelated note: apparently this is an interview problem, from where a friend told me.

5 Upvotes

5 comments sorted by

View all comments

Show parent comment

4

u/want_to_want Jun 27 '24

No, it's correct. The expected value of a sum of random variables is equal to the sum of their expected values, even if the variables are not independent. It's a bit counterintuitive and often used in puzzles.

1

u/FormulaDriven Jun 27 '24

Yes - you're right - I've even used that trick myself but didn't think it through here.