Two Sources: Total Probability and Bayes
Two Sources: Total Probability and Bayes
Use two mutually exclusive, exhaustive sources to find an event probability and the reverse conditional probability.
- 112 bytes
- COMP mode
Worked examples
Example 1
Two exclusive and exhaustive sources H1,H2 produce an event E. The probabilities are given below. Find P(E) and P(H1|E). Give exact fractions and decimals to four places. P(H1)=2/5; P(E|H1)=3/4; P(E|H2)=1/4.
Answer
Standard solution (without a calculator)
- Build the mathematical model and substitute the data.
- P(H2)=1−2/5=3/5
- P(E)=(2/5)(3/4)+(3/5)(1/4)=9/20
- P(H1|E)=(2/5)(3/4)/(9/20)=2/3
- Combine the preceding results to obtain the answer.
Example 2
Two exclusive and exhaustive sources H1,H2 produce an event E. The probabilities are given below. Find P(E) and P(H1|E). Give exact fractions and decimals to four places. P(H1)=3/10; P(E|H1)=1/5; P(E|H2)=1/10.
Answer
Standard solution (without a calculator)
- Build the mathematical model and substitute the data.
- P(H2)=1−3/10=7/10
- P(E)=(3/10)(1/5)+(7/10)(1/10)=13/100
- P(H1|E)=(3/10)(1/5)/(13/100)=6/13
- Combine the preceding results to obtain the answer.
Example 3
Two exclusive and exhaustive sources H1,H2 produce an event E. The probabilities are given below. Find P(E) and P(H1|E). Give exact fractions and decimals to four places. P(H1)=13/20; P(E|H1)=0; P(E|H2)=4/5.
Answer
Standard solution (without a calculator)
- Build the mathematical model and substitute the data.
- P(H2)=1−13/20=7/20
- P(E)=(13/20)(0)+(7/20)(4/5)=7/25
- P(H1|E)=(13/20)(0)/(7/25)=0
- Combine the preceding results to obtain the answer.
When to use it
Use two mutually exclusive, exhaustive sources to find an event probability and the reverse conditional probability.
Input order
- A=P(H1)
- B=P(E|H1)
- C=P(E|H2)
- Enter every required value, including 0; blank EXE is not zero. Read each result in order; an error code is not a probability.
Output order
- P(E)
- P(H1|E)
- Record the value and press EXE.
- The program has ended. Press AC to leave; EXE runs it again.
Conditions and limitations
- 0<A<1; 0≤B≤1; 0≤C≤1
- P(E)=0 ⇒ (0,−8)
- A,B,C←−1
- The sources must cover the whole population without overlap. Derive the three input probabilities before running the program.
- Invalid or blank input gives −9. If P(E)=0, the first output is 0 and the second is −8 because the conditional probability is undefined.
- The angle unit does not affect these calculations; the illustrated runs use Deg.
- All used registers and Ans may be overwritten. Enter every required value again for each run.
- Finite precision can lose small differences between large numbers or probabilities extremely near 0 or 1. An error marker is never a valid answer.
Checking access…