Peaking permutation

The set of integers { 1 , 2 , , 800 } \{1,2,\ldots, 800\} is permuted into a random order. What is the expected number of peaks in the resulting permutation?

Details and assumptions

A peak in a permutation occurs when an integer is larger that the integers on both sides of it. A peak cannot occur in the first or last positions.


The answer is 266.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Calvin Lin Staff
May 13, 2014

Solution 1: Consider any 3 distinct integers from the set { 1 , 2 , , n } . \{1,2,\ldots,n\}. There are ( n 3 ) \binom{n}{3} ways to choose 3 such integers and there are 2 2 ways to order them such that the larger one is first. There are ( n 2 ) ! (n-2)! arrangements which will have this as a subsequence. Thus, over all n ! n! arrangements, there are ( n 3 ) × 2 × ( n 2 ) ! \binom{n}{3} \times 2 \times (n-2)! peaks. The expected number of peaks will be n × ( n 1 ) × ( n 2 ) × 2 × ( n 2 ) ! 6 × n ! = ( n 2 ) 3 . \frac{n \times (n-1) \times (n-2) \times 2 \times (n-2)!}{6 \times n!} = \frac{(n-2)}{3}. When n = 800 n = 800 this gives 798 3 = 266. \frac{798}{3} = 266.

Solution 2: For i = 1 i = 1 to 798 798 , let I i I_i be the indicator variable that the i + 1 i+1 th position is a peak. Then I i I_i is independent of all the other values, except that of i , i + 1 , i + 2 i, i+1, i+2 . By considering all permutations of these values, we see that E [ I i ] = 1 3 E[I_i] = \frac{1}{3} . Hence, by linearity of expectation, the number of peaks is 798 E [ I i ] = 266 798 E[I_i] = 266 .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...