Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Conditional Probability | Basic Concepts of Probability Theory
Probability Theory Basics
course content

Contenido del Curso

Probability Theory Basics

Probability Theory Basics

1. Basic Concepts of Probability Theory
2. Probability of Complex Events
3. Commonly Used Discrete Distributions
4. Commonly Used Continuous Distributions
5. Covariance and Correlation

bookConditional Probability

Conditional probability is the probability of an event occurring, given that another event has already occurred. It represents the updated probability based on the knowledge or information about the occurrence of another event.
The conditional probability of A given B is defined as follows:

If events A and B are independent, then
P(A intersection B) = P(A)*P(B),
and as a result, conditional probability P(A|B)=P(A).

Note

It makes sense to introduce a conditional probability only if P(B) is not equal to zero.

Let's look at the example.

Assume that there are 5 children in the family, and at least one is a girl. Calculate the probability that the eldest child is a boy assuming that each child can be a girl or a boy with equal probability.

Due to this assumption, we can use the classic definition of probability and calculate the corresponding probability using conditional probability.
Let event A is that the eldest child is a boy. Event B is that there is at least one girl. We can solve this task as follows:

123456789101112131415161718192021222324252627
import numpy as np # Firstly let's calculate the number of all possible outcomes # There are 5 children, each child can be a boy or a girl. num_combinations = 2**5 # Let's consider event B # There is only one possible variant when there are no girls in the family num_B = num_combinations - 1 p_B = num_B / num_combinations # Now let's consider event A intersection event B # We fix the fact that the eldest child is a boy, in this case there are four children num_comb_4_children = 2**4 # Now we can calculate number of combinations when the eldest child is a boy # and there is at least one girl # There is only one combination when the eldest child is a boy and there are no girls num_A_and_B = num_comb_4_children - 1 p_A_and_B = num_A_and_B / num_combinations # At least we can calculate conditional probability cond_prob = p_A_and_B / p_B # Print the results print(f'Probability that the eldest is a boy and there is at least one girl is {cond_prob:.4f}')
copy
Solve the following task: P(A|B) = 0.7, P(B)=0.1, A and B are independent. Calculate P(A)

Solve the following task: P(A|B) = 0.7, P(B)=0.1, A and B are independent. Calculate P(A)

Selecciona la respuesta correcta

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 6
We're sorry to hear that something went wrong. What happened?
some-alt