I assume Baye's Theorem is expressed as either:
$P(B|A) = \frac{P(A|B)*P(B)}{P(A)}$
or
$P(A|B) = \frac{P(A) * P(B|A)}{((P(A) * P(B|A)) + (P(A') * P(B|A'))}$
The tutorial problem was:
Assume ten children have the following ages (years) and heights (inches):
I interpreted events A and B as:
P(A): Age x = 9 yr., 4/10
P(B): Height y = 49 in., 3/10
P(B|A): 3/4
The probability of a child being nine years old and exactly forty-nine inches tall is three out of ten. When I use the cumulative probabilities in Baye's Theorem, the result is 0.4 or 0.3999... I have to add one to the number of children 49 inches tall and nine years old to make the result 0.3. When I use the correct probabilities, I get 1. Did I misinterpret the results of the correct formula? Maybe Baye's Theorem is saying that all children 49 inches tall are nine-year-olds. Maybe Baye's Theorem is not the right theorem to use in estimating the probability of getting a nine-year-old who is forty-nine inches tall, $P(A ∩ B)$. I think that is a joint distribution. Is Baye's Theorem referring to a conditional distribution, where I have to assume a "prior" event?
Given $P(A|B) = \frac{P(A)*P(B|A)}{P(B)}$:
# Formula using the wrong probabilities.
print(f'P(A|B) = {((4/10)*(3/10))/(3/10)}')
print(f'P(A|B) = {((4/10)*(3/10))/((4/10)*(3/4)+((6/10)*(0/6)))}')
# Output: 0.4, 0.3999...
# Formula with P(B)+1 to force the known correct answer.
print(f'P(B) + 1, P(A|B) = {((4/10)*(3/4 * 4/10))/ ( (3+1) /10)}')
print(f'P(B|A\') + 1, P(A|B) = {((4/10)*(3/10))/(( (3+1) /10)*(3/4)+((6/10)*(1/6)))}')
# Output: 0.3, 0.3
# Formula for what I thought was the correct interpretation.
print(f'P(A|B) = {((4/10)*(3/4))/(3/10)}')
print(f'P(A|B) = {((4/10)*(3/4))/((4/10)*(3/4)+((6/10)*(0/6)))}')
# Output: 1.000...2, 1