# Dependent Bernoulli trials confidence interval

I would like to know if there is a way to build a confidence interval, for a random variable which has a Bernoulli distribution, based on its history. I mean if the order of its states is 11100 (i.e. lets consider its 5 last states), the confidence interval should be different from the one with history 00111, because in the 2nd case "on" states are the latest ones, and the center of the interval must be closer to 1, than in the first case. I'm sorry if the therms I used are not correct, but I'm not a mathematician.

In your case, I would presume that the parameter of interest is the Bernoulli trial success probability $p$. Therefore the confidence interval would provide an interval estimate of the true value of $p$ based on the data that was collected.