0. Logistical Info
- Section date: 9/27
- Associated lectures: 9/19, 9/21
- Associated pset: Pset 3, due 9/29
- Office hours on 9/27 from 7-9pm at Quincy Dining Hall
- Remember to fill out the attendance form
- Scroll to section 4 for a concise content summary.
0.1 Summary + Practice Problem PDFs
Summary + Practice Problems PDF
Practice Problem Solutions PDF
1. Examples from class
The lecture on 9/19 was full of examples of conditional probability. Here are my takeaways for each. I did not rewrite the examples because solutions are quite well-written in the book and/or in lecture.
1.1 Winter girl (Examples 2.2.5-2.2.7 in the book)
- Define your events as specifically as possible, there are a lot of details that surprisingly can change probabilities.
- See if you can simplify your events (both mathematically and logically). For example, if
is the event that there’s at least one girl and is the event that there are two girls, since if there are two girls, there is automatically at least one girls.
1.2 Monty Hall (Example 2.7.1 and many practice problems in the book)
You can use the Law of Total Probability in some extreme ways! Condition on things that make your life much, much easier - in Monty Hall problems (and the variants that Joe likes to write), I very often condition on the location of the car or use Bayes’ rule to move information about the car’s location into the condition!
1.3 Simpson’s paradox (Example 2.8.3 in the book)
I think it’s a good to develop the skill of coming up with similar paradoxes - at the very least, it can test your understanding of probability. My understanding of this phenomenon is that there are two tasks - a hard and an easy task. Doctor A might have a better success rate in each task, but Doctor B can still have a higher overall success rate.
This happens because Doctor A does more of the harder task, which drags their average down, while Doctor B inflates their average by doing the easier task more often. There are some other intuitive corollaries - like how some students may learn a lot but have lower GPAs then other students because they take a higher proportion of challenging classes.
To construct these paradoxes, I think you need a hard task (where both doctors have a “low” success rate) and an easy task (where both doctors have a higher success rate). Then doctor A has to do more of the hard task, while doctor B needs to do more of the easy task, to weight their averages differently.
1.4 Gambler’s ruin (Example 2.7.3 in the book)
You will be assessed (in pset and/or exam) on your ability to apply the gambler’s ruin result in other contexts, but you will never have to re-derive it. So you can figure out how variables in your problem correspond to gambler’s ruin (or even set up the difference equation) then just jump to plugging in the solution given.
In the gambler’s ruin problem, gambler
If we define
To match a problem to this, you should
- Make sure that “bets” are worth 1 dollar each.
- Make sure that gambler
loses if they hit 0 dollars, and wins if they hit some fixed amount of dollars ( ) - Make sure there is a constant probability of winning each bet.
2. Random variables
2.1 Definition
A random variable summarizes some experiment. So if you have a sample space
- Say we’re rolling a die, so
is the set of possible rolls. Then we could have if we roll a , if we roll a , and so on. - We could define another random variable
to be the square of the roll. so if we roll a 1, if we roll a , etc. - Random variables don’t have to take on different values for every outcome. So we could have
if we roll an even number and if we roll an odd number. - They also don’t have to be discrete values - we could have a random variable
represent the exact temperature in the room right now.
2.2 Defining discrete random variables
A random variable is discrete if it has a finite or countably infinite number of values (something like
We can uniquely describe a random variable by its probability mass function. This basically tells us the probability that the random variable takes on each possible value. For example, the probability mass function for the first dice-roll example,
Some important facts:
- “
” is an event, so we can take its probability. We cannot take the probability of a random variable, so is a category error. - When writing a PMF
- Every probability should be between
and (inclusive), which holds for all probabilities. - The probabilities in the PMF should sum to
: This comes from both axioms of probability, since the events for each possible value of partition the entire sample space. - I always have the “
, else” statement.
- Every probability should be between
- The support of a random variable is the set of possible values it can take on. So the support for
is , and the support for is , and so on. You should always define the support, too.
2.3 A more mathy definition of random variables
Random variables are functions. If notation makes more sense to you, maybe this will be useful.
Remember that in any random experiment, we have a sample space
So when we think about PMFs and any probabilities with random variables, we’re using a bit of shorthand. It’s not immediately obvious that
So when we start talking about fancier random varibles - like
The support can also now be redefined as the function - basically, the support is
3. Distributions
A distribution is a type of random variable. I think this makes the most sense through example. For discrete distributions (which correspond to discrete random variables), we usually motivate them with a story and maybe some counting. Stories are extremely important and should be internalized, not just the PMFs.
3.1 Bernoulli Distribution
You perform an experiment that consists of
The PMF is
For a concrete example, a rigged coin toss has a probability
Note that you CANNOT set a random variable equal to a distribution. You have to use the
3.2 Binomial Distribution
You perform an experiment with
We can find the PMF with some counting:
NOTE: a Binomial random variable
4. Summary
4.1 Examples from class
Some takeaways:
- Define events very specifically (winter girl)
- See if you can simplify your problems with logic, not just relying on grinding through math (winter girl)
- Use the Law of Total Probability to condition on anything/everything you wish you knew
- In Monty Hall, you can often condition on the location of the car!
- To mimic Simpson’s paradox, set up some “hard” and “easy” tasks and make the better doctor do more of the hard tasks
- Learn how to turn a problem into the gambler’s ruin problem:
- Make losing happen at
, and winning happen at some fixed - Make sure each bet/step is only one dollar in either direction
- Make sure the probability of winning each individual bet is constant
- Make losing happen at
4.2 Random variables
Random variables are a numerical (real number) summary of the outcome of your experiment. So for each possible outcome, the random variable takes on a certain value. Multiple outcomes can lead to the same value of the random variable. The support of a random variable is the set of possible values it can take on.
We define discrete random variables by their probability mass function. You should define the probability
4.3 Distributions
- Bernoulli distribution: you conduct a single trial that succeeds with probability
. if the trial succeeds and if it fails. Then and has a PMF - Binomial distribution: you conducts
independent trials that each succeed with probability . is the total number of successes among the trials. Then and the PMF is