IesusDev

Probability Distributions

Binomial Probability Function

Suppose we perform n n Bernoulli trials, where the probability of success in each trial is p(0,1) p\in (0,1) . We can define the random variable X X as the number of successes obtained in the n n trials. The sample space of this experiment will consist of all sequences of length n n of successes and failures, and therefore its cardinality will be 2n 2^n . The values that X X can take are 0,1,,n 0,1,\cdots,n , and it is said that X X follows a binomial distribution with parameters n n and p p . This is written as Xbin(n,p) X \sim \text{bin}(n,p), and its probability function is:
f(x)={(nx)px(1p)nx if   x=0,1,,n0otherwise f(x) = \left\{ \begin{align*} \binom{n}{x} p^x (1-p)^{n-x} & \hspace{1cm} \text{ if }~~ x = 0, 1, \dots, n \\ 0 & \hspace{1cm} \text{otherwise} \end{align*} \right.
where (nx)=n!x!(nx)!\binom{n}{x} = \frac{n!}{x!(n-x)!} is the binomial coefficient.

This animation consists of a pyramid with nn rows, each containing obstacles. These obstacles cause the ball, when it hits them, to move to the left (failure) with a probability of 1p1-p or to the right (success) with a probability of pp.

In this way, the values of X=0,1,,nX=0,1,\ldots,n represent the number of successes obtained, that is, the number of times the ball moved to the right.

(You might need to reload the page for each animation)

p=p = 0.5
n=n = 10