## Range of binomial probability, given a certain number of observations?

### Remember to vote up questions/answers you find interesting or helpful (requires 15 reputation points)

Let's say I am given $n$ flips of a coin, $k$ of which are heads. These are iid flips.

Can I say, with probability $p > 1/2$, that the true probability of heads is in range $[p_1, p_2]$ ? What is that range?

How do I integrate prior knowledge of the binomial distribution? What if I have no prior knowledge?

-

## 3 Answers

There is a whole field around questions like this called bayesian statistics, it's been a while since I looked at this stuff but if I remember right.

Sadly you do need to have some pre-determined view of what p is. That is some before flipping the n coins you have a distribution in mind for the value of p (called the prior distribution). This distribution changes as you flip the coins (you get a posterior distribution).

For example you might start out believing that the coin has a 50% chance of being fair and a 50% chance of coming up heads 2/3rds of the time. (You might believe this if you know the person you got the coin from has both types of coins and there is a 50% chance he's trying to trick you).

The interesting (or at least nice) case is when your prior distribution is a "conjugate prior". Which basically means that your posterior distiribution for p is of the same parametric family as your prior distribution. I believe the conjugate prior for this is the beta distribution, but you might want to google "conjugate prior" and "bayesian statistics".

Hope that helps.

-

### You can accept an answer to one of your own questions by clicking the check mark next to it. This awards 15 reputation points to the person who answered and 2 reputation points to you.

http://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval

The idea of estimating a distribution parameter is to construct a random variable whose expectation is the parameter needed to be estimated. In your example, we want to estimate the success probability of a Bernoulli distribution and we construct a binomially distributed random variable by repeated trials. The key point is that the new random variable has the same average (after normalizing by n) but its standard deviation is smaller (by a factor of sqrt(n)) which gives better bounds on the estimated value. The confidence level is just a percetile of the distribution of the random variable used for the estimation (in your example you chose 50%).The interval size is a function of the percentile. The estimated value p* = k/n is inside the interval but the interval is not symmetric in general around this value. In the Wikipedia page, several approximations for large n are given, based on the central limit theorem, which are usually used in real-life estimations.

2.The above solution assumes prior knowledge that the distribution of a single trial is Bernoulli and that the trials are independent. Usually, one needs some prior knowledge to infere a statistical parameter. Specifically in your question, prior knowldge would be that the coin flips are independent, or that at after some flip the success probability p had changed, etc.

-

Some very sharp bounds for questions like these are provided by something called a Chernoff bound. The example in the wikipedia article will give you what you need.

Edit: Oh, I forgot to say that you need an estimator for the "true" probability, but I guess that the one you are using is just the average over the samples.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 4, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9305313229560852, "perplexity_flag": "head"}