Hongmu Notes

Conditional probability calculation

Conditional probability answers "given that B occurs, how likely is A to occur?", recorded as P(A|B), which is equal to the probability of A and B occurring at the same time divided by the probability of B.
100% Browser local processing 0 Data upload

🎲 Probability and combinatorial calculations

💡 Instructions for use

  • The meaning of the input box automatically switches with the scene: fill in the total number and number of removals for permutations and combinations, and fill in parameters and observation values for distribution scenarios.
  • Always fill in a decimal for probability, for example, fill in 0.25 for 25%; the degree parameter must be a non-negative integer, and the standard deviation must be greater than 0.
  • Permutations and combinations use precise integer operations, and the results will not lose precision due to excessively large values; distribution results are rounded to the selected number of digits.
  • The intersection column in the union scenario can be left blank. If left blank, the two events will be processed independently, that is, the intersection probability is equal to the product of the two probabilities.

Conditional probability answers "given that B occurs, how likely is A to occur?", recorded as P(A|B), which is equal to the probability of A and B occurring at the same time divided by the probability of B.

Formulas and premises

The conditional probability P(A|B) is equal to P(A and B occurring simultaneously) divided by P(B), if P(B) is greater than 0. Because it is known that B must occur, the sample space is reduced to the interior of B. The numerator is the part that falls in B and also belongs to A, and the denominator is the entire B. The division of the two is the proportion of A in the reduced space.

Common misunderstandings

  • Confusing P(A|B) with P(B|A), the two are generally not equal and have completely different meanings in different orders.
  • Forget that the intersection probability cannot be greater than the probability of B. If such an input occurs, the data is contradictory.
  • If the result is used directly when the probability of B is very small, amplifying the small probability will make the estimation of the conditional probability very unstable.

Conditional probability expresses the probability that another event will occur, given that one event is known to occur. The denominator shrinks from the full range of conditions to a range of known conditions, so the result is usually different from the original probability.

The key when calculating is to redefine the sample space: treat the known conditions as a new population, and only count target events within this range, instead of using the original denominator.

The key is to treat the known conditions as a new sample space and redefine the denominator instead of using the original population.

The entered intersection probability cannot be greater than the probability of event B, the tool will prompt here.

📖 Glossary

Probability
A number between 0 and 1 indicates the likelihood of an event happening; 0 means impossible, 1 means it will definitely happen, and the sum of the probabilities of all possible outcomes is equal to 1.
factorial
The result of multiplying from 1 to a certain positive integer is recorded as n!, which stipulates that 0! is equal to 1, which is the basis of permutation and combination formulas.
number of permutations
The number of r ways to arrange a column in order from n different elements is recorded as P(n,r), which is equal to n! divided by (n minus r)!. Different situations are considered in different orders.
number of combinations
There are r ways to extract r numbers from n different elements regardless of order, denoted as C(n,r), which is equal to n! divided by r! and (n minus r)!. Different orders count as the same.
binomial distribution
In n independent repeated experiments, the probability of each success is fixed to p, the distribution of the number of successes; finding the probability of exactly k successes uses combination numbers and power operations.
normal distribution
A large number of natural and social phenomena approximately obey the bell-shaped distribution determined by the mean and standard deviation, and the interval probability is calculated by the standard normal distribution.
standard normal distribution
A normal distribution with mean 0 and standard deviation 1. Any normal variable can be transformed into a standard normal distribution by subtracting the mean and dividing by the standard deviation, which is convenient for table lookup or calculation.
Poisson distribution
Describing the distribution of the number of rare events occurring per unit time or unit area, it is determined by only one parameter, that is, the average number of occurrences.
conditional probability
The probability of event A occurring under the condition that event B has already occurred, denoted as P(A|B), is equal to the probability of A and B occurring simultaneously divided by the probability of B.
Bayesian formula
The formula of inferring P(A|B) from P(A), P(B|A) and P(B) is often used to calculate the probability of true disease in a person who tests positive when the sensitivity and prevalence of the test are known.
independent event
Whether one event occurs or not does not affect the probability of another event. The probability of simultaneous occurrence is equal to the product of the two probabilities.
mutually exclusive events
For two events that cannot occur at the same time, the probability of their occurrence at the same time is 0, and the union probability is equal to the sum of the two probabilities.
Expectation
The weighted average of the values of random variables, where the weight is the probability of each occurrence, describes the long-term average level.
variance
The weighted average of the squared deviations of a random variable from the expected value is used to measure the dispersion of values, and its square root is the standard deviation.

🔗 All keywords and tutorials

Keywords page of the tool12a

Return to tool home page

❓ FAQ

Are P(A|B) the same as P(B|A)?
Generally different. Only the probabilities of the two are equal or the same under specific conditions. Confusing these two quantities is the most common mistake, and requires Bayesian formula for correct conversion.
What is the conditional probability when two events are independent??
When independent, P(A|B) is equal to P(A), that is to say, whether B occurs does not affect the probability of A. In this case, the intersection probability is equal to the product of the two probabilities.