Title: Default for 37.2 The Binomial Distribution
Course: HELM Workbooks 2023-2024

The binomial model

We have introduced random variables from a general perspective and have seen that there are two basic types: discrete and continuous. We examine four particular examples of distributions for random variables which occur often in practice and have been given special names. They are the binomial distribution (sampling with replacement), the Hypergeometric distribution (sampling without replacement), the Poisson distribution and the Normal distribution. The first three are distributions for discrete random variables and the fourth is for a continuous random variable. Here we focus attention on the binomial distribution.

The binomial distribution can be used in situations in which a given experiment (often referred to, in this context, as a trial) is repeated a number of times. For the binomial model to be applied the following four criteria must be satisfied:

- the trial is carried out a fixed number of times \(n\)
- the outcomes of each trial can be classified into two ‘types’ conventionally named ‘success’ or ‘failure’
- the probability \(p\) of success remains constant for each trial
- the individual trials are independent of each other.

For example, if we consider throwing a coin 7 times what is the probability that exactly 4 Heads occur? This problem can be modelled by the binomial distribution since the four basic criteria are assumed satisfied as we see

- here the trial is ‘throwing a coin’ which is carried out 7 times
- the occurrence of Heads on any given trial (i.e. throw) may be called a ‘success’ and Tails called a ‘failure’
- the probability of success is \(p = \dfrac{1}{2} \) and remains constant for each trial
- each throw of the coin is independent of the others.

The student will be able to complete the solution to this example once we have constructed the general binomial model.

The following two scenarios are typical of those met by engineers. The reader should check that the criteria stated above are met by each scenario

1. An electronic product has a total of 30 integrated circuits built into it. The product is capable of operating successfully only if at least 27 of the circuits operate properly. What is the probability that the product operates successfully if the probability of any integrated circuit failing to operate is 0.01?
2. Digital communication is achieved by transmitting information in “bits”. Errors do occur in data transmissions. Suppose that the number of bits in error is represented by the random variable \(X\) and that the probability of a communication error in a bit is 0.001. If at most 2 errors are present in a 1000 bit transmission, the transmission can be successfully decoded. If a 1000 bit message is transmitted, find the probability that it can be successfully decoded.

Before developing the general binomial distribution we consider the following examples which, as you will soon recognise, have the basic characteristics of a binomial distribution.

Example

In a box of floppy discs, it is known that \(95\%\) will work. A sample of three of the discs are selected at random.

Find the probability that:

1. none will work
2. 1 will work
3. 2 will work
4. all 3 of the sample will work.

Solution

Let the event {the disc works} be \(W\) and the event {the disc fails} be \(F\). The probability that a disc will work is denoted by \(\text{P} (W)\) and the probability that a disc will fail is denoted by \(\text{P} (F)\). Then \(\text{P}(W) = 0.95\) and \(\text{P}(F) = 1 − \text{P}(W) = 1 − 0.95 = 0.05\).

1. The probability that none of the discs works equals the probability that all 3 discs fail. This is given by:
\[\begin{aligned} \text{P}(\text{none work)}=\text{P} (FFF)&= \text{P} (F)\!\times\! \text{P} (F)\!\times\! \text{P} (F)\qquad\text{as the events are independent}\\ &=0.05\!\times\! 0.05\!\times\! 0.05=0.05^3=0.000125\end{aligned}\]
2. If only one disc works then you could select the three discs in the following orders
\((FFW)\ \text{or}\ (FWF)\ \text{or}\ (WFF)\)hence \[\begin{aligned} \text{P}(\text{one works)}&=\text{P} (FFW)\!+\!\text{P} (FWF)\!+\!\text{P} (WFF)\\ &=\text{P} (F)\!\times\! \text{P} (F)\!\times\! \text{P} (W)\!+\!\text{P} (F)\!\times\! \text{P}(W)\!\times\! \text{P} (F)\!+\!\text{P} (W)\!\times\! \text{P} (F)\!\times\! \text{P} (F)\\ &=(0.05\!\times\! 0.05\!\times\! 0.95)\!+\!(0.05\!\times\! 0.95\!\times\!0.05)\!+\!(0.95\!\times\! 0.05\!\times\! 0.05)\\ &=3\!\times\!(0.05)^2\!\times\! 0.95=0.007125\end{aligned}\]
3. If 2 discs work you could select them in order
\(\qquad (FWW)\ \text{or}\ (WFW)\ \text{or}\ (WWF)\)hence \[\begin{aligned} \text{P}(\text{two work)}\!&=\!\text{P} (FWW)\!+\!\text{P} (WFW)\!+\!\text{P} (WWF)\\ &=\text{P}(F)\!\times\! \text{P} (W)\!\times\! \text{P} (W)\!+\!\text{P} (W)\!\times\! \text{P} (F)\!\times\! \text{P} (W)\!+\!\text{P} (W)\!\times\! \text{P} (W)\!\times\! \text{P} (F)\\ &=(0.05\!\times\! 0.95\!\times\!0.95)\!+\!(0.95\!\times\! 0.05\!\times\! 0.95)\!+\!(0.95\!\times\! 0.95\!\times\! 0.05)\\ &=3\!\times\!(0.05)\!\times\! (0.95)^2=0.135375\end{aligned}\]
4. The probability that all 3 discs work is given by \( \text{P} (WWW)=0.95^3=0.857375 \)
Notice that since the 4 outcomes we have dealt with are all possible outcomes of selecting 3 discs, the probabilities should add up to 1. It is an easy check to verify that they do.
One of the most important assumptions above is that of independence.The probability of selecting a working disc remains unchanged no matter whether the previous selected disc worked or not.

Example

A worn machine is known to produce 10% defective components. If the random variable \(X\) is the number of defective components produced in a run of 3 components, find the probabilities that \(X\) takes the values 0 to 3.

Solution

Assuming that the production of components is independent and that the probability \(p=0.1\) of producing a defective component remains constant, the following table summarizes the production run. We let \(G\) represent a good component and let \(D\) represent a defective component.

Note that since we are only dealing with two possible outcomes, we can say that the probability \(q\) of the machine producing a good component is \(1-0.1=0.9\). More generally, we know that \(q\!+\!p=1\) if we are dealing with a binomial distribution.

\(\begin{matrix} \text{Outcome}&\text{Value of}\ X& \text{Probability of Occurrence}\\ GGG&0&(0.9)(0.9)(0.9)=(0.9)^3\\ GGD&1&(0.9)(0.9)(0.1)=(0.9)^2(0.1)\\ GDG&1&(0.9)(0.1)(0.9)=(0.9)^2(0.1)\\ DGG&1&(0.1)(0.9)(0.9)=(0.9)^2(0.1)\\ DDG&2&(0.1)(0.1)(0.9)=(0.9)(0.1)^2\\ DGD&2&(0.1)(0.9)(0.1)=(0.9)(0.1)^2\\ GDD&2&(0.9)(0.1)(0.1)=(0.9)(0.1)^2\\ DDD&3&(0.1)(0.1)(0.1)=(0.1)^3 \end{matrix}\)

From this table it is easy to see that

\(\qquad \text{P} (X=0)=(0.9)^3\)

\(\qquad \text{P} (X=1)=3\times (0.9)^2(0.1)\)

\(\qquad \text{P} (X=2)=3\times (0.9)(0.1)^2\)

\(\qquad \text{P} (X=3)=(0.1)^3\)

Clearly, a pattern is developing. In fact you may have already realized that the probabilities we have found are just the terms of the expansion of the expression \((0.9+0.1)^3\) since

\(\qquad (0.9+0.1)^3=(0.9)^3+3\times (0.9)^2(0.1)+3\times (0.9)(0.1)^2+(0.1)^3\)

We now develop the binomial distribution from a more general perspective. If you find the theory getting a bit heavy simply refer back to this example to help clarify the situation.

First we shall find it convenient to denote the probability of failure on a trial, which is \(1-p\), by \(q\), that is:

\(\qquad q=1-p.\)

What we shall do is to calculate probabilities of the number of ‘successes’ occurring in \(n\) trials, beginning with \(n=1\).

\(\underline{\pmb n\pmb =\pmb 1}\)   With only one trial we can observe either 1 success (with probability \(p\)) or 0 successes (with probability \(q\)).

\(\underline{\pmb n\pmb =\pmb 2}\)   Here there are 3 possibilities: We can observe 2, 1 or 0 successes. Let \(S\) denote a success and \(F\) denote a failure. So a failure followed by a success would be denoted by \(FS\) whilst two failures followed by one success would be denoted by \(FFS\) and so on.
Then

\(\qquad \text{P} (\text{2 successes in 2 trials})=\text{P} (SS)=\text{P} (S)\text{P} (S)=p^2\)

(where we have used the assumption of independence between trials and hence multiplied probabilities). Now, using the usual rules of basic probability, we have:

\(\qquad \text{P} (\text{1 success in 2 trials})=\text{P} [(SF)\cup(FS)]=\text{P} (SF)+\text{P} (FS)=pq+qp=2pq\)

\(\qquad \text{P} (\text{0 successes in 2 trials})=\text{P} (FF)=\text{P} (F)\text{P} (F)=q^2\)

The three probabilities we have found \(-\) \(q^2,\ 2qp,\ p^2\) \(-\) are in fact the terms which arise in the binomial expansion of \((q+p)^2= q^2+2qp+p^2\). We also note that since \(q=1-p\) the probabilities sum to 1 (as we should expect):

\(\qquad q^2+2qp+p^2=(q+p)^2=((1-p)+p)^2=1\)

Example

List the outcomes for the binomial model for the case \(n=3\), calculate their probabilities and display the results in a table.

Solution

\(\{\)three successes, two successes, one success, no successes\(\}\)

Three successes occur only as \(SSS\) with probability \(p^3\).

Two successes can occur as \(SSF\) with probability \((p^2q)\), as \(SFS\) with probability \((pqp)\) or as \(FSS\) with probability \((qp^2)\).

These are mutually exclusive events so the combined probability is the sum \(3p^2q\).

Similarly, we can calculate the other probabilities and obtain the following table of results.

Number of successes | 3 | 2 | 1 | 0
Probability | \(p^3\) | \(3p^2q\) | \(3 pq^2\) | \(q^3\)

Note that the probabilities you have obtained:

\(\qquad q^3,\ 3q^2p,\ 3qp^2,\ p^3\)

are the terms which arise in the binomial expansion of \((q+p)^3=q^3+3q^2p+3qp^2+p^3\)

If we repeat the previous example for the binomial model for the case with \(n=4\) we have

Number of successes | 4 | 3 | 2 | 1 | 0
Probability | \(p^4\) | \(4p^3q\) | \(6p^2q^2\) | \(4 pq^3\) | \(q^4\)

Again we explore the connection between the probabilities and the terms in the binomial expansion of \((q+p)^4\). Consider this expansion

\(\qquad (q+p)^4= q^4+4q^3p+6q^2p^2+4qp^3+p^4\)

Then, for example, the term \(4p^3q\), is the probability of 3 successes in the four trials. These successes can occur anywhere in the four trials and there must be one failure hence the \(p^3\) and \(q\) components which are multiplied together. The remaining part of this term, 4, is the number of ways of selecting three objects from 4.

Similarly, there are \( ^4\!C_2=\frac{4!}{2!2!}=6\) ways of selecting two objects from 4 so that the coefficient 6 combines with \(p^2\) and \(q^2\) to give the probability of two successes (and hence two failures) in four trials.

The approach described here can be extended for any number \(n\) of trials.

Key Point

The Binomial Probabilities

Let \(X\) be a discrete random variable, being the number of successes occurring in \(n\) independent trials of an experiment. If \(X\) is to be described by the binomial model, the probability of exactly \(r\) successes in \(n\) trials is given by

\(\text{P} (X=r)=\ ^n\!C_rp^rq^{n-r}.\)

Here there are \(r\) successes (each with probability \(p\)), \(n-r\) failures (each with probability \(q\)) and \(^n\!C_r=\dfrac{n!}{r!(n-r)!}\) is the number of ways of placing the \(r\) successes among the \(n\) trials.

Notation

If a random variable \(X\) follows a binomial distribution in which an experiment is repeated \(n\) times each with probability \(p\) of success then we write \(X \sim B(n,p)\).

Example

A worn machine is known to produce 10% defective components. If the random variable \(X\) is the number of defective components produced in a run of 4 components, find the probabilities that \(X\) takes the values 0 to 4.

Solution

From a previous example, we know that the probabilities required are the terms of the expansion of the expression:

\(\qquad (0.9+0.1)^4\qquad\qquad\text{so }\qquad X\sim B(4,0.1)\)

Hence the required probabilities are (using the general formula with \(n=4\) and \(p=0.1\))

\(\qquad \text{P} (X= 0)=(0.9)^4=0.6561\)

\(\qquad \text{P} (X=1)=4(0.9)^3(0.1)=0.2916\)

\(\qquad \text{P} (X=2)=\dfrac{4\times 3}{1\times 2}(0.9)^2(0.1)^2=0.0486\)

\(\qquad \text{P} (X=3)=\dfrac{4\times 3\times 2}{1\times 2\times 3}(0.9)(0.1)^3=0.0036\)

\(\qquad \text{P} (X=4)=(0.1)^4=0.0001\)

Also, since we are using the expansion of \((0.9+0.1)^4\), the probabilities should sum to 1, This is a useful check on your arithmetic when you are using a binomial distribution.

Example

In a box of switches it is known 10% of the switches are faulty. A technician is wiring 30 circuits, each of which needs one switch. What is the probability that

1. all 30 work,
2. at most 2 of the circuits do not work?

Solution

The answers involve binomial distributions because there are only two states for each circuit - it either works or it doesn’t work.

    A trial is the operation of testing each circuit.

    A success is that it works. We are given \(\text{P}\)(success) = \(p= 0.9\)

    Also we have the number of trials \(n=30\)

Applying the binomial distribution \(\text{P} (X=r)=\ ^nC_rp^r(1-p)^{n-r}\).

1. Probability that all 30 work is \( \text{P} (X=30)=\ ^{30}C_{30}(0.9)^{30}(0.1)^0=0.04239\)
2. The statement that ‘‘at most 2 circuits do not work’’ implies that 28, 29 or 30 work. That is \(X\ge 28\) \[\begin{aligned} \text{P} (X\ge 28)&=\text{P} (X=28)+\text{P} (X=29)+\text{P} (X=30)\\ \text{P} (X=30)&= \ ^{30}C_{30}(0.9)^{30}(0.1)^0=0.04239\\ \text{P} (X=29)&= \ ^{30}C_{29}(0.9)^{29}(0.1)^1=0.14130\\ \text{P} (X=28)&= \ ^{30}C_{28}(0.9)^{28}(0.1)^2=0.22766\end{aligned}\] Hence \(\text{P} (X\ge 28)=0.41135\)

Example

A University Engineering Department has introduced a new software package called SOLVIT. To save money, the University’s urchasing Department has negotiated a bargain price for a 4-user licence that allows only four students to use SOLVIT at any one time. It is estimated that this should allow 90% of students to use the package when they need it. The Students’ Union has asked for more licences to be bought since engineering students report having to queue excessively to use SOLVIT. As a result the Computer Centre monitors the use of the software. Their findings show that on average 20 students are logged on at peak times and 4 of these want to use SOLVIT. Was the urchasing Department’s estimate correct?

Solution

\(\text{P}\)(student wanted to use SOLVIT ) = \(\dfrac{4}{20}=0.2\)

Let \(X\) be the number of students wanting to use SOLVIT at any one time, then

\[\begin{aligned} \text{P} (X=0)&=\ ^{20}C_0(0.2)^0(0.8)^{20}=0.0115\\ \text{P} (X=1)&=\ ^{20}C_1(0.2)^1(0.8)^{19}=0.0576\\ \text{P} (X=2)&=\ ^{20}C_2(0.2)^2(0.8)^{18}=0.1369\\ \text{P} (X=3)&=\ ^{20}C_3(0.2)^3(0.8)^{17}=0.2054\\ \text{P} (X=4)&=\ ^{20}C_4(0.2)^4(0.8)^{16}=0.2182\end{aligned}\]

Therefore

\[\begin{aligned} \text{P} (X\le 4)&=\text{P} (X= 0)+\text{P} (X= 1)+\text{P} (X=2)+\text{P} (X=3)+\text{P} (X=4)\\ &=0.01152+0.0576+0.1369+0.2054+0.2182\\ &=0.61862\end{aligned}\]

The probability that more than 4 students will want to use SOLVIT is

  \(\qquad \text{P} (X>4)=1-\text{P} (X\le 4)=0.38138\)

That is, 38% of the time there will be more than 4 students wanting to use the software. The Purchasing Department has grossly overestimated the availability of the software on the basis of a 4-user licence.

Exercise

Using the binomial model, and assuming that a success occurs with probability \(\dfrac{1}{[value]}\) in each trial, find the probability that in [value] trials there are

1. 0 successes
2. [value] successes
3. [value] failures.

Let \(X\) be the number of successes in [value] independent trials. Note: Please round your answer to the nearest 2 decimal places.

1. \(\text{P} (X=0)=\)
2. \(\text{P} (X=[value])=\)
3. \(\text{P} (X=[value])=\)
Feedback: SOLUTION: In each case \( p=\dfrac{1}{[value]} \) and \( q=1-p=\dfrac{[value]}{[value]}\). 1. Here \(r=0\) and \(\text{P}(X=0) = q^[value] = \left( \dfrac{[value]}{[value]} \right)^[value] = \dfrac{[value]}{[value]} \approx [value] \) 2. Here \(r=[value]\) and \(\text{P} (X=[value])= ^[value]C_[value]p^[value]q^[value] = \dfrac{[value]!}{[value]!([value]-[value])!} \times \left( \dfrac{1}{[value]} \right)^[value] \times \left( \dfrac{[value]}{[value]} \right)^[value] \approx [value] \) 3. Here \(r=[value]\) and \(\text{P} (X=[value])= ^[value]C_[value]p^[value]q^[value] = \dfrac{[value]!}{[value]!([value]-[value])!} \times \left( \dfrac{1}{[value]} \right)^[value] \times \left( \dfrac{[value]}{[value]} \right)^[value] \approx [value] \)

Expectation and variance of the binomial distribution

For a binomial distribution \(X\sim B(n,p)\), the mean and variance, as we shall see, have a simple form. While we will not prove the formulae in general terms - the algebra can be rather tedious - we will illustrate the results for cases involving small values of \(n\).

The case \(\pmb n\pmb =\pmb 2\)

Essentially, we have a random variable \(X\) which follows a binomial distribution \(X\sim B(2,p)\) so that the values taken by \(X\) (and \(X^2\) - needed to calculate the variance) are shown in the following table:

\(x\) | \(x^2\) | \(\text{P} (X=x)\) | \(x\) \(\text{P} (X=x)\) | \(x^2\) \(\text{P} (X=x)\)
0 | 0 | \(q^2\) | 0 | 0
1 | 1 | \(2qp\) | \(2qp\) | \(2qp\)
2 | 4 | \(p^2\) | \(2p^2\) | \(4p^2\)

We can now calculate the mean of this distribution:

\(\text{E}(X) =\sum x\text{P} (X=x)=0+2qp+2p^2=2p(q+p)=2p\qquad \text{since}\ q+p=1\)

Similarly, the variance \(V(X)\) is given by

\( V(X) =\text{E}(X^2)-[\text{E}(X)]^2=0+2qp+4p^2-(2p)^2=2qp\)

Example

Calculate the mean and variance of a random variable \(X\) which follows a binomial distribution \(X\sim B(3,p)\).

Solution

The table of values appropriate to this case is:

\(x\) | \(x^2\) | \(\text{P} (X=x)\) | \(x\text{P} (X=x)\) | \(x^2\text{P} (X=x)\)
\(0\) | \(0\) | \(q^3\) | \(0\) | \(0\)
\(1\) | \(1\) | \(3q^2p\) | \(3q^2p\) | \(3q^2p\)
\(2\) | \(4\) | \(3qp^2\) | \(6qp^2\) | \(12qp^2\)
\(3\) | \(9\) | \(p^3\) | \(3p^3\) | \(9p^3\)

Hence \(\quad \text{E}(X)=\sum x\text{P} (X=x)=0+3q^2p+6qp^2+3p^3=3p(q+p)^2=3p\qquad\text{since } q+p=1\)

\[\begin{aligned} V(X)&=\text{E}(X^2)-[\text{E}(X)]^2\\ &=0+3q^2p+12qp^2+9p^3-(3p)^2\\ &=3p(q^2+4qp+3p^2-3p)\\&=3p((1-p)^2+4(1-p)p+3p^2-3p) \\ &=3p(1-2p+p^2+4p-4p^2+3p^2-3p)=3p(1-p)=3pq\end{aligned}\]

From the results given above, it is reasonable to asert the following result in the Key Point below

Key Point

Expectation and Variance of the Binomial Distribution

If a random variable \(X\) which can assume the values \(0,1,2,3,\dots , n\) follows a binomial distribution \(X\sim B(n,p)\) so that

\(\text{P} (X=r)= \ ^n C_rp^rq^{n-r}= \ ^n C_rp^r(1-p)^{n-r}\)

then the expectation and variance of the distribution are given by the formulae

\(\text{E}(X)=np\qquad \text{and}\qquad V(X)=np(1-p)=npq\)

Exercise

A \([value]\)-faced die is thrown repeatedly [value] times in all. Find:

\(\text{E}(X)=\)

\(V(X)= \)

where \(X\) is the random variable for the number of threes obtained.

Note: Please write your answer up to 2 decimal places, if required.
Feedback: Consider the occurrence of a three, with \(X\) being the number of threes thrown in [value] trials. The random variable \(X\) follows a binomial distribution. (Why? Refer to the beginning of this section for the criteria if necessary). A trial is the operation of throwing a die. A success is the occurrence of a 3 on a particular trial, so \(p=[value]\). We have \(X\sim\text{Binomial}(n=[value],\ p=[value])\) so that \[\text{E}(X)=np=[value]\times [value]= [value] = [value] ~(\text{to 2 d.p.})\] and \[\text{V}(X)=npq=[value]\times [value]\times (1-[value])=[value]=[value] ~ (\text{to 2 d.p.}).\] Hence the standard deviation is \(\sigma(X)=\sqrt{[value]} = [value]\) to 2 d.p. \(\text{E}(X)=[value]\) implies that in [value] throws of a fair [value]-faced die we would expect, on average, to see [value] threes. This makes perfect sense, of course.

Exercise

The probability that a mountain-bike rider travelling along a certain track will have a tyre burst is [value]. Find the probability that among [value] riders:

1. exactly one has a burst tyre:
2. at most three have a burst tyre:
3. two or more have burst tyres:

Note: please round your answer to the nearest \(3\) decimal places.
Feedback: SOLUTION: Binomial distribution \(\text{P} (X=r)=\ ^n\!C_rp^r(1-p)^{n-r}\) where \(p\) is the probability of single `success' which is `tyre burst'. 1. \(\text{P} (X=1)=\ ^{[value]}\!C_1([value])^1([value])^{[value]}=[value]\) 2. \(\begin{aligned} \text{P} (X\le 3)&=\text{P} (X=0)+\text{P} (X=1)+\text{P} (X=2)+\text{P} (X=3)\\ &=([value])^{[value]}+[value]([value])([value])^{[value]} \\ & \qquad+ \frac{[value]\times [value]}{2\times 1}([value])^2([value])^{[value]}\\ &\qquad +\frac{[value]\times [value]\times [value]}{3\times 2\times 1}([value])^3([value])^{[value]} \\ & =[value]\end{aligned}\) 3. \(\begin{aligned} \text{P} (X\ge 2)&=1-\text{P} [(X=0)\cup (X=1)] \\ & = 1-([value])^{[value]}-[value]([value])([value])^{[value]} \\ &= [value]\end{aligned}\)

Exercise

1. A transmission channel transmits zeros and ones in strings of length [value], called ‘words’. Possible distortion may change a one to a zero or vice versa; assume this distortion occurs with probability [value] for each digit, independently. An error-correcting code is employed in the construction of the word such that the receiver can deduce the word correctly if at most one digit is in error. What is the probability the word is decoded incorrectly?
Note: please round your answer to \(4\) decimal places
2. Assume that a word is a sequence of [value] zeros or ones and, as before, the probability of incorrect transmission of a digit is [value]. If the error-correcting code allows correct decoding of the word if no more than two digits are incorrect, compute the probability that the word is decoded correctly.
Note: please round your answer to \(4\) decimal places
Feedback: SOLUTION: 1. \(\text{P}\) (distortion) \(=[value]\) for each digit. This is a binomial situation in which the probability of ‘success’is \(p=[value]\) and there are \(n=[value]\) trials. A word is decoded incorrectly if there are two or more digits in error \[\begin{aligned} \text{P} (X\ge 2)&=1-\text{P} [(X=0)\cup (X=1)]\\ &=1-\ ^[value]\!C_0([value])^[value]-\ ^[value]\!C_1([value])([value])^[value] \\ & =[value]\end{aligned}\] 2. Same as what we did previously, but now with \(n=[value]\). Correct decoding if \(X\le 2\) \[\begin{aligned} \text{P} (X\le 2)&=\text{P} [(X=0)\cup (X=1)\cup (X=2)]\\ &=\ ^[value]\!C_0([value])^[value]+\ ^[value]\!C_1([value])([value])^[value]+\ ^[value]\!C_2([value])^2([value])^[value] \\ & =[value]\end{aligned}\]

Exercise

An examination consists of [value] multi-choice questions, in each of which a candidate has to deduce which one of [value] suggested answers is correct. A completely unprepared student guesses each answer completely randomly. What is the probability that this student gets [value] or more questions correct?

Note: round your answer to 5 decimal places. Include additional zero(s) if your answer is exact with a lower number of decimal places.
Feedback: SOLUTION: Let \(X\) be a random variable ‘number of answers guessed correctly’ then for each question (i.e. trial) the probability of a ‘success’ = \(\dfrac{1}{[value]}\). It is clear that \(X\) follows a binomial distribution with \(n=[value]\) and \(p=[value]\). \(\text{P}\) (randomly choosing correct answer) \(=\dfrac{1}{[value]}\qquad n=[value]\) \[\begin{aligned} \text{P} ([value]\ \text{or more correct})&=\text{P} [(X=[value])\cup (X=[value])\cup (X=[value])]\\ &=\ ^{[value]}\!C_[value]\left(\dfrac{1}{[value]}\right)^[value]\left(\dfrac[value][value]\right)^2+\ ^{[value]}\!C_[value]\left(\dfrac{1}{[value]}\right)^[value]\left(\dfrac{[value]}{[value]}\right)+\ ^{[value]}\!C_{[value]}\left(\dfrac{1}{[value]}\right)^{[value]} \\ & =[value]\end{aligned}\]

Exercise

The probability that a machine will produce all bolts in a production run within specification is [value]. A sample of [value] machines is taken at random. Calculate the probability that

1. all [value] machines will produce all bolts within specification
2. [value] or [value] machines will produce all bolts within specification
3. at least [value] machines will produce all bolts within specification

Note: please round your answer up to \(4\) decimal places, if requred.
Feedback: SOLUTION: As we suspect, this experiment follows a Binomial distribution \(\text{P} (X=r)=\ ^n\!C_rp^r(1-p)^{n-r}\) where \(p\) is the probability of single `success' which is the number of machines that produce all bolts within specification 1. \(\text{P} (X=[value])=\ ^{[value]}\!C_[value]([value])^[value]([value])^0=([value])^[value]=[value]\) 2. \(\begin{aligned} \text{P} [(X=[value])\cup (X=[value])]&=\text{P} (X=[value])+\text{P} (X=[value])\\ &= \ ^{[value]}\!C_[value]([value])^[value]([value]) + [value] \\ &= ([value])\times([value])^[value]([value]) + [value]\\ &=[value]\end{aligned}\) 3. \(\begin{aligned} \text{P} (X\ge [value])=\text{P} [(X=[value])\cup (X=[value])\cup (X=[value])] &= \ ^{[value]}\!C_[value]([value])^[value]([value])^2 + [value] \\ &= [value] \end{aligned}\)

Exercise

The probability that a machine develops a fault within the first 3 years of use is [value]. If [value] machines are selected at random, calculate the probability that [value] or more will not develop any faults within the first 3 years of use.

Note: round your answer up to \(4\) decimal places, if required.
Feedback: SOLUTION: Let \(X\) be a random variable ‘number of machines that will not develop any faults within the first 3 years of use’ then it is clear that \(X\) follows a binomial distribution with \(n=[value]\) and \(p=[value]\). \[\begin{aligned} \text{P} (X \geq [value]) & = \text{P} [(X=[value])\cup (X=[value])\cup (X=[value])] \\ &= \ ^{[value]}\!C_[value]([value])^[value]([value])^2 +\ ^{[value]}\!C_[value]([value])^[value]([value]) +\ ^{[value]}\!C_{[value]}([value])^{[value]} \\ &= [value]\end{aligned}\]

Exercise

A computer installation has [value] terminals. Independently, the probability that any one terminal will require attention during a week is [value]. Find the probabilities that

1. 0 terminals will require attention during the next week:
2. 1 terminal will require attention during the next week:
3. 2 terminals will require attention during the next week:
4. 3 or more terminals will require attention during the next week:

Note: please round your answer to \(4\) decimal places.
Feedback: SOLUTION: As we suspect, this experiment follows a Binomial distribution \(\text{P} (X=r)=\ ^n\!C_rp^r(1-p)^{n-r}\) where \(p\) is the probability that any one terminal will require attention during a week 1. \(\text{P} (X=0)=\ ^{[value]}\!C_0([value])^0(1-[value])^[value]=([value])^[value]=[value]\) 2. \(\text{P} (X=1) =\ ^{[value]}\!C_1([value])^1(1-[value])^[value] = [value]\) 3. \( \text{P} (X=2) =\ ^{[value]}\!C_2([value])^2(1-[value])^[value] = [value]\) 4. \( \text{P} (X\ge 3)= 1 - \text{P}(X=0) - \text{P}(X=1) - \text{P}(X=2) = [value]\)

Exercise

In a large school, [value]% of the pupils like mathematics. A visitor to the school asks each of [value] pupils, chosen at random, whether they like mathematics.

1. Calculate the probabilities of obtaining an answer yes from \(2\) of the pupils
2. Find the probability that the visitor obtains the answer yes from at least \(2\) pupils:
3. Find the probability that the visitor obtains the answer yes from at least \(2\) pupils when the number of pupils questioned is increased to [value]:

Note: please round your answer up to \(4\) decimal places.
Feedback: SOLUTION: If \(X\) is the number of pupils who like maths, then \(X\) follows a binomial distribution with \(p=\dfrac{[value]}{100}\) 1. In this case, \(n=[value]\) so we have that: \(\text{P}(X=2) = \ ^[value]\!C_2 \left( \dfrac{[value]}{100} \right)^2\left(1-\dfrac{[value]}{100}\right)^[value] = [value] \) 2. Again, in this case \(n=[value]\) so we have that: \(\begin{align} \text{P}(X\geq 2) &= 1- \text{P}(X = 0) - \text{P}(X = 1) \\ &= 1 - \ ^[value]\!C_0 \left( \dfrac{[value]}{100} \right)^0\left(1-\dfrac{[value]}{100}\right)^[value] \ ^[value]\!C_1 \left( \dfrac{[value]}{100} \right) \left(1-\dfrac{[value]}{100}\right)^[value] \\ &= [value] \end{align} \). 3. Now, in this case, \(n=[value]\) so we have that: \(\begin{align} \text{P}(X\geq 2) &= 1- \text{P}(X = 0) - \text{P}(X = 1) \\ &= 1 - \ ^[value]\!C_0 \left( \dfrac{[value]}{100} \right)^0\left(1-\dfrac{[value]}{100}\right)^[value] - \ ^[value]\!C_1 \left( \dfrac{[value]}{100} \right) \left(1-\dfrac{[value]}{100}\right)^[value] \\ &= [value] \end{align} \).

Exercise

A machine has two drive belts, one on the left and one on the right. From time to time the drive belts break. When one breaks the machine is stopped and both belts are replaced. Details of \( [value] \) consecutive breakages are recorded. Assume that the left and right belts are equally likely to break first. Let \( X \) be the number of times the break is on the left.

1. How many possible different sequences of “left” and “right” are there?
2. How many of these sequences contain exactly [value] “lefts”?
3. Please fill the following table (Note: round your answer up to \(4\) decimal places).

\(j\) | \(0\) | \(1\) | \(2\) | \(3\)
\(\text{P} (X=j)\) |  |  |  |
Feedback: SOLUTION: 1. In one breakage there are 2 possibilities: the "left" belt or the "right belt", so if there are [value] breakages, there are \(2^[value] = [value]\) possible sequences of "left" and "right" (check the 'Multiplicative Principle'). 2. You should remember combinations and permutations. In particular, If you have [value] recorded breakages and you want to know the number of ways you can register [value] "left" belt broken among the [value] breakages, this follows a combination given by: \( \ ^{[value]}\!C_[value] = [value]\) 3. \(X\) follows a binomial distribution with \(\text{P} (X=r)=\ ^n\!C_rp^r(1-p)^{n-r}\) where \(p\) is the probability of single `success' which is `left belt broken'. Thus, following this formula we have: \(j\) | \(0\) | \(1\) | \(2\) | \(3\) \(\text{P} (X=j)\) | [value] | [value] | [value] | [value]

Exercise

A machine is built to make mass-produced items. Each item made by the machine has a probability \(p\) of being defective. Given the value of \(p,\) the items are independent of each other. Because of the way in which the machines are made, \(p\) could take one of several values. In fact \(p=X/100\) where \(X\) can take any value from \(\{0, 1, 2, 3, 4, 5\}\) with equal probability. The machine is tested by counting the number of items made before a defective is produced. Find the conditional probability distribution of \(X\) given that the first defective item is the number \([value]\) to be made.

Let \(Y\) be the number of the first defective item. Complete fill the following table with the correct answers rounded to 4 decimal places. Use additional zero(s) if your answer is exact to a lower degree of accuracy.

\(j\) | \(\text{P}(X=j | Y=[value])\)
\(0\) |
\(1\) |
\(2\) |
\(3\) |
\(4\) |
\(5\) |
Feedback: SOLUTION: Let \(Y\) be the number of items until the first defective item, so by Bayes' rule: \(\begin{aligned} \text{P}(X=j \mid Y=[value]) &= \dfrac{\text{P}(X=j)\times \text{P}(Y=[value] \mid X=j)}{\sum_{i=0}^{5} \text{P}(X=i)\times \text{P}(Y=[value] \mid X=i)} \\ & = \dfrac{ \text{P}(Y=[value] \mid X=j)}{ \sum_{i=0}^{5} \text{P}(Y=[value] \mid X=i)} \end{aligned}\) since \( \text{P}(X=j) =1/6 \) for \( j=0, \ldots , 5. \) If \(Y\) is the number of items until the first defective item, then the sequence of events must be \(1\)st good, \(2\)nd good, ..., [value]th good and then [value]th defective. Since the probability of defective is \( p = X/100\) and as the items are independent, it follows that: \(\text{P}(Y=[value] \mid X=j) = \left(1- \frac{j}{100} \right)^{[value]} \left(\frac{j}{100} \right) \) With the latter, we can fill the table as follows: \(j\) | \(\text{P}(X=j | Y=[value])\) \(0\) | [value] \(1\) | [value] \(2\) | [value] \(3\) | [value] \(4\) | [value] \(5\) | [value]

Exercise

Seven batches of articles are manufactured. Each batch contains [value] articles. Each article has, independently, a probability of [value] of being defective. Find the probability that there is at least one defective article:

1. In exactly 4 of the batches
2. In 4 or more of the batches

Note: round your answer up to \(4\) decimal places.
Feedback: SOLUTION: First, let's compute the probability of having at least 1 defective article on each batch: Let \(Z\) be the number of defective articles in a batch, this follows a binomial distribution with \(n=[value]\) and \(p = [value] \) \(\begin{align} \text{P}(Z \geq 1) & = 1 - \text{P}(Z < 1) = 1 - \text{P}(Z=0) \\ & = 1 - \ ^[value]\!C_0p^0(1-p)^{[value]} = 1 - (1 - [value])^{[value]} \approx [value] \end{align} \) With the latter result, we can compute now what the exercise is asking us. Let \(X\) be the number of batches with at least one defective article, so \(X\) follows a binomial distribution with \(n = 7\) and \(p = [value]\): 1. \(\text{P} (X=4) = \ ^7\!C_4([value])^4(1-{[value]})^3 = [value] \) 2. \(\begin{align} \text{P} (X\geq 4) = & \ ^7\!C_4([value])^4(1-{[value]})^3 + ^7\!C_5([value])^5(1-{[value]})^2 \\ & + ^7\!C_6([value])^6(1-{[value]}) + ^7\!C_7([value])^7 = [value] \end{align} \)

Exercise

A service engineer can be called out for maintenance on the photocopiers in the offices of four large companies, A, B, C and D. On any given week there is a probability of [value] that he will be called to each of these companies. The event of being called to one company is independent of whether or not he is called to any of the others.

Find the probability that, on a particular day:

1. he is called to all four companies:
2. he is called to at least three companies:

Finally, find the expected value:  and variance:  of the number of these companies which call the engineer on a given day.

Note: please round your answers to \(4\) decimal places.
Feedback: SOLUTION: Let \( Y \) be the number of companies to which the engineer is called and let \( A \) denote the event that the engineer is called to company A. 1. \(\text{P}(Y=4) = [value]^{4} = [value] \) 2. \(\text{P}(Y \geq 3) = \left( \begin{array}{c} 4 \\ 3 \end{array} \right) \times [value]^{3} \times [value]^{1} + [value]^{4} = [value] \) Finally, if you remember the formulas given in a previous Key point, the mean is \( \text{E}(Y) = np = 4 \times [value] = [value]. \) The variance is \( V(Y) = np(1-p) = 4 \times [value] \times [value] = [value] \)

Exercise

There are five machines in a factory. Of these machines, three are working properly and two are defective. Machines which are working properly produce articles each of which has independently a probability of [value] of being imperfect. For the defective machines, this probability is [value]. A machine is chosen at random and [value] articles produced by the machine are examined. What is the probability that the machine chosen is defective given that, of the [value] articles examined, [value] are imperfect and [value] are perfect?

Note: please round your answer up to 5 decimal places
Feedback: Let \(D\) denote the event that the chosen machine is defective and \(\bar{D}\) denote the event “not \(D\)”. Let \(Y\) be the number of imperfect articles in the sample of five. Then \(\begin{aligned} \text{P}(D \mid Y=[value]) & = \dfrac{ \text{P}(D)\times \text{P}(Y=[value] \mid D)}{ \text{P}(D)\times \text{P}(Y=[value] \mid D) + \text{P}(\bar{D})\times \text{P}(Y=[value] \mid \bar{D})} \\ & = \dfrac{ \dfrac{2}{5} \times \left( \begin{array}{c} [value] \\ [value] \end{array} \right) \times [value]^{[value]} \times [value]^{[value]}}{ \frac{2}{5} \times \left( \begin{array}{c} [value] \\ [value] \end{array} \right) \times [value]^{[value]} \times [value]^{[value]} + \dfrac{3}{5} \times \left( \begin{array}{c} [value] \\ [value] \end{array} \right) [value]^{[value]} \times [value]^{[value]}} \\ & = \dfrac{[value]}{[value] + [value]} = [value].\end{aligned}\)

Exercise

A company buys mass-produced articles from a supplier. Each article has a probability \(p\) of being defective, independently of other articles. If the articles are manufactured correctly then \(p=[value].\) However, a cheaper method of manufacture can be used and this results in \(p=[value].\)

1. Find the probability of observing exactly [value] defectives in a sample of twenty articles given that \(p=[value]\)
2. Find the probability of observing exactly [value] defectives in a sample of twenty articles given that \(p=[value]\)
3. The articles are made in large batches. Unfortunately, batches made by both methods are stored together and are indistinguishable until tested, although all of the articles in any one batch will be made by the same method. Suppose that a batch delivered to the company has a probability of [value] of being made by the correct method. Find the conditional probability that such a batch is correctly manufactured given that, in a sample of twenty articles from the batch, there are exactly [value] defectives.

Note: please round your answers up to 5 decimal places
Feedback: Solution Let \(Y\) be the number of defective articles found in a sample of twenty articles. Let \(D\) denote the event that the batch is not correctly manufactured (using the cheaper method of manufacture) and let \(\bar{D}\) denote the event ``not \( D\)'' (the batch is correctly manufactured) 1. \(\text{P} (Y=[value]) = \left( \begin{array}{c} 20 \\ [value] \end{array} \right) \times [value]^{[value]} \times [value]^{[value]} = [value]\) 2. \(\text{P} (Y=[value]) = \left( \begin{array}{c} 20 \\ [value] \end{array} \right) \times [value]^{[value]} \times [value]^{[value]} = [value]\) 3. \(\begin{aligned} \text{P}(\bar{D} \mid Y=[value]) & = \dfrac{ \text{P}(\bar{D})\times \text{P}(Y=[value] \mid \bar{D})}{ \text{P}(\bar{D})\times \text{P}(Y=[value] \mid \bar{D}) + \text{P}(D)\times \text{P}(Y=[value] \mid D)} \\ & = \dfrac{ [value] \times \left( \begin{array}{c} 20 \\ [value] \end{array} \right) \times [value]^{[value]} \times [value]^{[value]}}{ [value] \times \left( \begin{array}{c} 20 \\ [value] \end{array} \right) \times [value]^{[value]} \times [value]^{[value]} + [value] \times \left( \begin{array}{c} 20 \\ [value] \end{array} \right) \times [value]^{[value]} \times [value]^{[value]}} \\ & = \dfrac{[value]}{[value] + [value]} = [value].\end{aligned}\)

Exercise

A service engineer can be called out for maintenance on the photocopiers in the offices of four large companies, A, B, C and D. On any given week there is a probability of [value] that he will be called to each of these companies. The event of being called to one company is independent of whether or not he is called to any of the others.

Find the probability that, on a particular day:

1. he is called to all four companies:
2. he is called to at least three companies:
3. he is called to all four given that he is called to at least one:
4. he is called to all four given that he is called to Company A:

Finally, find the expected value:  and variance:  of the number of these companies which call the engineer on a given day.

Note: please round your answers up to 4 decimal places.
Feedback: SOLUTION: Let \( Y \) be the number of companies to which the engineer is called and let \( A \) denote the event that the engineer is called to company A. 1. \(\text{P}(Y=4) = [value]^{4} = [value] \) 2. \(\text{P}(Y \geq 3) = \left( \begin{array}{c} 4 \\ 3 \end{array} \right) \times [value]^{3} \times [value]^{1} + [value]^{4} = [value] \) 3. \( \begin{align} \text{P}(Y=4 \mid Y \geq 1) &= \dfrac{\text{P}(Y=4 \cap Y \geq 1)}{\text{P}(Y \geq 1)} = \dfrac{\text{P}(Y=4)}{ 1 - \text{P}(Y < 1)} \\ & = \dfrac{[value]}{1-[value]^4} = \dfrac{[value]}{[value]} = [value]. \end{align} \) 4. \( \text{P}(Y=4 \mid A)= \dfrac{\text{P}(Y=4 \cap A)}{\text{P}(A)} = \dfrac{\text{P}(Y=4)}{\text{P}(A)} = \frac{[value]}{[value]} = [value]. \) Finally, if you remember the formulas given in a previous Key point, the mean is \( \text{E}(Y) = np = 4 \times [value] = [value]. \) The variance is \( V(Y) = np(1-p) = 4 \times [value] \times [value] = [value] \)