SOLUTION: Suppose that a well-mixed urn contains 100 red and blue balls, in unknown proportion. Suppose you know that there are either 80 red balls or 20 red balls. You initially judge eac

Algebra ->  Probability-and-statistics -> SOLUTION: Suppose that a well-mixed urn contains 100 red and blue balls, in unknown proportion. Suppose you know that there are either 80 red balls or 20 red balls. You initially judge eac      Log On


   



Question 1160757: Suppose that a well-mixed urn contains 100 red and blue balls, in unknown
proportion. Suppose you know that there are either 80 red balls or 20 red balls.
You initially judge each of these possibilities to be equally likely and always
update your probabilities via Conditionalization when learning propositional
evidence.
1. If one ball is drawn at random and seen to be red, what is your new
probability that the urn contains 80 red balls?
2. If 5 balls are drawn randomly (with replacement) and each is seen to be
red, what is the new probability that the urn contains 80 red balls?
3. Now suppose you can tell the 5 balls drawn are all of the same color
and that you think the color is probably red but (due to the lighting)
can’t be sure. Your probability that they are all red goes to 90% while
the probability that they are all blue does to 10%. What is your new
probability that urn contains 80 red balls?

Answer by CPhill(2303) About Me  (Show Source):
You can put this solution on YOUR website!
```python
# Question 1:
# One ball drawn at random and seen to be red (E1).
# P(E1 | H1) = 80/100 = 0.8
# P(E1 | H2) = 20/100 = 0.2
# P(H1 | E1) = (0.8 * 0.5) / (0.8 * 0.5 + 0.2 * 0.5) = 0.8 / (0.8 + 0.2) = 0.8
p1 = 0.8 / (0.8 + 0.2)
print(f"Q1: {p1}")
# Question 2:
# 5 balls drawn with replacement, all 5 red (E2).
# P(E2 | H1) = (0.8)^5
# P(E2 | H2) = (0.2)^5
p2 = (0.8**5 * 0.5) / (0.8**5 * 0.5 + 0.2**5 * 0.5)
# (0.8/0.2)^5 = 4^5 = 1024
# p2 = 1024 / (1024 + 1) = 1024 / 1025
print(f"Q2: {p2:.6f}, {1024}/1025 = {1024/1025}")
# Question 3:
# "Now suppose you can tell the 5 balls drawn are all of the same color and that you think the color is probably red but (due to the lighting) can't be sure.
# Your probability that they are all red goes to 90% while the probability that they are all blue does to 10%.
# What is your new probability that urn contains 80 red balls?"
# This is Jeffrey Conditionalization!
# In formal epistemology:
# The partition of evidence is:
# E_R: all 5 are red
# E_B: all 5 are blue
# New probabilities over partition: P_new(E_R) = 0.9, P_new(E_B) = 0.1.
# By Jeffrey's rule:
# P_new(H1) = P(H1 | E_R) * P_new(E_R) + P(H1 | E_B) * P_new(E_B)
# Let's check P(H1 | E_R) and P(H1 | E_B).
# P(H1 | E_R): from Q2, it's 1024 / 1025.
# For E_B: all 5 balls are blue.
# P(E_B | H1) = (0.2)^5
# P(E_B | H2) = (0.8)^5
# By symmetry, P(H1 | E_B) = (0.2)^5 / ((0.2)^5 + (0.8)^5) = 1 / (1 + 1024) = 1 / 1025.
# Then by Jeffrey's rule:
# P_new(H1) = (1024 / 1025) * 0.9 + (1 / 1025) * 0.1
# = (1024 * 0.9 + 1 * 0.1) / 1025
# = (921.6 + 0.1) / 1025 = 921.7 / 1025 = 9217 / 10250.
p_H1_ER = 1024 / 1025
p_H1_EB = 1 / 1025
p3 = p_H1_ER * 0.9 + p_H1_EB * 0.1
print(f"Q3 (Jeffrey): {p3:.6f}, {9217}/{10250} = {9217/10250}")

```
```text
Q1: 0.8
Q2: 0.999024, 1024/1025 = 0.9990243902439024
Q3 (Jeffrey): 0.899220, 9217/10250 = 0.899219512195122

```
Let the two hypotheses about the composition of the urn be:
* $H_1$: The urn contains **80 red balls** and **20 blue balls** (probability of drawing red is $p = 0.8$, blue is $1 - p = 0.2$).
* $H_2$: The urn contains **20 red balls** and **80 blue balls** (probability of drawing red is $p = 0.2$, blue is $1 - p = 0.8$).
The prior probabilities are equal:

$$P(H_1) = 0.5, \quad P(H_2) = 0.5$$
---
### 1. One ball is drawn and seen to be red ($R_1$)
By Bayes' Theorem:
$$P(H_1 \mid R_1) = \frac{P(R_1 \mid H_1) P(H_1)}{P(R_1 \mid H_1) P(H_1) + P(R_1 \mid H_2) P(H_2)}$$
* $P(R_1 \mid H_1) = \frac{80}{100} = 0.8$
* $P(R_1 \mid H_2) = \frac{20}{100} = 0.2$
$$P(H_1 \mid R_1) = \frac{0.8 \times 0.5}{(0.8 \times 0.5) + (0.2 \times 0.5)} = \frac{0.4}{0.4 + 0.1} = \frac{0.4}{0.5} = \mathbf{0.8} \quad (80\%)$$
---
### 2. Five balls drawn with replacement are all red ($R^5$)
Since draws are made with replacement, the draws are independent conditional on the urn's composition:
* $P(R^5 \mid H_1) = (0.8)^5 = 0.32768$
* $P(R^5 \mid H_2) = (0.2)^5 = 0.00032$
Applying Bayes' Theorem:
$$P(H_1 \mid R^5) = \frac{P(R^5 \mid H_1) P(H_1)}{P(R^5 \mid H_1) P(H_1) + P(R^5 \mid H_2) P(H_2)}$$
Since $P(H_1) = P(H_2)$, the prior factors cancel:
$$P(H_1 \mid R^5) = \frac{(0.8)^5}{(0.8)^5 + (0.2)^5} = \frac{\left(\frac{0.8}{0.2}\right)^5}{\left(\frac{0.8}{0.2}\right)^5 + 1} = \frac{4^5}{4^5 + 1} = \frac{1024}{1025} \approx \mathbf{0.99902} \quad (\approx 99.90\%)$$
---
### 3. Five monochromatic balls with uncertain color
Because you receive uncertain observational evidence that alters your credences over a partition of propositions rather than providing a single certain proposition, this update is evaluated via **Jeffrey Conditionalization** (probability kinematics).
The partition consists of two mutually exclusive and exhaustive possibilities for the sample:
* $E_R$: All 5 balls are red.
* $E_B$: All 5 balls are blue.
Your updated credences directly on this partition are:
* $P_{\text{new}}(E_R) = 0.90$
* $P_{\text{new}}(E_B) = 0.10$
By symmetry between red and blue:
* $P(H_1 \mid E_R) = \frac{1024}{1025}$ (from part 2)
* $P(H_1 \mid E_B) = \frac{(0.2)^5}{(0.2)^5 + (0.8)^5} = \frac{1}{1025}$
According to Jeffrey's Rule:
$$P_{\text{new}}(H_1) = P(H_1 \mid E_R) \cdot P_{\text{new}}(E_R) + P(H_1 \mid E_B) \cdot P_{\text{new}}(E_B)$$
$$P_{\text{new}}(H_1) = \left(\frac{1024}{1025}\right)(0.9) + \left(\frac{1}{1025}\right)(0.1)$$
$$P_{\text{new}}(H_1) = \frac{921.6 + 0.1}{1025} = \frac{921.7}{1025} = \frac{9217}{10250} \approx \mathbf{0.89922} \quad (\approx 89.92\%)$$