# Introduction

In what follows a full written solution is provided to the problem that was discussed in the video. For the remainder of the problems only the final solution is given.

# Example problems

Click on the problems to reveal the solution

#### Consider a test to detect a disease that 0.1 % of the population have. The test is 99 % effective in detecting an infected person. However, the test gives a false positive result in 0.5 % of cases. If a person tests positive for the disease what is the probability that they actually have it?

The first step in solving this problem is to recognize what we are trying to calculate and what quantities we have been given in the question. We can introduce a Bernoulli random variable and say that $D=1$ when the person has the disease. We can then introduce a second Bernoulli random variable $T$ and say that $T=1$ when a person gets a positive test result. We then note that these two random variables are not independent. With these symbols in place we can now state clearly what it we are trying to calculate. We are trying to calculate the conditional probability $P(D=1|T=1)$. In addition, the question tells us that: $$P(D=1)=0.001 \qquad \qquad P(T=1|D=1)=0.990 \qquad \qquad P(T=1|D=0)=0.005$$ From these quantities we can the probability of getting a positive test result, $P(T=1)$ using the partition theorem as shown below: $$P(T=1) = P(T=1|D=1)P(D=1) + P(T=1|D=0)P(D=0) = P(T=1|D=1)P(D=1) + P(T=1|D=0)[1-P(D=1)] = 0.99 \times 0.1 + 0.005 \times ( 1 - 0.001 ) = 0.005985$$ We can now insert this result into Bayes theorem to get the desired conditional probability. $$P(D=1|T=1) = \frac{P(T=1|D=1)P(D=1)}{P(T=1)} = \frac{0.99 \times 0.001}{0.005985} \approx 0.165$$

#### Two production lines produce the same part. Line 1 produces 1,000 parts per week of which 100 are defective. Line 2 produces 2,000 parts per week of which 150 are defective. If you choose a part randomly from the stock what is the probability it is defective? If it is defective what is the probability it was produced by line 1?

$$P(L_1|D) = \frac{2}{5}$$

#### Marie is getting married tomorrow, at an outdoor ceremony in the desert. In recent years, it has rained only 5 days each year. Unfortunately, the weatherman has predicted rain for tomorrow. When it actually rains, the weatherman correctly forecasts rain 90 % of the time. When it doesn’t rain, he incorrectly forecasts rain 10 % of the time. What is the probability that it will rain on the day of Marie’s wedding? (Assume that there are no leap years)

$$P(R|F) \approx 0.1111$$

#### You are selling a product in an area where 30 % of the people live in the city and the rest live in the suburbs. Currently 20 % of the city dwellers user your product and 10 % of the suburbanites use your product. You are presented with two new sales strategies the first will increase your market share in the suburbs to 15 %. The second will increase your market share in the city to 25 %. Which strategy should you adopt? What percentage of the people who own your product are city dwellers before your new sales drive?

Strategy 1 is better sand before the new sales drive $\frac{6}{13}$ of the people who are the product are city dwellers

#### In a casino in Blackpool there are two slot machines: one that pays out 10 % of the time, and one that pays out 20 % of the time. Obviously, you would like to play on the machine that pays out 20 % of the time but you do not know which of the two machines is the more generous. You thus adopt the following strategy: you assume initially that the two machines are equally likely to be the generous machine. You then select one of the two machines at random and put a coin into it. Given that you loose that first bet estimate the probability that the machine you selected is the more generous of the two machines.

The probability that you are on the more generous machine given you loose the first game is 0.471

### Contact Details

School of Mathematics and Physics,
Queen's University Belfast,
Belfast,
BT7 1NN

Email: g.tribello@qub.ac.uk
Website: mywebsite