Find the probability of getting 5 exactly twice in 7 throws of a die.

$\begin{array}{1 1} \large^{7}C_2. \large\frac{1}{6}^2.\large\frac{5}{6}^{5} \\ \large^{7}C_5. \large\frac{1}{6}^5.\large\frac{5}{6}^{2} \\ \large^{7}C_2. \large\frac{5}{6}^2.\large\frac{1}{6}^{5} \\ \large^{7}C_5. \large\frac{5}{6}^5.\large\frac{1}{6}^{2}\end{array}$

Toolbox:
• For any Binomial distribution $B (n, p),$ the probability of x success in n-Bernoulli trials, $P (X = x) = \large^{n}C_x. p^x.q^{n–x}$ where $x = 0, 1, 2,...,n$ and $(q = 1 – p)$
• Trials of a random experiment are called Bernoulli trials, if they satisfy the following conditions: (i) There should be a finite number of trials. (ii) The trials should be independent. (iii) Each trial has exactly two outcomes : success or failure. (iv) The probability of success remains the same in each trial.
The experiment is to throw the die $n=7$ times and get 5 exactly twice.
It is a case of Bernoulli trials as it satisfies the conditions (i) finite number of trials, (ii) independent trials, (iii) there is a definite outcome and (iv) the probability of success does not change for each trial.
P (getting a 5) $=p = \large\frac{1}{6} \rightarrow$$q = 1 - p = \large\frac{5}{6}$
Let X be the number of times we get a 5 exactl twice, in 7 throws of die. X has a bionomial distribution, the probability of x success in n-Bernoulli trials, $P (X = x) = \large^{n}C_x. p^x.q^{n–x}$ where $x = 0, 1, 2,...,n$ and $(q = 1 – p)$
P (getting a 5 exactly twice) $= P (X = 2) = \large^{7}C_2. \large\frac{1}{6}^2.\large\frac{5}{6}^{5}$
$P (X = 2) = 21 \large\frac{1}{36} \frac{3125}{7776} = \frac{21875}{93312}$