# Binomial Distribution Calculator

This on-line calculator helps calculate probability for \$$k\$$ successes in \$$n\$$ trials with probability \$$p\$$. It also plots the distribution of the random variable \$$X\$$.

Imagine some experiment (for example, tossing a coin) that only has two possible outcomes. Such an experiment is called Bernoulli trial. Now image a series of such experiments. What is the probability that tossing a fair coin 5 times we will get exactly 2 heads (and hence 3 tails)? Let A — "There will be 2 heads in 5 trials". Then, the probability is given by: \$$P(A) = { 5 \choose 2 } {1 \over 2^5 } =10 \times { 1 \over 32 } = { 5 \over 16 } =0.3125\$$ Generally: \$$P(A)= { n \choose k } pnqn−k\$$ Where *n* is the number of trials *k* is the number of successes *p* the probability for a success *q* the probability for a failure and \$$p \choose q \$$ is the binomial coefficient.