What is the chance of a sample in white noise to be a local extremum? I draw a long sequence of values from a uniform or normal distribution. Observing the resulting sequence, what is the chance of any point in the sequence (aside from the first and last where it is not defined) to be a local extremum? I.e. either a local maximum (the point is larger than both its neighbors) or a local minimum (the point is smaller than both its neighbors).
At first glance, you would think that once you've drawn the 1st point,  the expectancy of the 2nd to be smaller\bigger than the 1st is 50% and then the 3rd is bigger\smaller in 50% hence 0.5*0.5 + 0.5*0.5 = 0.5 chance.
However there is additional information in the 2nd point being larger than the 1st and hence a bigger (than 50%) chance that the 3rd point is also smaller than the 2nd.
A matlab code which calculates these chances result a chance of 2/3 (0.66%) :
sum(diff(sign(diff(normrnd(0,1,1,10000))))~=0)/10000 % Normal distribution
sum(diff(sign(diff(rand(1,10000))))~=0)/10000 % Uniform distribution

Iv'e tried to apply a combinatoric reasoning to explain this result : As being extremum is defined by 3 points only, let's narrow the problem to observe only 3 points. There are 6 possible orderings to 3 points, in 4 of which the second point is a local extremum, hence the 2/3 chance. 
Is this a correct reasoning? Are there other better ways to approach the problem (Integrating the probability density function)?

Some thoughts here:
Consider a sequence of $N$ iid random variables $X_i$. We have $N-2$ Bernoulli random variables $\{ B_i \}_{i=2}^{N-1}$ which are $1$ when $X_i$ is an extremum and $0$ otherwise. It is not immediately obvious that the $B_i$ are even independent; certainly the version where $B_i$ is $1$ when $X_i$ is a maximum are not independent! So there may be some nontrivial coupling to be considered here.
We can remove this coupling (if it exists) by restricting attention to the case $N=3$ for a moment. Denote the PDF of the variables separately by $f$. Then the probability that $B_2=1$ is
$$\int_{-\infty}^\infty \int_{-\infty}^\infty \int_{\max \{ x,z \}}^\infty f(x) f(y) f(z) dy dx dz + \int_{-\infty}^\infty \int_{-\infty}^\infty \int_{-\infty}^{\min \{ x,z \}} f(x) f(y) f(z) dy dx dz.$$
This can be simplified by splitting over which of $x,z$ is the maximum/minimum. In the uniform case it is straightforward to compute analytically. 
In general this probability is not independent of the distribution used. For example, in the Bernoulli case, this quantity is $p^2(1-p)+p^2(1-p)=p-p^2$, so it is larger for $p$ closer to $1/2$. So while I think you are right that it is $2/3$ in the uniform case (I seem to recall a geometric proof that each of the $n!$ "ordered tetrahedra" of the $n$-cube have equal probability under the uniform distribution), I would expect it to be different in general.
