Probability distribution of a binomial random variable
If $X$ is the number of successes in a sequence of $n$ independent Bernoulli trials, then
$P(X=x) = C(n,x)p^xq^{n-x} \qquad$ \t
#[where][donde]#
$C(n,x)$ is the number of combinations of $n$ items taken $x$ at a time, sometimes written as $\displaystyle {}_nC_x$ #[or][o] $\binom{n}{x}$.
$n =$ number of trials \\ $p =$ probability of success \\ $q =$ probability of failure $= 1-p$
#[Examples][Ejemplos]#
1. What is the probability of getting heads exactly twice if you flip a fair coin 6 times?
\\ $x =$ number of successes $= 2$
\\ $n =$ number of trials $= 6$
\\ $p =$ probability of success $= .5$
\\ $q =$ probability of failure $= 1-p = 1-.5 = .5$