Conditional Probability Calculator
Calculate P(A|B) - The Probability of A Given B
What is Conditional Probability?
Conditional probability is the probability of an event occurring given that another event has already occurred. It measures the likelihood of event A happening when we know that event B has happened[web:21][web:25]. This concept is fundamental in statistics, probability theory, and real-world decision-making[web:23][web:26].
For example, the probability that someone is coughing given that they are sick is different from the probability that someone is coughing in general. Conditional probability allows us to update our beliefs about events based on new information[web:28][web:29].
🧮 Interactive Calculator
Calculate P(A|B) = P(A ∩ B) / P(B)
Enter a value between 0 and 1
Must be greater than 0
Result
Quick Examples to Try:
Conditional Probability Formula
The conditional probability of event A given that event B has occurred is defined by the formula[web:21][web:25]:
where \( P(B) > 0 \)
Understanding the Components:
• P(A|B)
The conditional probability of A given B - what we're trying to find[web:21].
• P(A ∩ B)
The probability of both A and B occurring simultaneously (the intersection)[web:25].
• P(B)
The probability of event B occurring (must be greater than zero)[web:21].
Alternative Forms & Related Formulas
Multiplication Rule
Rearranging the conditional probability formula gives us the multiplication rule[web:27]:
Bayes' Theorem
Bayes' Theorem allows us to reverse conditional probabilities[web:27][web:33][web:39]:
This is incredibly useful when we know P(B|A) but need to find P(A|B)[web:36][web:40].
Independent Events
When events A and B are independent, the occurrence of B doesn't affect A[web:30]:
Worked Examples
Example 1: Rolling Dice
Problem: When rolling a fair six-sided die, find the probability of rolling an even number given that the number rolled is greater than 4[web:23].
Solution:
Let A = rolling an even number {2, 4, 6}
Let B = rolling a number greater than 4 {5, 6}
A ∩ B = {6} (both even AND greater than 4)
P(A ∩ B) = 1/6
P(B) = 2/6 = 1/3
P(A|B) = P(A ∩ B) / P(B) = (1/6) / (1/3) = 1/2
Answer: The probability is 1/2 or 50%
Example 2: Medical Diagnosis
Problem: In a population, 5% of people have a disease. A diagnostic test shows positive results in 90% of people who have the disease. If someone tests positive, what is the probability they actually have the disease, assuming 10% of healthy people also test positive[web:25][web:29]?
Solution (Using Bayes' Theorem):
Let D = has disease, T = tests positive
P(D) = 0.05, P(T|D) = 0.90, P(T|D') = 0.10
P(T) = P(T|D)·P(D) + P(T|D')·P(D') = 0.90(0.05) + 0.10(0.95) = 0.045 + 0.095 = 0.14
P(D|T) = [P(T|D)·P(D)] / P(T) = (0.90 × 0.05) / 0.14 = 0.045 / 0.14
Answer: P(D|T) ≈ 0.321 or 32.1%
Example 3: Cards
Problem: From a standard deck of 52 cards, one card is drawn. What is the probability that it's a king given that it's a face card?
Solution:
Let A = drawing a king (4 kings in deck)
Let B = drawing a face card (12 face cards: J, Q, K in 4 suits)
A ∩ B = drawing a king that is also a face card = 4 cards
P(A ∩ B) = 4/52
P(B) = 12/52
P(A|B) = (4/52) / (12/52) = 4/12 = 1/3
Answer: The probability is 1/3 or approximately 33.3%
Real-World Applications
Conditional probability is used extensively across numerous fields and industries[web:25][web:26][web:29]:
🏥 Healthcare & Medicine
Determining disease probability based on test results, diagnosing conditions, and assessing treatment effectiveness[web:25][web:29].
💰 Finance & Insurance
Risk assessment, credit scoring, loan default prediction, and insurance premium calculations[web:25].
🌦️ Weather Forecasting
Predicting tomorrow's weather based on current conditions and historical patterns[web:25][web:26].
🤖 Machine Learning & AI
Classification algorithms, spam filters, recommendation systems, and natural language processing[web:25].
⚽ Sports Analytics
Betting odds calculation, player performance prediction, and game outcome forecasting[web:26].
📊 Marketing & Sales
Customer behavior prediction, targeted advertising, sales forecasting, and inventory management[web:25][web:26][web:29].
🔬 Scientific Research
Hypothesis testing, experimental design, and data analysis across all scientific disciplines.
🏛️ Legal & Forensics
DNA evidence evaluation, criminal case analysis, and probability assessments in court[web:29].
Important Facts & Tips
💡 Key Insight
Conditional probability helps us update our beliefs about events when we receive new information. This is the foundation of Bayesian reasoning[web:27][web:36].
💡 Common Mistake
Don't confuse P(A|B) with P(B|A)! These are generally different values. For example, P(cough|sick) ≠ P(sick|cough)[web:28].
💡 Notation
The vertical bar "|" reads as "given that" or "given." So P(A|B) is read as "the probability of A given B"[web:21][web:25].
💡 Restriction
Conditional probability is only defined when P(B) > 0. You cannot condition on an impossible event[web:21][web:22].
💡 Independence Test
Events A and B are independent if and only if P(A|B) = P(A), which means knowing B occurred doesn't change the probability of A[web:30].
💡 Historical Note
Thomas Bayes (1701-1761) first formulated what we now call Bayes' Theorem, which revolutionized how we think about conditional probability[web:27][web:36].
💡 Curriculum Coverage
Conditional probability appears in IB Math (SL & HL), AP Statistics, A-Level Mathematics, GCSE/IGCSE Statistics, and college probability courses.
Key Properties of Conditional Probability
Property 1: Range
Conditional probabilities always fall between 0 and 1: \( 0 \leq P(A|B) \leq 1 \)
Property 2: Certainty
If A is certain to occur when B occurs, then \( P(A|B) = 1 \)
Property 3: Complement
\( P(A'|B) = 1 - P(A|B) \) where A' is the complement of A
Property 4: Chain Rule
For multiple events[web:21]:
Practice Problems
Problem 1
In a class of 100 students, 60 study mathematics and 40 study physics. If 25 students study both subjects, what is the probability that a randomly selected student studies mathematics given that they study physics?
Solution:
P(M ∩ P) = 25/100 = 0.25
P(P) = 40/100 = 0.40
P(M|P) = P(M ∩ P) / P(P) = 0.25 / 0.40 = 0.625
Answer: 62.5% or 5/8
Problem 2
A bag contains 5 red balls and 7 blue balls. Two balls are drawn without replacement. What is the probability that the second ball is red given that the first ball was red?
Solution:
After drawing one red ball, there are 4 red balls left and 11 total balls remaining.
P(2nd red | 1st red) = 4/11
Answer: 4/11 ≈ 36.4%
Problem 3
The probability that it rains is 0.3. The probability that you carry an umbrella is 0.4. The probability that it rains AND you carry an umbrella is 0.25. What is the probability you carry an umbrella given that it rains?
Solution:
P(Rain ∩ Umbrella) = 0.25
P(Rain) = 0.3
P(Umbrella|Rain) = 0.25 / 0.3 ≈ 0.833
Answer: Approximately 83.3%
👨🏫 About the Author
Adam
Co-Founder @RevisionTown
Math Expert in various curricula including IB, AP, GCSE, IGCSE, and more.