Contingency table
The following table shows the numbers of red and black cards in a deck that are Aces and non-Aces:
Red | Black | Total | |
---|---|---|---|
Ace | 2 | 2 | 4 |
Non Ace | 24 | 24 | 48 |
Total | 26 | 26 | 52 |
The total in the Red column is 26, which means there are 26 red cards in the deck. Of these, 2 are Aces and 24 are non-Aces. There are 52 cards in a deck. Use the values in the table to calculate some conditional probabilities.
This exercise is part of the course
Foundations of Probability in Python
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Individual probabilities
P_Red = ____
P_Red_n_Ace = ____
# Conditional probability calculation
P_Ace_given_Red = ____
print(P_Ace_given_Red)