Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Conditional Probability | Section
Exploring Probability Theory

bookConditional Probability

Glissez pour afficher le menu

Conditional probability measures the likelihood of an event occurring, given that another event has already happened. This is a crucial concept in probability theory because many real-world situations involve events that are not independent. For example, if you draw two cards from a deck without replacement, the probability that the second card is an ace changes depending on whether the first card was an ace.

The formula for conditional probability is:

P(AB)=P(AB)P(B)P(A|B) = \frac{P(A \cap B)}{P(B)}

where:

  • P(AB)P(A|B) is the probability of event AA occurring given that event BB has occurred;
  • P(AB)P(A ∩ B) is the probability that both events A and B occur;
  • P(B)P(B) is the probability that event B occurs.

Example 1: drawing cards

Suppose you have a standard 52-card deck. What is the probability that the second card drawn is an ace, given that the first card drawn was an ace (and cards are not replaced)?

Let AA be the event "second card is an ace," and BB be the event "first card is an ace."

  • There are 4 aces in the deck;
  • If the first card is an ace, there are now 3 aces left and 51 cards remaining.

So, the conditional probability is:

P(second is acefirst is ace)=351P(\text{second is ace} | \text{first is ace}) = \frac{3}{51}

Example 2: rolling dice

Suppose you roll two six-sided dice. What is the probability that the sum is 9, given that at least one die shows a 4?

  • Let AA be "sum is 9";
  • Let BB be "at least one die is a 4."

First, count the total outcomes where at least one die is a 4:

  • (4,1),(4,2),(4,3),(4,4),(4,5),(4,6)(4,1), (4,2), (4,3), (4,4), (4,5), (4,6);
  • (1,4),(2,4),(3,4),(5,4),(6,4)(1,4), (2,4), (3,4), (5,4), (6,4).

That is 11 outcomes (note (4,4)(4,4) is only counted once).

Now, how many of these have a sum of 9?

  • (4,5)(4,5) and (5,4)(5,4).

So, the conditional probability is:

P(sum is 9at least one die is 4)=211P(\text{sum is 9} | \text{at least one die is 4}) = \frac{2}{11}
1234567891011121314151617181920212223242526272829303132
# Calculate conditional probability in Python # Example: Probability that the second card is an ace, given the first card is an ace # Total number of aces in a deck total_aces = 4 # Total number of cards total_cards = 52 # After drawing one ace, remaining aces and cards remaining_aces = total_aces - 1 remaining_cards = total_cards - 1 # Conditional probability: second card is ace given first is ace conditional_prob = remaining_aces / remaining_cards print(f"Probability that the second card is an ace given the first is an ace: {conditional_prob:.4f}") # Example: Probability that the sum is 9 given at least one die is a 4 # List all (die1, die2) pairs where at least one die is a 4 outcomes = [] for die1 in range(1, 7): for die2 in range(1, 7): if die1 == 4 or die2 == 4: outcomes.append((die1, die2)) # Count outcomes where sum is 9 favorable = [pair for pair in outcomes if sum(pair) == 9] conditional_prob_dice = len(favorable) / len(outcomes) print(f"Probability that the sum is 9 given at least one die is a 4: {conditional_prob_dice:.4f}")
copy
question mark

A box contains 3 red balls and 2 blue balls. You draw two balls one after another without replacement. What is the correct expression for the probability that the second ball is blue, given that the first ball was red?

Sélectionnez la réponse correcte

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 5

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

Section 1. Chapitre 5
some-alt