Conditional Probability Calculator

Calculate conditional probability P(A|B) using Bayes' theorem and probability rules

Calculate Conditional Probability

Enter value between 0 and 1 (e.g., 0.05 for 5%)

Probability of B occurring when A has occurred

Probability of B occurring when A has NOT occurred

Calculation Results

48.92%
P(A|B)
Probability of A given B
51.08%
P(Ā|B)
Probability of Ā given B

Complete Probability Table

Event A:
P(A) = 0.0500
P(Ā) = 0.9500
Conditional on A:
P(B|A) = 0.9100
P(B̄|A) = 0.0900
Joint Probabilities:
P(A∩B) = 0.0455
P(A∩B̄) = 0.0045
P(Ā∩B) = 0.0475
P(Ā∩B̄) = 0.9025
Total Probabilities:
P(B) = 0.0930
P(B̄) = 0.9070

Formulas used:

P(A|B) = P(A∩B) / P(B)
P(B) = P(A) × P(B|A) + P(Ā) × P(B|Ā)
P(A∩B) = P(A) × P(B|A)

Medical Testing Example

Disease Prevalence Example

Disease prevalence in population: 5% (P(D) = 0.05)

Test sensitivity (true positive rate): 91% (P(+|D) = 0.91)

Test specificity (true negative rate): 95% (P(-|D̄) = 0.95)

False positive rate: 5% (P(+|D̄) = 0.05)

Question

If a random person tests positive, what's the probability they actually have the disease?

Solution

P(D|+) = P(D∩+) / P(+)

P(+) = 0.05 × 0.91 + 0.95 × 0.05 = 0.093

P(D∩+) = 0.05 × 0.91 = 0.0455

P(D|+) = 0.0455 / 0.093 ≈ 48.92%

Probability Tree Concept

Initial Events
A or Ā
A
P(A)
Ā
P(Ā)
B|A
B̄|A
B|Ā
B̄|Ā

Key Concepts

📊

Conditional Probability

P(A|B) = probability of A given B has occurred

🔄

Bayes' Theorem

Relates P(A|B) to P(B|A)

⚖️

Law of Total Probability

P(B) = Σ P(B|Ai) × P(Ai)

🎯

Applications

Medical diagnosis, quality control, machine learning

Understanding Conditional Probability

What is Conditional Probability?

Conditional probability quantifies the likelihood of an event occurring given that another event has already occurred. It's denoted as P(A|B), read as "probability of A given B."

Why is it Important?

  • Essential for medical diagnosis and screening tests
  • Used in machine learning and artificial intelligence
  • Critical for risk assessment and quality control
  • Helps update beliefs with new information

Mathematical Foundation

Basic Formula:
P(A|B) = P(A∩B) / P(B)
Bayes' Theorem:
P(A|B) = P(B|A) × P(A) / P(B)
Total Probability:
P(B) = P(B|A)×P(A) + P(B|Ā)×P(Ā)

Real-World Applications

  • Medical Testing: Disease probability given test results
  • Spam Filtering: Email classification based on content
  • Weather Forecasting: Rain probability given cloud conditions
  • Quality Control: Defect probability given inspection results