Homework 3

CHE 116: Numerical Methods and Statistics

2/1/2018


1. Manipulating Probability Expression (12 Points)

Simplify the following probability expressions if possible. Some may be as simple as possible. Recall that $P(x)$ is shorthand for $P(X = x)$.

  1. $$\sum_y P(y)$$
  2. $$\sum_x P(x\,|\,y)$$
  3. $$\sum_y P(x\,|\,y)$$
  4. $$\sum_x P(x,y)$$
  5. $$P(x | y)P(y)$$
  6. $$\frac{P(x\,|\, y) P(y)}{P(x)}$$
  7. $$\sum_x P(y \, |\, x)P(x)$$

1.1

$$ 1 $$

1.2

$$ 1 $$

1.3

$$\sum_y P(x\,|\,y)$$

1.4

$$ P(y) $$

1.5

$$ P(x, y) $$

1.6

$$ P(y\, |\, x) $$

1.7

$$ P(y) $$

2. Combinatorial Questions (16 Points)

Answer these symbolically

  1. [2 points] There are three people assigning five rooms in a house. How many room assignments are possible?
  2. [2 points] Students are handing in their homework in a pile. If there are 8 students, how many possible configurations of the pile are there?
  3. [2 points] You arrange 5 US currency notes in a row. US currency can be \$1, \$5, \$10, \$20, and \$100. How many possible arrangements are possible?
  4. [2 points] You have a pendant molecule which has three distinguishable sites which can be decorated with a functional group. Assume that all sites are decorated. If you have 8 possible functional groups, how many unique molecules can you synthesize? You can use as many functional groups simultaneously as you want.
  5. [8 points] If you allow sites to be unreacted, so that you can have the pendant molecule with only 1 or 2 or 0 functional groups in addition to 3, how many unique molecules can you synthesize?

2.1

$$ \frac{5!}{2!} = 15 $$

2.2

$$ 8! = 40320 $$

2.3

$$ 5^5 = 3125 $$

2.4

$$ 8^3 $$

2.5

$$ 8^3 + 8^2\times\frac{3!}{2!(3 - 2)!} + 8^1 \times \frac{3!}{1!(3 - 1)!} + 8^0 \times \frac{3!}{0!(3 - 0)!} = 728 $$

3. Loaded Die Problem (24 Points)

Answer these symbolically

Let us continue our loaded die problem from unit 2, lecture 2. There are two possible dice being used. One is fair and one is unfair. Take $D = 0$ to indicate the fair die and $D = 1$ to indicate the unfair die. The unfair die has a probability of 90\% of being chosen. The probability of a roll with the unfair die is $x / 21$, where $x$ is the value of the role. Answer the following questions symbolically. $X_i$ indicates the value of the roll on attempt $i$. The rolls are conditionally independent on the identity of the die.

  1. [4 points] Compute $P(X_0 = 3)$?

  2. [4 points] Compute $P(X_0, X_1 \, | \, D = 0)$?

  3. [2 points] Compute $P(D = 0, D = 1)$?

  4. [4 points] Compute $P(X_1 = 2,\, X_0 = 4)$?

  5. [2 points] Describe in words what the following expression means: $$ \frac{P(X_1 = 6 \,|\, X_0 = 6)}{P(X_0 = 6)} $$

  6. [8 points] Calculate the above quantity and summarize in words what it means.

3.1

$$ P(X_0 = 3) = \sum_{D = d}P(X_0 = 3\,|\,D = d)P(D = d) = P(X_0 = 3\,|\,D = 0)P(D = 0) + P(X_0 = 3\,|\,D = 1)P(D = 1) $$$$ P(X_0 = 3) = \frac{1}{6} \frac{1}{10} + \frac{3}{21}\frac{9}{10} \approx 0.145 $$

3.2

$$ P(X_0,X_1\,|\,D = 0) = P(X_0\,|\,D = 0) P(X_1\,|\,D = 0) = \frac{1}{6}\times\frac{1}{6} = \frac{1}{36} $$

3.3

$$ 0 $$

3.4

$$ P(X_1 = 2, X_0 = 4) = \sum_{D=d} P(X_1 = 2, X_0 = 4\,|\,D = d)P(D = d) = \sum_{D=d} P(X_1 = 2\,|\,D = d) P(X_0 = 4\,|\,D = d)P(D = d) $$$$ P(X_1 = 2, X_0 = 4) = \frac{1}{6}\frac{1}{6}\frac{1}{10} + \frac{2}{21}\frac{4}{21}\frac{9}{10} \approx 0.0191 $$

3.5

This is relative probability of rolling a six given you've rolled a six relative to rolling a six. It is an odds ratio, although this word need not be there to be marked correct.

3.6

$$ P(X_0 = 6) = \frac{1}{6} \frac{1}{10} + \frac{6}{21}\frac{9}{10} \approx 0.274 $$$$ P(X_1 = 6\, |\, X_0 = 6) = \frac{P(X_1 = 6, X_0 = 6)}{P(X_0 = 6} $$$$ P(X_1 = 6\, X_0 = 6) = \sum_{D=d} P(X_1 = 6, X_0 = 6\,|\,D = d)P(D = d) = \frac{1}{6}\frac{1}{6}\frac{1}{10} + \frac{6}{21}\frac{6}{21}\frac{9}{10} \approx 0.0762 $$$$ \frac{P(X_1 = 6 \,|\, X_0 = 6)}{P(X_0 = 6)} = \frac{P(X_1 = 6, X_0 = 6)}{P(X_0 = 6)P(X_0 = 6)} = \frac{0.0762}{0.274\times0.274} = 1.015 $$

It is 1% more likely to get a 6 on your second roll than if your first roll was a six.

4. False Positives (28 Points)

Answer Symbolically

One of the most famous applications of conditional probabilities is in medical tests. Consider a medical test for HIV. The test as a false positive rate of 2%. That means it indicates that someone has HIV when they do not. HIV has a false negative rate of 1%. That means the test indicates someone does not have HIV when in fact they do. The incidence rate of HIV is 0.3% in the US. Using this information, answer the following questions:

  1. [2 points] Write out the definition of a false negative and false positive using probability expressions.

  2. [2 points] Ignoring ethical concerns, if we randomly select someone, what is the probability that they have HIV?

  3. [6 points] If we randomly test someone for HIV, what is the probability that our test will show that they have HIV?

  4. [8 points] If a positive test indicates the presence of HIV, what is the probability that person has HIV? Is this surprising?

  5. [10 points] Assume each test is conditionally independent on whether or not the person has HIV. What is the probability that someone has HIV after two positive tests? The probabilities for false negative and positive are the same for the two tests.

4.1

I will use $H$ to indicate HIV and $T$ to indicate test result.

  • False Positive: $P(T = 1 \,|\, H = 0)$
  • False Negative: $P(T = 0 \,|\, H = 1)$

4.2

$P(H = 1) = 0.003$

4.3

$$ P(T = 1) = \sum_{H=h} P(T = 1 \,|\, H = h) P(H = h) = $$$$ P(T = 1) = P(T = 1 \,|\, H = 0)\, P(H = 0) + P(T = 1 \,|\, H = 1)\, P(H = 1) $$$$ P(T = 1) = P(T = 1 \,|\, H = 0) \left[1 - P(H = 1)\right] + \left[1 - P(T = 0 \,|\, H = 1)\right] P(H = 1) = 0.02 \times (1 - 0.003) + (1 - 0.01) \times 0.003 = 0.02291 $$

4.4

$$ P(H = 1 \, | \, T = 1) = \frac{P(T = 1\, |\, H = 1) P(H = 1)}{P(T = 1)} = \frac{\left[1 - P(T = 0\, |\, H = 1)\right] P(H = 1)}{P(T = 1)} $$$$ P(H = 1 \, | \, T = 1) = \frac{ (1 - 0.01)\times 0.003}{0.02291} \approx 0.127 $$

4.5

$$ P(H = 1 \, | \, T_1 = 1, T_0 = 1) = \frac{P(T_1 = 1, T_0 = 1\, |\, H = 1) \,P(H = 1)}{P(T_1 = 1, T_0 = 1)} $$$$ P(H = 1 \, | \, T_1 = 1, T_0 = 1) = \frac{P(T_0 = 1\,|\, H = 1) P( T_1 = 1\, |\, H = 1) \,P(H = 1)}{P(T_1 = 1, T_0 = 1)} $$$$ P(H = 1 \, | \, T_1 = 1, T_0 = 1) = \frac{ \left[1 - P(T = 0\, | \, H = 1)\right]^2 \,P(H = 1)}{P(T_1 = 1, T_0 = 1)} $$$$ P(T_1 = 1, T_0 = 1) = \sum_{H=h} P(T_1 = 1\, T_0 = 1 \,|\, H = h)\, P(H = h) = \sum_{H=h} P(T_1 = 1\,|\,H = h)\,P(T_0 = 1 \,|\, H = h)\, P(H = h) $$$$ P(T_1 = 1, T_0 = 1) = \sum_{H=h} P(T_1, = 1\,|\,H = h)^2 P(H = h) = P(T = 1 \,|\, H = 0)^2 \left[1 - P(H = 1)\right] + \left[1 - P(T = 0 \,|\, H = 1)\right]^2 P(H = 1) $$$$ P(T_1 = 1, T_0 = 1) = 0.02^2 \times (1 - 0.003) + (1 - 0.01)^2 \times 0.003 \approx 0.00334 $$$$ P(H = 1 \, | \, T_1 = 1, T_0 = 1) = \frac{\left(1 - 0.01\right)^2 \times 0.003}{0.00334} \approx 0.88 $$

In [ ]: