Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende 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

book
Conditional 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.

A family has 5 children, and each child is equally likely to be a boy or a girl with a probability of 50%.

Given that at least one of the children is a girl, calculate the probability that the eldest child is a boy.

To solve this, use conditional probability, where:

  • Event A - The eldest child is a boy.
  • Event B - There is at least one girl among the 5 children.
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
question mark

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