# Bernoulli trial - formula derivation

I wanted to see I understand Bernoulli trial correctly. It's not a single experiment. Instead, we treat it as a set of $n$ consecutive experiments - each can end with success (with probability $p$) or failure (probability $q$ or $1-p$). Where does the formula $p^k(1-p)^{n-k}$ come from? I know it's the probability of getting $k$-successes and $n-k$ failures in $n$ experiments. Does the formula follow from combinatorics? We use combinatorics if we want to find the number of elementary events favorable to event $A$ and the total number of events to find out what $P(A)$ is.

One derivation I've came across starts with a statement that the sample space is a cartesian product of the sample spaces of single experiment that can result in $1$ or $0$.

$$P(A_1 \times A_2 \times ... \times A_n) = P(A_1 \times \Omega_2 \times ... \times \Omega_n) \times ... \times P(\Omega_1 \times ... \times A_n) = P_1(A_1) \cdot P_2(A_2)\cdot ... \cdot P_n(A_n))$$

I guess it's supposed to explain why the formula is $p^k(1-p)^{n-k}$, but I'm not sure what's going on above and why.

## 1 Answer

The formula you ask about is the probability that a sequence of length $n$ will be some particular sequence of successes (W) and failures (L). For example, you might ask the likelihood of a 5-sequence being specifically WWLWL.

Since the result of any individual trial is independent of the results of the other trials, Tthat probability is going to be $$p \cdot p \cdot (1-p) \cdot p \cdot (1-p)$$ But we can always re-order the multiplicative factors, bringing all the $p$'s to the left and all the $(1-p)$'s to the right. And that is how you get $$P(S) = p^k (1-p)^{n-k}$$ for any specific sequence $S$ containing $n$ experiments and $k$ successes among those $n$.

• Thanks. Any idea why the first term is equal to the second term in the equation (the one with cross products)? What's going on there? $\Omega_i$ is the sample space associated with $i$-th experiment (a single coin toss for example). The book says we want $P(A_i)$ be equal $P_i(A_i)$, and then they put this equation. – user4205580 Apr 15 '15 at 16:16