
Towards Data Science

May 23, 2022

Probability Simulations: Solve complex probability problems using randomness: Part 1
Estimate the probability of favorable outcome/s by designing experiments and repeating them several times in the virtual world..
We all have dealt with probabilities in our life. Be it in a game which requires rolling a dice or dealing with cards, or estimating our chances of winning on sports bets, or be it in calculating the effectiveness of a vaccine. Probability shows up everywhere where you want to estimate a “chance” of a favorable (or not) outcome/s out of all the possible outcomes.
Note that this article is not introductory and some basic prior knowledge on probability, including Bayes’ theorem, is needed.
A Quick Introduction
Simply defined, probability is the chance that a given event will occur. Or in technical terms, per merriam-webster , it is the ratio of the number of outcomes in an exhaustive set of equally likely outcomes that produce a given event to the total number of possible outcomes.
i.e. P(of an event) = (Number of favorable outcomes) / (Total possible outcomes)
- For a quick and very familiar example, let’s take a fair coin. The two possible outcomes are Heads (H) and Tails (T), each with an equal chance of occurence.
Thus, P(H) = 1/2 and P(T) = 1/2, because in each scenario, the total number of outcomes is 2 → {H, T}, and the favorable outcomes for Heads is 1 {H} and that for Tails is 1 {T}. Thus the probability for each case is 1/2. And note that the sum of probability of all possible outcomes combined should be 1. That is, P(Heads or Tails) = P(Heads) + P(Tails) - P(Heads and Tails) = 1/2 + 1/2 - 0 = 1. Note that here, an event where the coin lands on both H and T at the same time is not possible. These are called mutually exclusive events (they cannot occur at the same time).
A quick recap of the Bayes’ theorem
Given a hypothesis H and evidence E, Bayes’ theorem establishes the relationship between the probability of hypothesis P(H) before getting the evidence E to the probability of hypothesis after getting the evidence P(H | E). It’s a very important concept to understand, and if you are not familiar with conditional probability and Bayes’ theorem, please feel free to refer to these links [ 1 ][ 2 ][ 3 ].
And if you want to do a more detailed recap of probability, please refer to this wiki link.
Simulating Probabilities: Why?
Now, most of the probability problems can be solved on paper. But sometimes, the problems can get complex and time consuming. And even after you solve it successfully, there may not be a reference to check against if your calculated answer is correct or not, especially if you are someone who uses probability in real life practical scenarios — because the problems will most likely be unique. So, simulating a problem or experiment to calculate the probability of an interested event is useful to:
- Gain deeper insights into the problem by actually performing the experiment/s virtually.
- Validate your calculated answer.
- Learning how to simulate simple to complex real life experiments and scenarios using code; e.g. modeling economic stability of a region, or modeling COVID spread in a country, etc.
Simulating Probabilities: Design steps
- Design the experiment . This comes from the problem statement or a scenario you are trying to figure out the probability for.
- Repeat the experiment N number of times . The larger the N, the better are your estimated probability numbers. (law of large numbers)
- Calculate the ratio of favorable outcomes to the total possible outcomes to calculate the probability.
Note: We will be using Python’s in-built random module to generate “random” samples. In simple words, if you ask the random module to pick from a Heads and Tails, each having an equal probability of 0.5, it will pick one randomly. But if you repeat it large number of times, it will, on average, ~50% of the times pick a Heads and another ~50% of the times pick a Tails. (We could also use numpy’s random module which is faster for arrays).
A side note on the random module: the random module generates pseudo-random numbers, that is, the numbers may appear random, but they aren’t actually totally random in true scientific sense [ source ] . Having said that, for most of our daily use cases, using this module should suffice. But it is not advised to use this module for any cryptography, or similar risk and privacy related applications.
Please refer to these [ 4 ] and [ 5 ] links for more details.
Let’s see this process in action with an example.
- Let’s say you are trying to answer the question: What is the probability of getting 2 heads (H) when you flip two fair coins or flip a fair coin twice?
- Since getting a coin toss is independent of another coin toss or its own previous tosses, P(2H) = P(H) * P(H) = 0.5 * 0.5 = 0.25 = 1/4. You can also intuitively put it this way → the four possible outcomes of two tosses are {HH, HT, TH, TT}. Out of these 4, only 1 matches our expectations of two heads {HH}. So, the answer is 1/4.
- Let’s simulate this experiment and see what we find..
The function coin_flip is our single modular experiment which mimicks the flipping of n_flips number of fair coins OR flipping one fair coin n_flips number of times . We have used random.choices to simulate the flips. The population parameters is the list of outcomes, weights is the list of probability for each of those outcomes (if not passed, an equal probability for each outcome will be assumed) and k is the number of samples to be drawn with replacement. Note that we choose “with replacement” because getting Heads or Tails the 2nd time is not dependent on the outcome of the first flip, they are independent events. You could have also used random.choice for a single flip and put this in a for loop for n_flips number of times, and then caclulate the sum of those outcomes, but that would have been slower and the results wouldn’t have been that different.
The designed outcome of our ‘experiment’ function is sum of n_flips , where, for a single flip, H and T are assigned values of 1 and 0 respectively. So, for a two coin flip experiment, we are looking for outcomes where sum = 2 (i.e. 2 Heads). (Note that if we were interested in scenarios where we obtain 1H and 1T, our sum filter would have been sum = 1. And if we were interested in 2T, we could have used a filter of sum = 0. )
We then repeat the experiment N number of times (the higher the better), and then summarize the results into a pandas DataFrame.
The probability is calculated as the ratio of favorable outcomes (with a sum of 2) to the total possible outcomes. As you can see, this comes out to be ~0.25 which is closer to our calculated known probability of 1/4.
Are you ready? We will use the same approach to calculate probabilities and/or expected values for some simple to complex problems (in this post as well as in Part 2). What better way to start than the (in)famous Monty Hall problem , which had baffled some of the brightest statistical minds in the late 20th century.
The orignal problem
You are in a game show. The host shows you 3 doors and tells you that there is a car behind one door and goats behind the other two. ** The host knows exactly what is behind which door.
- He asks you to pick one door. Say you pick door 1.
- He then opens door 3, with a goat behind it. Note that the host is guaranteed to open a door with a goat behind it, because he knows.
- He then asks you whether you want to go ahead with your previous choice of door 1 or switch to door 2?
What should you do to maximize your chances of winning?
Let’s solve this problem on paper first. Initially, when you pick a door, there is a 1/3rd chance of you picking a door with a car behind it. So, door 1 has 1/3rd chance of being the correct choice, and doors 2 and 3 combined have a 2/3rd chance of having a car behind any one of them. When the host opens door 3 to show a goat behind it, the P(car behind door 3) becomes 0, and P(car behind door 2) becomes 2/3rd. The P(car behind door 1) remains the same (1/3rd) because you gain no new information about door 1. So, to answer the question, you will win with a 2/3rd probability if you switch to door 2.
You can also use Bayes theorem to solve this as follows.
Let’s simulate this scenario and see if the outcome matches our calculated value.
You can see that as n_rounds increases, the simulated probability approaches the theoretical probabilities. That is, out of the 10,000 games played, you won almost 2/3rd of those games by switching. You can also increase the number of doors, and play the same game (where the host reveals a goat behind one of the other remaining doors). The probability for switching remains higher, but the difference between switching and not switching decreases and approaches 0 as the number of doors increases. See below. This is because the advantage for the other door(s) gets lower and lower as n_doors increases.( This will change if the host opens more than 1 door….feel free to play with this scenario and see what you get. )
Variation where the host doesn’t know
The exact same game as above, but this time the host doesn’t know what is behind which door and he randomly chooses a door (excluding the one that you choose) to open. So he may accidentally open a door with a car behind it, in which case, the game either ends or is restarted or you automatically win.
- The host asks you to pick one door. Say you picked door 1.
- He then opens door 3, and finds a goat behind it.
Now, this may look exactly the same as the previous one, but in this case the main difference to focus on is that the host doesn’t know. This lack of knowledge on the host’s part changes everything.
Note that, in the above calculations, and in below simulation, we consider only those rounds where “a goat has been revealed”.
As you can see, the simulation results match the calculations.
Hooray!! By now you must have got a gist of how to design a simulation for a probability problem.
We will go over some more examples in Part 2 of this post. I will also be sharing a link to the entire Jupyter notebook after Part 2.
Thanks for reading. Please feel free to leave comments, questions or suggestions. Also, any new ideas for the next post are welcome.
PS: This post was motivated by a discussion that I recently had with my data science colleague on a probability distribution problem that she was trying to solve.
More from Towards Data Science
Your home for data science. A Medium publication sharing concepts, ideas and codes.
About Help Terms Privacy
Get the Medium app

Pratha Pawar
Data Scientist with strong passion for solving critical real-world problems. You can connect with me at https://www.linkedin.com/in/prathamesh-pratha-pawar-0a28
Text to speech

- Testimonial
- Web Stories

Learning Home

Not Now! Will rate later

- Probability: Solved Examples

- Probability: Concepts & Tricks
- Probability Practice Questions: Level 01
- Probability Practice Questions: Level 02

Most Popular Articles - PS

Time and Work Concepts

Time and Work Formula and Solved Problems

Time and Work Problems (Easy)

Time and Work Problems (Difficult)

Problems on Ages Practice Problems : Level 02


Chain Rule : Theory & Concepts

Chain Rule Solved Examples
-icon.jpg?null&itok=dAsWHIpy)
Chain Rule Practice Problems: Level 01

Chain Rule Practice Problems : Level 02

Problems on Numbers System : Level 02
Solved Problems of Simple and Compound Probability
What is probability, compound probability.
In this article, you will find some of the solved examples of simple and compound probability. But before proceeding to solve the problems, first, you will get a short introduction to simple and compound probabilities and their formulae. So, let us get started.
A likelihood of an event to occur or the extent to which something can happen is known as probability .
The definition of probability in mathematics is also the same. It is the likelihood of an event to occur. Few examples of probability are given below:
- Selecting a red ball from a group of colored balls
- Tails up after tossing a coin
- Selecting a queen card from the deck of 52 cards
- Choosing a chocolate-flavored ice cream from a set of eight flavors
These are only some of the examples of probability from our daily lives. The probability of the occurrence of different events vary.
- If it is certain that an event will occur, then its probability will be 1 .
- If the probability of an event is 0 , then we assume that there is no possibility of occurrence of an event.
- The probabilities of all possible events lie between 0 to 1 .
We can denote this like this:

A is the event and P(A) is the probability of the occurrence of an event A. A sample space is the set of probable outcomes of an event. For example, if you toss two coins simultaneously, then the possible outcomes will be:
{(H,H), (H,T), (T,H), (T,T)}
This list of possible outcomes is known as sample space .
Finding a simple probability is straightforward as we just have to divide the number of ways in which an event can occur by the total number of outcomes.

We use the following formula of compound probability if we are asked to tell the probability of the occurrence of more than one event:
P(A or B) = P(A) + P(B) - P(A and B)
- A and B are any two events.
- P(A) means the likelihood of the occurrence of event A.
- P(B) means the likelihood of the occurrence of an event B.
- P(A and B) is the probability that both the events A and B will occur at the same time.
Now, you know what the simple and compound probabilities are, let us proceed to the following examples that will make the whole concept more clear.
In a class, there are 30 girls and 15 boys. 20 of the 30 girls like football and the rest of them like badminton. 10 of the 15 boys like football and the rest of them like badminton. Find the probability that the student selected randomly will be:
- A boy who likes football
- A girl or a boy
There are three parts of this problem. We will find the probability of each event separately:
Number of girls in the class = 30
Total number of students in the class = 45

We will write the fraction in its most simplified form like this:

b) A boy who likes football
Number of boys who like football = 10

Simplifying the above probability will give us the following fraction:

c) A boy or a girl
The probability that the selected student will be a boy or a girl is 1 because as we discussed earlier that if it is certain that an event will occur then the probability is 1.
John rolls a dice. What is the probability of getting 3 or 6?
This is an example of a compound probability because we are asked to tell the probability of two events. The formula for computing the compound probability is given below:
According to this formula, first, we need to get the probability of each event separately like this:

Since only one dice is rolled, hence the probability of getting 3 and 6 both is 0.
Substituting the values of probability in the compound probability formula will give us the probability of getting 3 or 6:

Find the probability of selecting a red card or 2 from a deck of 52 cards.
To solve the questions of probability that are related to cards, you should know how 52 cards in a deck are distributed.
In a deck of 52 cards:
- There are four suits
- Two suit have black cards and two of them are red
- In each suit, there are 13 cards. These 13 cards include a queen, a king a jack, ace, 2, 3, 4, 5, 6, 7, 8, 9, and 10.

Total number of cards in a deck = 52

Number of cards having 2 in a deck = 4

Number of red cards and 2 from a deck = 2

Now, we will substitute all these values in the compound probability formula to get the probability of selecting a red card or 2 from the deck.

Solving and simplifying the above expression algebraically will give us the following answer:

In a pool, there are 20 balls and 40 blocks. 10 of the 20 balls are red and the rest of them are blue. 15 of the 45 blocks are green, 10 are red, and the rest of them are blue. Find the probability that the item picked randomly will be:
- A ball of red color
- A blue-colored object
Number of balls in the pool = 20
Total number of items in the pool = 60
The probability that a random item picked will be a ball:

b) A ball of red color
Number of balls of red color= 10
Total number of items = 60

c) A blue-colored object
Number of blue balls in the pool = 10
Number of blue blocks in the pool = 20
Total number of objects in the pool = 60

Alice rolls a dice on the floor. What is the probability that the number will be a multiple of 2?
In the dice, there are six numbers {1, 2, 3, 4, 5, 6}. There are three multiples of 2 that are 2, 4, and 6.
Number of multiples of 2 on the dice = 3
Total numbers on the dice = 6
The platform that connects tutors and students
Did you like this article? Rate it!
Rafia Shabbir
Solved Problem of Probabilty 8
Measures of central tendency, position and dispersion, solved problems of conditional probability, confidence interval, solved problem of probabilty 1, solved problem of probabilty 13, solved problem of probabilty 15, confidence interval for the mean, contingency tables, multiplication rule, standard normal table, solved problem of probabilty 10, solved problem of probabilty 14, solved problem of probabilty 6, combinatorics and probability, confidence interval for the proportion, normal distribution, percentiles, conditional probability word problems, using the z table, normal approximation, probability properties, solved problem of probability 18, solved problem of probabilty 5, solved problem of probability 2, tree diagrams, probability theory, bayes’ theorem, conditional probability, standard normal distribution, law of total probability, solved problems of probability 4, solved problems of probability 11, solved problems of probability 17, solved problems of probability 16, solved problems of probability 3, solved problem of probabilty 9, s1 and s2 distributions cheat sheet, probability formulas, arithmetic mean worksheet, confidence interval problems, arithmetic mean problems, median worksheet, normal distribution word problems, mode worksheet, standard deviation problems, probability worksheet, probability word problems, cancel reply.
Your comment
Current [email protected] *
Leave this field empty
Solved Probability Problems
Solved probability problems and solutions are given here for a concept with clear understanding.
Students can get a fair idea on the probability questions which are provided with the detailed step-by-step answers to every question.
Solved probability problems with solutions :

The graphic above shows a container with 4 blue triangles, 5 green squares and 7 red circles. A single object is drawn at random from the container.
Match the following events with the corresponding probabilities:
Number of blue triangles in a container = 4
Number of green squares = 5
Number of red circles = 7
Total number of objects = 4 + 5 + 7 = 16
(i) The objects is not a circle:
P(the object is a circle)
= Number of circles/Total number of objects
P(the object is not a circle)
= 1 - P(the object is a circle)
= (16 - 7)/16
(ii) The objects is a triangle:
P(the object is a triangle)
= Number of triangle/Total number of objects
(iii) The objects is not a triangle:
= Number of triangles/Total number of objects
P(the object is not a triangle)
= 1 - P(the object is a triangle)
= (16 - 4)/16
(iv) The objects is not a square:
P(the object is a square)
= Number of squares/Total number of objects
P(the object is not a square)
= 1 - P(the object is a square)
= (16 - 5)/16
(v) The objects is a circle:
(vi) The objects is a square:
Match the following events with the corresponding probabilities are shown below:

2. A single card is drawn at random from a standard deck of 52 playing cards.
Match each event with its probability.
Note: fractional probabilities have been reduced to lowest terms. Consider the ace as the highest card.
Total number of playing cards = 52
(i) The card is a diamond:
Number of diamonds in a deck of 52 cards = 13
P(the card is a diamond)
= Number of diamonds/Total number of playing cards
(ii) The card is a red king:
Number of red king in a deck of 52 cards = 2
P(the card is a red king)
= Number of red kings/Total number of playing cards
(iii) The card is a king or queen:
Number of kings in a deck of 52 cards = 4
Number of queens in a deck of 52 cards = 4
Total number of king or queen in a deck of 52 cards = 4 + 4 = 8
P(the card is a king or queen)
= Number of king or queen/Total number of playing cards
(iv) The card is either a red card or an ace:
Total number of red card or an ace in a deck of 52 cards = 28
P(the card is either a red card or an ace)
= Number of cards which is either a red card or an ace/Total number of playing cards
(v) The card is not a king:
P(the card is a king)
= Number of kings/Total number of playing cards
P(the card is not a king)
= 1 - P(the card is a king)
= (13 - 1)/13
(vi) The card is a five or lower:
Number of cards is a five or lower = 16
P(the card is a five or lower)
= Number of card is a five or lower/Total number of playing cards
(vii) The card is a king:
(viii) The card is black:
Number of black cards in a deck of 52 cards = 26
P(the card is black)
= Number of black cards/Total number of playing cards
3. A bag contains 3 red balls and 4 black balls. A ball is drawn at random from the bag. Find the probability that the ball drawn is
(ii) not black.
(i) Total number of possible outcomes = 3 + 4 = 7.
Number of favourable outcomes for the event E.
= Number of black balls = 4.
So, P(E) = \(\frac{\textrm{Number of Favourable Outcomes for the Event E}}{\textrm{Total Number of Possible Outcomes}}\)
= \(\frac{4}{7}\).
(ii) The event of the ball being not black = \(\bar{E}\).
Hence, required probability = P(\(\bar{E}\))
= 1 - P(E)
= 1 - \(\frac{4}{7}\)
= \(\frac{3}{7}\).
4. If the probability of Serena Williams a particular tennis match is 0.86, what is the probability of her losing the match?
Let E = the event of Serena Williams winning.
From the question, P(E) = 0.86.
Clearly, \(\bar{E}\) = the event of Serena Williams losing.
So, P(\(\bar{E}\)) = 1 - P(E)
= 1 - 0.86
= 0.14
= \(\frac{14}{100}\)
= \(\frac{7}{50}\).
5. Find the probability of getting 53 Sunday in a leap year.
A leap year has 366 days. So, it has 52 weeks and 2 days.
So, 52 Sundays are assured. For 53 Sundays, one of the two remaining days must be a Sunday.
For the remaining 2 days we can have
(Sunday, Monday), (Monday, Tuesday), (Tuesday, Wednesday), (Wednesday, Thursday), (Thursday, Friday), (Friday, Saturday), (Saturday, Sunday).
So, total number of possible outcomes = 7.
Number of favourable outcomes for the event E = 2, [namely, (Sunday, Monday), (Saturday, Sunday)].
So, by definition: P(E) = \(\frac{2}{7}\).
6. A lot of 24 bulbs contains 25% defective bulbs. A bulb is drawn at random from the lot. It is found to be not defective and it is not put back. Now, one bulb is drawn at random from the rest. What is the probability that this bulb is not defective?
25% of 24 = \(\frac{25}{100}\) × 24 = 6.
So, there are 6 defective bulbs and 18 bulbs are not defective.
After the first draw, the lot is left with 6 defective bulbs and 17 non-defective bulbs.
So, when the second bulb is drwn, the total number of possible outcomes = 23 (= 6+ 17).
Number of favourable outcomes for the event E = number of non-defective bulbs = 17.
So, the required probability = P(E) = (\frac{17}{23}\).
The examples can help the students to practice more questions on probability by following the concept provided in the solved probability problems.
You might like these

Theoretical Probability |Classical or A Priori Probability |Definition
Moving forward to the theoretical probability which is also known as classical probability or priori probability we will first discuss about collecting all possible outcomes and equally likely outcome. When an experiment is done at random we can collect all possible outcomes

10th Grade Worksheet on Probability |Probability Questions and Answers
In 10th grade worksheet on probability we will practice various types of problems based on definition of probability and the theoretical probability or classical probability. 1. Write down the total number of possible outcomes when the ball is drawn from a bag containing 5

Probability |Terms Related to Probability|Tossing a Coin|Coin Probabil
Probability in everyday life, we come across statements such as: Most probably it will rain today. Chances are high that the prices of petrol will go up. I doubt that he will win the race. The words ‘most probably’, ‘chances’, ‘doubt’ etc., show the probability of occurrence

Worksheet on Playing Cards | Playing Cards Probability | With Answers
In math worksheet on playing cards we will solve various types of practice probability questions to find the probability when a card is drawn from a pack of 52 cards. 1. Write down the total number of possible outcomes when a card is drawn from a pack of 52 cards.

Rolling Dice Probability Worksheet |Dice Probability Worksheet|Answers
Practice different types of rolling dice probability questions like probability of rolling a die, probability for rolling two dice simultaneously and probability for rolling three dice simultaneously in rolling dice probability worksheet. 1. A die is thrown 350 times and the
- Probability
Random Experiments
Experimental Probability
Events in Probability
Empirical Probability
Coin Toss Probability
Probability of Tossing Two Coins
Probability of Tossing Three Coins
Complimentary Events
Mutually Exclusive Events
Mutually Non-Exclusive Events
Conditional Probability
Theoretical Probability
Odds and Probability
Playing Cards Probability
Probability and Playing Cards
Probability for Rolling Two Dice
Probability for Rolling Three Dice
- 9th Grade Math
From Solved Probability Problems to HOME PAGE
New! Comments
Didn't find what you were looking for? Or want to know more information about Math Only Math . Use this Google Search to find what you need.
- Preschool Activities
- Kindergarten Math
- 1st Grade Math
- 2nd Grade Math
- 3rd Grade Math
- 4th Grade Math
- 5th Grade Math
- 6th Grade Math
- 7th Grade Math
- 8th Grade Math
- 10th Grade Math
- 11 & 12 Grade Math
- Concepts of Sets
- Boolean Algebra
- Math Coloring Pages
- Multiplication Table
- Cool Maths Games
- Math Flash Cards
- Online Math Quiz
- Math Puzzles
- Binary System
- Math Dictionary
- Conversion Chart
- Homework Sheets
- Math Problem Ans
- Free Math Answers
- Printable Math Sheet
- Funny Math Answers
- Employment Test
- Math Patterns
- Link Partners
© and ™ math-only-math.com. All Rights Reserved. 2010 - 2022.
Forgot password? New user? Sign up
Existing user? Log in
Probability - Problem Solving
Already have an account? Log in here.
- Geoff Pilling
- Sandeep Bhardwaj
To solve problems on this page, you should be familiar with
- Uniform Probability
- Probability - By Outcomes
- Probability - Rule of Sum
- Probability - Rule of Product
- Probability - By Complement
- Probability - Independent Events
- Conditional Probability
Problem Solving - Basic
Problem solving - intermediate, problem solving - difficult.
If I throw 2 standard 5-sided dice, what is the probability that the sum of their top faces equals to 10? Assume both throws are independent to each other. Solution : The only way to obtain a sum of 10 from two 5-sided dice is that both die shows 5 face up. Therefore, the probability is simply \( \frac15 \times \frac15 = \frac1{25} = .04\)
If from each of the three boxes containing \(3\) white and \(1\) black, \(2\) white and \(2\) black, \(1\) white and \(3\) black balls, one ball is drawn at random. Then the probability that \(2\) white and \(1\) black balls will be drawn is?
2 fair 6-sided dice are rolled. What is the probability that the sum of these dice is \(10\)? Solution : The event for which I obtain a sum of 10 is \(\{(4,6),(6,4),(5,5) \}\). And there is a total of \(6^2 = 36\) possible outcomes. Thus the probability is simply \( \frac3{36} = \frac1{12} \approx 0.0833\)
If a fair 6-sided dice is rolled 3 times, what is the probability that we will get at least 1 even number and at least 1 odd number?
Three fair cubical dice are thrown. If the probability that the product of the scores on the three dice is \(90\) is \(\dfrac{a}{b}\), where \(a,b\) are positive coprime integers, then find the value of \((b-a)\).
You can try my other Probability problems by clicking here
Suppose a jar contains 15 red marbles, 20 blue marbles, 5 green marbles, and 16 yellow marbles. If you randomly select one marble from the jar, what is the probability that you will have a red or green marble? First, we can solve this by thinking in terms of outcomes. You could draw a red, blue, green, or yellow marble. The probability that you will draw a green or a red marble is \(\frac{5 + 15}{5+15+16+20}\). We can also solve this problem by thinking in terms of probability by complement. We know that the marble we draw must be blue, red, green, or yellow. In other words, there is a probability of 1 that we will draw a blue, red, green, or yellow marble. We want to know the probability that we will draw a green or red marble. The probability that the marble is blue or yellow is \(\frac{16 + 20}{5+15+16+20}\). , Using the following formula \(P(\text{red or green}) = 1 - P(\text{blue or yellow})\), we can determine that \(P(\text{red or green}) = 1 - \frac{16 + 20}{5+15+16+20} = \frac{5 + 15}{5+15+16+20}\).
Two players, Nihar and I, are playing a game in which we alternate tossing a fair coin and the first player to get a head wins. Given that I toss first, the probability that Nihar wins the game is \(\dfrac{\alpha}{\beta}\), where \(\alpha\) and \(\beta\) are coprime positive integers.
Find \(\alpha + \beta\).
If I throw 3 fair 5-sided dice, what is the probability that the sum of their top faces equals 10? Solution : We want to find the total integer solution for which \(a +b+c=10 \) with integers \(1\leq a,b,c \leq5 \). Without loss of generality, let \(a\leq b \leq c\). We list out the integer solutions: \[ (1,4,5),(2,3,5), (2,4,4), (3,3,4) \] When relaxing the constraint of \(a\leq b \leq c\), we have a total of \(3! + 3! + \frac{3!}{2!} + \frac{3!}{2!} = 18 \) solutions. Because there's a total of \(5^3 = 125\) possible combinations, the probability is \( \frac{18}{125} = 14.4\%. \ \square\)
Suppose you and 5 of your friends each brought a hat to a party. The hats are then put into a large box for a random-hat-draw. What is the probability that nobody selects his or her own hat?
How many ways are there to choose exactly two pets from a store with 8 dogs and 12 cats? Since we haven't specified what kind of pets we pick, we can choose any animal for our first pick, which gives us \( 8+12=20\) options. For our second choice, we have 19 animals left to choose from. Thus, by the rule of product, there are \( 20 \times 19 = 380 \) possible ways to choose exactly two pets. However, we have counted every pet combination twice. For example, (A,B) and (B,A) are counted as two different choices even when we have selected the same two pets. Therefore, the correct number of possible ways are \( {380 \over 2} = 190 \)
A bag contains blue and green marbles. If 5 green marbles are removed from the bag, the probability of drawing a green marble from the remaining marbles would be 75/83 . If instead 7 blue marbles are added to the bag, the probability of drawing a blue marble would be 3/19 . What was the number of blue marbles in the bag before any changes were made?
Bob wants to keep a good-streak on Brilliant, so he logs in each day to Brilliant in the month of June. But he doesn't have much time, so he selects the first problem he sees, answers it randomly and logs out, despite whether it is correct or incorrect.
Assume that Bob answers all problems with \(\frac{7}{13}\) probability of being correct. He gets only 10 problems correct, surprisingly in a row, out of the 30 he solves. If the probability that happens is \(\frac{p}{q}\), where \(p\) and \(q\) are coprime positive integers, find the last \(3\) digits of \(p+q\).
Out of 10001 tickets numbered consecutively, 3 are drawn at random .
Find the chance that the numbers on them are in Arithmetic Progression .
The answer is of the form \( \frac{l}{k} \) .
Find \( k - l \) where \(k\) and \(l\) are co-prime integers.
HINT : You might consider solving for \(2n + 1\) tickets .
You can try more of my Questions here .
A bag contains a blue ball, some red balls, and some green balls. You reach into the bag and pull out three balls at random. The probability you pull out one of each color is exactly 3%. How many balls were initially in the bag?
More probability questions
Photo credit: www.figurerealm.com
Amanda decides to practice shooting hoops from the free throw line. She decides to take 100 shots before dinner.
Her first shot has a 50% chance of going in.
But for Amanda, every time she makes a shot, it builds her confidence, so the probability of making the next shot goes up, But every time she misses, she gets discouraged so the probability of her making her next shot goes down.
In fact, after \(n\) shots, the probability of her making her next shot is given by \(P = \dfrac{b+1}{n+2}\), where \(b\) is the number of shots she has made so far (as opposed to ones she has missed).
So, after she has completed 100 shots, if the probability she has made exactly 83 of them is \(\dfrac ab\), where \(a\) and \(b\) are coprime positive integers, what is \(a+b\)?
Photo credit: http://polymathprogrammer.com/
Problem Loading...
Note Loading...
Set Loading...
- FOR INSTRUCTOR
- FOR INSTRUCTORS

1.4.5 Solved Problems: Conditional Probability
In die and coin problems, unless stated otherwise, it is assumed coins and dice are fair and repeated trials are independent.
You purchase a certain product. The manual states that the lifetime $T$ of the product, defined as the amount of time (in years) the product works properly until it breaks down, satisfies $$P(T \geq t)=e^{-\frac{t}{5}}, \textrm{ for all } t \geq 0.$$ For example, the probability that the product lasts more than (or equal to) $2$ years is $P(T \geq 2)=e^{-\frac{2}{5}}=0.6703$. I purchase the product and use it for two years without any problems. What is the probability that it breaks down in the third year?
- What is the probability of three heads, $HHH$?
- What is the probability that you observe exactly one heads?
- Given that you have observed at least one heads, what is the probability that you observe at least two heads?
- $P(HHH)=P(H)\cdot P(H) \cdot P(H)=0.5^3=\frac{1}{8}$.
- $A$ and $C$ are independent,
- $B$ and $C$ are independent,
- $A$ and $B$ are disjoint,
- $P(A \cup C)=\frac{2}{3}, P(B \cup C)=\frac{3}{4}, P(A \cup B\cup C)=\frac{11}{12}$
We can use the Venn diagram in Figure 1.26 to better visualize the events in this problem. We assume $P(A)=a, P(B)=b$, and $P(C)=c$. Note that the assumptions about independence and disjointness of sets are already included in the figure.

Now we can write $$P(A \cup C)= a+c-ac=\frac{2}{3};$$ $$P(B \cup C)=b+c-bc=\frac{3}{4};$$ $$P(A \cup B\cup C)=a+b+c-ac-bc=\frac{11}{12}.$$ By subtracting the third equation from the sum of the first and second equations, we immediately obtain $c=\frac{1}{2}$, which then gives $a=\frac{1}{3}$ and $b=\frac{1}{2}$.
- $A$ and $B$ are conditionally independent given $C_i$, for all $i \in \{1,2,\cdots,M\}$;
- $B$ is independent of all $C_i$'s.
- What is the probability that it's not raining and there is heavy traffic and I am not late?
- What is the probability that I am late?
- Given that I arrived late at work, what is the probability that it rained that day?
Let $R$ be the event that it's rainy, $T$ be the event that there is heavy traffic, and $L$ be the event that I am late for work. As it is seen from the problem statement, we are given conditional probabilities in a chain format. Thus, it is useful to draw a tree diagram. Figure 1.27 shows a tree diagram for this problem. In this figure, each leaf in the tree corresponds to a single outcome in the sample space. We can calculate the probabilities of each outcome in the sample space by multiplying the probabilities on the edges of the tree that lead to the corresponding outcome.

- You pick a coin at random and toss it. What is the probability that it lands heads up?
- You pick a coin at random and toss it, and get heads. What is the probability that it is the two-headed coin?
Here is another variation of the family-with-two-children problem [1] [7] . A family has two children. We ask the father, "Do you have at least one daughter named Lilia?" He replies, "Yes!" What is the probability that both children are girls? In other words, we want to find the probability that both children are girls, given that the family has at least one daughter named Lilia. Here you can assume that if a child is a girl, her name will be Lilia with probability $\alpha \ll 1$ independently from other children's names. If the child is a boy, his name will not be Lilia. Compare your result with the second part of Example 1.18 .
Let's compare the result with part (b) of Example 1.18. Amazingly, we notice that the extra information about the name of the child increases the conditional probability of $GG$ from $\frac{1}{3}$ to about $\frac{1}{2}$. How can we explain this intuitively? Here is one way to look at the problem. In part (b) of Example 1.18, we know that the family has at least one girl. Thus, the sample space reduces to three equally likely outcomes: $GG, GB, BG$, thus the conditional probability of $GG$ is one third in this case. On the other hand, in this problem, the available information is that the event $L$ has occurred. The conditional sample space here still is $GG, GB, BG$, but these events are not equally likely anymore. A family with two girls is more likely to name at least one of them Lilia than a family who has only one girl ($P(L|BG)=P(L|GB)=\alpha$, $ P(L|GG)=2 \alpha-\alpha^2$), thus in this case the conditional probability of $GG$ is higher. We would like to mention here that these problems are confusing and counterintuitive to most people. So, do not be disappointed if they seem confusing to you. We seek several goals by including such problems.
First, we would like to emphasize that we should not rely too much on our intuition when solving probability problems. Intuition is useful, but at the end, we must use laws of probability to solve problems. Second, after obtaining counterintuitive results, you are encouraged to think deeply about them to explain your confusion. This thinking process can be very helpful to improve our understanding of probability. Finally, I personally think these paradoxical-looking problems make probability more interesting.
So the answer again is different from the second part of Example 1.18. This is surprising to most people. The two problem statements look very similar but the answers are completely different. This is again similar to the previous problem (please read the explanation there). The conditional sample space here still is $GG, GB, BG$, but the point here is that these are not equally likely as in Example 1.18. The probability that a randomly chosen child from a family with two girls is a girl is one, while this probability for a family who has only one girl is $\frac{1}{2}$. Thus, intuitively, the conditional probability of the outcome $GG$ in this case is higher than $GB$ and $BG$, and thus this conditional probability must be larger than one third.
Okay, another family-with-two-children problem. Just kidding! This problem has nothing to do with the two previous problems. I toss a coin repeatedly. The coin is unfair and $P(H)=p$. The game ends the first time that two consecutive heads ($HH$) or two consecutive tails ($TT$) are observed. I win if $HH$ is observed and lose if $TT$ is observed. For example if the outcome is $HTH\underline{TT}$, I lose. On the other hand, if the outcome is $THTHT\underline{HH}$, I win. Find the probability that I win.
The print version of the book is available through Amazon here .


IMAGES
VIDEO
COMMENTS
The six steps of problem solving involve problem definition, problem analysis, developing possible solutions, selecting a solution, implementing the solution and evaluating the outcome. Problem solving models are used to address issues that...
Complex problems are questions or issues that cannot be answered through simple logical procedures. They generally require abstract reasoning to be applied through multiple frames of reference.
When multiplying or dividing different bases with the same exponent, combine the bases, and keep the exponent the same. For example, X raised to the third power times Y raised to the third power becomes the product of X times Y raised to th...
Probability Explained! · An Introduction to Conditional Probability · How to solve a clever sum of sums problem · Solving some advanced probability
probability in this context is a difficult problem for a large number of people.).
Use Python to solve simple to complex probability problems. Design experiments, repeat them and calculate the probability of your favorable
Generally speaking, you count the possible results, and you count the possible results that fit your requirements, then you divide the fits by the possibles.
it more and more difficult to tell when I was working and when playing,.
Probability: Solved Examples · Example 7: Three dice are rolled together. What is the probability as getting at least one '4'? · Sol: Total number of ways = 6 × 6
This is an example of a compound probability because we are asked to tell the probability of two events. The formula for computing the compound probability is
Solved Probability Problems · 1. Probability Problems with Solutions · 2. A single card is drawn at random from a standard deck of 52 playing cards. · 3. A bag
To solve problems on this page, you should be familiar with Uniform Probability Probability - By Outcomes Probability - Rule of Sum Probability - Rule of
Finding the probability of a simple event happening is fairly straightforward: add the probabilities together. For example
I toss a coin repeatedly. The coin is unfair and P(H)=p. The game ends the first time that two consecutive heads (HH) or two consecutive tails (TT) are observed