Probability of number of flips given number of heads and P?

1. Nov 2, 2012

veritas_1

Hi forum, i'm new here, and have a burning question, that I can't seem to figure out or find on the internet.

If, for example, I've been told that I have a fair coin, and have 4 heads, what is the expected number of coin flips? of course, I assume it's 8 tosses, BUT what I really need to know is how to build the probability distribution over all number of flips N.

That is, in general, given H heads, and coin with probability of heads P, what is the probability distribution over N flips?

veritas

2. Nov 2, 2012

haruspex

There's no general answer to that. For any given N flips, you can say what the probability of 4 heads is, but that is different from the probability of N flips given 4 heads. Look up Bayesian inference. You need to construct an a priori distribution for N, then modify it based on the information that there were four heads.
There is another approach - maximum likelihood estimation, or MLE. You simply pick that N which maximises the likelihood of 4 heads. This doesn't give you a distribution for N, just a single estimate (and I regard it as simply hiding the a priori assumption - it's still there).

3. Nov 2, 2012

veritas_1

hmm...yea I guess I see your point.

was hoping to avoid making a bunch of emperically defined loops, but iguess this isn't really that much code, just not as elegant I guess as I wished.

good feedback though, thanks man!