Expected local maxima in a shuffle

The numbers 1,2,,201, 2, \dots, 20 are arranged in a row in a uniformly random order. Position ii is a local maximum if its value is strictly greater than each of its immediate neighbors (an end position has only one neighbor). What is the expected number of local maxima? (For example, in the arrangement 5132465\,1\,3\,2\,4\,6 of 1166, positions 11, 33, and 66 are local maxima.)

Show hints (2)+
  1. Define an indicator for each position being a local max and use linearity of expectation - you never need independence.
  2. An interior position is the max of its 3 relevant values with probability 1/31/3; an end position beats its one neighbor with probability 1/21/2. Count how many of each.

Answer

Reveal answer →

7

Want the full step-by-step worked solution? It's part of Premium - along with a worked solution for every question in the bank.

Asked at: Jane Street, Optiver

Related questions