# Probability of Consecutive Data Points Rising and Falling in a Saw-tooth Pattern

#### InfoQualityDude

##### New member
What is the correct way to calculate the probability of a given number of consecutive data points forming a saw-tooth pattern?
The magnitudes of the rise or fall (the size of the moutain and valleys) are not material.
The only requirement is that each set of three consecutive data points must form either a mountain or a valley, and that there is 1 mountain, followed by 1 valley, followed by 1 mountain, followed by 1 valley, etc.

#### chisigma

##### Well-known member
Let's suppose to have n random variable $\displaystyle x_{i}\ , i=1,2,...,n$ each of them uniformly distributed from 0 to 1. In this situation You have...

$\displaystyle P\{x_{i+1}<x_{i}\}=P\{x_{i+1}>x_{i}\}=\frac{1}{2}$ (1)

Let's set with $p_{n}$ the probability that the n $x_{i}$ form a 'saw tooth pattern'. It is quite obvious that $p_{2}=1$ so that , if the (1) is true, $p_{n}$ is the solution of the difference equation...

$\displaystyle p_{n+1}=\frac{p_{n}}{2}\ ,\ p_{2}=1$ (1)

... and that solution is $\displaystyle p_{n}=2^{2-n}$...

Kind regards

$\chi$ $\sigma$