The distribution of the number of different locally maximal elements in a random sample is found, where the sampling is from a continuous population of real numbers. This distribution has application in certain nonparametric tests; the problem of finding the distribution may be regarded as identical with the enumeration of permutations according to the number of distinct locally maximal elements.
"The Distribution of the Number of Locally Maximal Elements in a Random Sample." Ann. Math. Statist. 28 (3) 786 - 790, September, 1957. https://doi.org/10.1214/aoms/1177706893