Probability Rules & Bayes' Theorem
Statistics, Probability
Intro: Applies basic probability rules and Bayes' theorem to compute P(A ∪ B), P(A ∩ B), P(A|B), or P(A|B) via Bayes, with full algebra.
Worked example
- Disease prevalence P(D)=0.01. Test sensitivity P(+|D)=0.95, false positive rate P(+|¬D)=0.02. Find P(D|+).
- We want $P(D\mid +)$, the probability of having the disease given a positive test.
- Bayes' theorem states $P(D\mid +)=\dfrac{P(+\mid D)P(D)}{P(+)}$.
- We know $P(D)=0.01$, $P(+\mid D)=0.95$, and $P(+\mid \neg D)=0.02$.
- First compute $P(\neg D)=1-P(D)=1-0.01=0.99$.
- Total probability of a positive test is $P(+)=P(+\mid D)P(D)+P(+\mid \neg D)P(\neg D)$.
- Substitute: $P(+)=0.95\cdot0.01 + 0.02\cdot0.99 = 0.0095 + 0.0198 = 0.0293$.
- Now apply Bayes: $P(D\mid +)=\dfrac{0.95\cdot0.01}{0.0293} = \dfrac{0.0095}{0.0293}$.
- Compute the division: $0.0095/0.0293 \approx 0.3246$ (about 32.5%).
- Answer: $\boxed{P(D\mid +) \approx 0.325}$, so even after a positive test the chance of disease is about 32.5%.
FAQs
Can this handle more than two events?
This tool focuses on two-event problems and Bayes with two hypotheses. Multi-hypothesis Bayes can be handled by repeating the formula with more terms in P(B).
Why choose MathGPT?
- Get clear, step-by-step solutions that explain the “why,” not just the answer.
- See the rules used at each step (power, product, quotient, chain, and more).
- Optional animated walk-throughs to make tricky ideas click faster.
- Clean LaTeX rendering for notes, homework, and study guides.
How this calculator works
- Type or paste your function (LaTeX like
\sin,\lnworks too). - Press Generate a practice question button to generate the derivative and the full reasoning.
- Review each step to understand which rule was applied and why.
- Practice with similar problems to lock in the method.