jeudi 28 mai 2015

Probability, expected number

In an unsorted array, an element is a local maximum if it is larger than both of the two adjacent elements. The first and last elements of the array are considered local maxima if they are larger than the only adjacent element. If we create an array by randomly permuting the numbers from 1 to n, what is the expected number of local maxima? Prove your answer correct using additivity of expectations.

Im stuck with this question, i have no clue how to solve this...




Aucun commentaire:

Enregistrer un commentaire