Here's a series of data I'm observing:

`1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1 `

How do I use math to predict whether the next number in the series will be a 1 or a 0?

**Contents**hide

#### Best Answer

If observations are independent, and if values must either be 1 or 0, with no additional prior information, you may simply assume that the probability that the next value is 1 is equal to the proportion of 1s in the observations.

If you wish to calculate a confidence interval around this estimate, this could reasonably be modeled as a Bernoulli trial with probability $p=19/22simeq0.86$ And a 95% confidence interval of $[65%,97%]$ (CI calculated as the Clopper-Pearson interval).

This model is analogous to expecting heads from a coin that has landed on heads in 19 of 22 flips, or drawing a white pebble from a bag where the previous 22 draws gave 19 white + 3 nonwhite pebbles (if the pebbles are put back each time, or if there are infinite well mixed pebbles).

See also https://stats.stackexchange.com/a/6184/1381 for information and alternative methods for computing confidence intervals for Bernoulli trials.

Given the number of up votes on the OP, perhaps there is a less trivial solution, but I suspect that it just looks like it would be interesting if the observations were related, and order mattered, rather than being independent.

### Similar Posts:

- Solved – Calculating confidence interval for whether some of N coins are unfair
- Solved – Calculating confidence interval for whether some of N coins are unfair
- Solved – Discrete white noise
- Solved – Probablity of getting sequence of K equal results while tossing coin N times
- Solved – Probablity of getting sequence of K equal results while tossing coin N times