Lecture 8
2020-07-16
Serena DeStefani – Lecture 9 – 7/16/2020
Trial
Outcome
Event
Sample Space
Trial
Outcome
Event
Sample Space
The Law of Large Numbers states that for many trials, the proportion of times an event occurs settles down to one number.
This number is called the empirical probability.
Wrong
American Roulette
Theoretical Probability
\[P(A) = \frac{\text{\# of outcomes in } A}{\text{\# of possible outcomes}}\]
\[P(\text{red}) = \frac{18}{38}\]

Rule 1: \(0 \le P(A) \le 1\)
That’s how we define probability
Rule 2: \(P(S) = 1\)
The set of all possible outcomes has probability 1
The Rule of Complements: \(P(A^C) = 1 - P(A)\)
\(A^C\) is the event of “A not happening”.

Disjoint

Independent and Dependent


Disjoint events:
But what if two events overlap? They can be either independent or dependent

| Disjoint | Overlapping | |
|---|---|---|
| Dependent | YES | YES |
| Independent | DOES NOT EXIST | YES |
Suppose \(P(\text{sophomore}) = 0.2\) and \(P(\text{junior}) = 0.3\)
The Addition Rule
\[P(A \text{ OR } B) = P(A) + P(B)\]

The probability that an Atlanta to Houston flight is on time is 0.85.
Multiplication Rule: For independent events A and B:
\[P(A \text{ AND } B) = P(A) \times P(B)\]
\[\begin{align} P(\text{1st on time AND 2nd on time}) &= P(\text{1st on time}) \times P(\text{2nd on time}) \\ &= 0.85 \times 0.85 \\ &= 0.7225 \end{align}\]
Find the probability that the light will be red on Monday, green on Tuesday, and yellow on Wednesday.
\[\begin{align} &P(\text{red Mon. AND green Tues. AND yellow Wed.}) \\ &= P(\text{red Mon.}) \times P(\text{green Tues.}) \times P(\text{yellow Wed.}) \\ &= 0.61 \times 0.35 \times 0.04 \\ &= 0.00854 \end{align}\]
Your Wallet

\[P(A \text{ or } B) = P(A) + P(B) - P(A \text{ and } B)\]
\(P(\text{odd amount or bill with a building})\)
\(= P(A) + P(B) - P(A \text{ and } B)\)
\(= P(\{\$1, \$5\}) + P(\{\$5, \$10, \$20, \$50, \$100\}) - P(\{\$5\})\)


Events
Calculations
\[\begin{align} P(R \text{ or } S) &= P(R) + P(S) - P(R \text{ and } S) \\ &= 0.33 + 0.25 - 0.11 \\ &= 0.47 \end{align}\]
Conclusion
\(P(\text{not in relationship and no sports})\)
\(P(\text{in a relationship but no sports})\)
\(P(\text{in a relationship or involved in sports but not both})\)

33% in a relationship, 25% involved in sports, 11% both
Conditional probability. Probability of B Given A:
\[P(B \mid A) = \frac{P(A \text{ and } B)}{P(A)}\]
| DEFINITIONS | OR: ADDITION (more general, P goes up) \(P(A \text{ or } B) =\) | AND: MULTIPLICATION (more restrictive, P goes down) \(P(A \text{ and } B) =\) |
|---|---|---|
| Disjoint dependent (mutually exclusive) \(P(A \text{ and } B) = 0\) | Addition rule: \(P(A) + P(B)\) because \(P(A \text{ and } B) = 0\) | NA |
| Overlapping independent \(P(A \text{ and } B) = P(A) \times P(B)\), \(P(B \mid A) = P(B)\), \(P(A \mid B) = P(A)\) | General addition rule: \(P(A) + P(B) - P(A \text{ and } B)\). If specified as exclusionary: \(P(A) + P(B) - 2P(A \text{ and } B)\) | Multiplication rule: \(P(A) \times P(B)\) because \(P(B \mid A) = P(B)\), \(P(A \mid B) = P(A)\) |
| Overlapping dependent \(P(A \text{ and } B) \ne P(A) \times P(B)\), \(P(B \mid A) \ne P(B)\), \(P(A \mid B) \ne P(A)\) | General addition rule: \(P(A) + P(B) - P(A \text{ and } B)\). If specified as exclusionary: \(P(A) + P(B) - 2P(A \text{ and } B)\) | General multiplication rule: \(P(A) \times P(B \mid A)\), \(P(B) \times P(A \mid B)\) |

A random variable, X, is a variable whose possible values are the numerical outcomes of a random phenomenon.
A random variable assumes a value based on the outcome of such random event.
There are two types of random variables:
Usually (but not necessarily) counts.
If a random variable can take only a finite number of distinct values, then it must be discrete.
Examples:
The probability distribution of a discrete random variable is a list of probabilities associated with each of its possible values.
It is also sometimes called the probability model or probability function.
Suppose a discrete variable X can take the values 1, 2, 3, or 4.
The probabilities associated with each disjoint outcome are described by the following table:
What’s the probability that X is equal to 2 or 3?
It is the sum of the two probabilities:

\[P(X = 2 \text{ or } X = 3) = P(X = 2) + P(X = 3) = 0.3 + 0.4 = 0.7\]
What’s the probability that X is greater than 1?
It is equal to \(1 - P(X = 1) = 1 - 0.1 = 0.9\), by the complement rule.
A probability model for a random variable consists of:

Of particular interest is the value we expect a random variable to take on, notated \(\mu\) (for population mean) or \(E(X)\) for expected value.
When we looked at a dataset, we calculated the sample mean (\(\bar{X}\)) as average.
Formulas for population mean and sample mean are different…
The expected value of a (discrete) random variable can be found by summing the products of each possible value by the probability that it occurs:
\[\mu = E(X) = \sum x \cdot P(x)\]
\[E(X) = (1 \times 0.1)+(2 \times 0.3)+(3 \times 0.4)+(4 \times 0.2)\]
We sum the values weighted by their probabilities (or relative frequencies)

The sample mean is an average. It varies from sample to sample.
The population mean is a sum of values weighted by their probabilities. It does not vary
Imagine you have a fair die. Knowing all the possible outcomes and their probabilities, we can calculate E(X):
\[E(X) = 1 \times 1/6 + 2 \times 1/6 + ... 6 \times 1/6 = 3.5\]
This number is constant.
Now imagine that you roll the die 10 times obtaining: {5,6,4,5,3,2,1,2,4,6}
The sample mean, for this specific sample, is 3.8.
Imagine that you take another sample; this time the mean is 3.4. You keep taking samples and calculating the mean; ultimately the mean of the means will converge to 3.5.
For data, we calculated the sample variance by first computing the deviation from the mean, then squaring it and averaging it.
\[s^2 = \frac{\sum (y - \bar{y})^2}{n - 1}\]
The sample standard deviation is the square root of the sample variance
→ The standard deviation expresses the average distance from the mean
\[s = \sqrt{\frac{\sum (y - \bar{y})^2}{n - 1}}\]
The population variance for a random variable is:
\[\sigma^2 = Var(X) = \sum (x - \mu)^2 \cdot P(x)\]
The standard deviation for a random variable is:
\[\sigma = SD(X) = \sqrt{Var(X)}\]
Formulas for population variance and sample variance are different.
Adding or subtracting a constant from data shifts the mean but doesn’t change the variance or standard deviation:
\[E(X \pm c) = E(X) \pm c \qquad Var(X \pm c) = Var(X)\]
Random variables that can take on any value in a range of values are called continuous random variables.
Random variables that can take on any value in a range of values are called continuous random variables.
The fact that we are talking about any value has some consequences.
Let’s take a step back, looking at a discrete distribution again.
Which is bigger, \(P(X = 1 \text{ or } X = 2)\) or \(P(X = 3 \text{ or } X = 4)\)?
We can think about probability as an area.

Random variables that can take on any value in a range of values are called continuous random variables.
We can think about probability as an area under a curve…
Any value → any single value won’t have a probability!
But continuous random variables do have means (expected values) and variances.


Don’t assume everything’s Normal.
Probability models are still just models.
If the model is wrong, so is everything else.
You’re collecting cards from cereal boxes. You don’t care about completing the whole card collection, but you’ve just got to have the blue card.
How many boxes do you expect you’ll have to open before you find the blue card?

We’ll keep the assumption that cards are distributed at random and we’ll trust the manufacturer’s claim that 20% of the cards are blue.
So, when you open the box, the probability that you succeed in finding blue card is 0.20. Now we’ll call the act of opening each box a trial, and note that:
There are only two possible outcomes (called success and failure) on each trial. Either you get the blue card (success), or you don’t (failure).
The probability of success, denoted p, is the same on every trial. Here p = 0.20.
The trials are independent. Finding the blue card in the first box does not change what might happen when you reach for the next box.
Situations like this occur often and are called Bernoulli trials.
\[E(Y) = \frac{1}{0.2} = 5 \text{ boxes}\]
Not easy to prove!
We want to model how long it will take to achieve the first success in a series of Bernoulli trials.
The model that tells us this probability is called the Geometric probability model.
\[P(X = x) = q^{x-1} p\]
Expected value: \(E(X) = \mu = \dfrac{1}{p}\)
Standard deviation: \(\sigma = \sqrt{\dfrac{q}{p^2}}\)
One of the important requirements for Bernoulli trials is that the trials be independent.
The 10% Condition: Bernoulli trials must be independent. If that assumption is violated, it is still okay to proceed as long as the sample is smaller than 10% of the population.
6% of all people are O−, Universal Donors.
Mechanics: Calculate probability that X = 1, 2, 3, 4
\[E(X) = \frac{1}{0.06} \approx 16.7\]
\[P(X \le 4) = P(X = 1) + P(X = 2) + P(X = 3) + P(X = 4)\]
\[= (0.06) + (0.94)(0.06) + (0.94)^2(0.06) + (0.94)^3(0.06)\]
\[\approx 0.2193\]
Conclusion: Blood drives such as this one expect to examine an average of 16.7 people to find a universal donor. About 22% of the time there will be one within the first 4 people in line.
A Binomial probability model describes the number of successes in a specified number of trials.
It takes two parameters to specify this model: the number of trials n and the probability of success p.
\[P(X = x) = {}_{n}C_{x}\, p^x q^{n-x}, \qquad {}_{n}C_{x} = \frac{n!}{x!(n-x)!}\]
Mean: \(\mu = np\)
Standard deviation: \(\sigma = \sqrt{npq}\)
\[P(x) = \frac{n!}{(n-x)!\,x!}\, p^x q^{n-x}\]
\[P(3) = \frac{4!}{(4-3)!\,3!}\, (.5)^3 (.5)^{(4-3)}\]
\[P(3) = \frac{(4)(3)(2)(1)}{(1)(3)(2)(1)}\, (.5)(.5)(.5)(.5)\]
\[P(3) = \frac{4}{16} = .25\]
6% of all people are O−. If 20 donate at the blood drive, find the mean and sd of the number of universal donors and find the probability that 2 or 3 are O−.
6% of all people are O−. If 20 donate at the blood drive, find the mean and sd of # of universal donors and find the probability that 2 or 3 are O−.
Mechanics:
\[\text{Mean} = np = (20)(0.06) = 1.2\]
\[SD = \sqrt{npq} = \sqrt{(20)(0.06)(0.94)} \approx 1.06\]
\[\begin{align} P(X = 2 \text{ or } 3) &= P(X = 2) + P(X = 3) \\ &= {}_{20}C_{2}\,(0.06)^2 (0.94)^{18} + {}_{20}C_{3}\,(0.06)^3 (0.94)^{17} \\ &= 0.2246 + 0.0860 \\ &= 0.3106 \end{align}\]
6% of all people are O−. If 20 donate at the blood drive, find the mean and sd of # of universal donors and find the probability that 2 or 3 are O−.
The Tennessee Red Cross has 32,000 donors and needs at least 1850 that are O−. Will they run out?
\[SD = \sqrt{npq} \approx 42.48\]
The Tennessee Red Cross has 32,000 donors and needs at least 1850 that are O−. Will they run out (less than)?
Mean \(= np = 1920 \qquad SD = \sqrt{npq} \approx 42.48\)
The normal model with the same mean and standard deviation is a very good approximation.
\[P(X < 1850) \approx P\left(z < \frac{1850 - 1920}{42.48}\right) \approx P(z < -1.65) \approx 0.05\]
The Success/Failure Condition

Only 151 of 1422 emails got through your spam filter. Might the filter be too aggressive?

\[P(X \le 151) \approx P\left(z \le \frac{151 - 127.98}{10.79}\right) \approx P(z \le 2.13) \approx 0.9834\]
Be sure you have Bernoulli Trials.
Don’t confuse Geometric and Binomial models.
Don’t use the normal approximation for small n.
Don’t assume everything is Normal. There are many other continuous probability models: Uniform, Exponential, Chi-Square etc.


Quantitative Methods in Psychology