# chapter 5 Review

A $$\textbf{random phenomenon}$$ is a situation where we know what outcomes $$could$$ happen but we dont know in what order they did or will happen
But we can calculate the probability with which each of those outcomes could occur.
people are bad at identifying random samples so we rely on coin flips or random number tables to simulate randomness.
Say if you want to simulate randomnes using a random number table and simulate rolling a die 10 times. In this example we choose a random line say 30, recall that for a die there 6 possible outcomes 1-6, so in the table eliminate any numbers greater 6. Read left to right and you get a series of numbers. This is an example of simulating randomness.
Randomness to Probability
Say you have an itunes library of 1000 songs and there are 5 iron maiden songs in it. what is the probability that when you hit shuffle you get an iron maiden song? $$\frac{5}{1000}=0.005$$
Definitions of Probability
A $$\textbf{frequentist}$$: The probability of an event is its long-run relative frequency.
Theoretical: we may not be able to predict which song we get each time we hit shuffle, but we know in the long run of the library, 5 out of 1000 will be iron maiden songs.
Empirical: Listen to 100 songs on shuffle and 4 of them are iron maiden songs. empirical probability is then 4/100=0.04
a $$\textbf{bayesian}$$:
we wont use much in this class

## Definitions of Probability

for any random phenomenon, each attempt is called a $$\textbf{trial}$$ and each trial generates an outcome.
$$\textbf{outcome}$$
Each time you hit shuffle, thats a trial
The songs that plays as a result of the shuffle is an outcome
A $$\textbf{sample space}$$ is the collection of all possible $$\textbf{outcomes}$$ of a trial
Sample space would be the 1000 itunes songs
a comination of outcomes is called an $$\textbf{event}$$
for example, playing 2 iron maiden songs in a row
$$\textbf{Sample Space}$$
a couple has two kids, what is the sample space for the gender of the kids?
Well there are 4 possibilities S=BB,BG,GB,GG
The probability that both will be boys is 0.25.
$$\textbf{Independence}$$
when thinking about what occurs with combinations of outcomes, things are simplifies if the individual trials are independent

• This means that the outcome of one event doesnt influence the outcome or change the next outcome.

• If the itunes shuffle is really random then each of the songs played are independent

example for coing toss
trial: Each coin toss outcome: Heads or tails
probability: P(h)=P(t)=0.5
each time we flip we dont know which side will come up but in the long run, the probabilities will be 0.50 for each side.
sample space:
tossed once: s=h,t
tossed twice:s=hh,tt,ht,th
$$\textbf{Law of Large Numbers}$$

• The law of large numbers says that the long run relative frequency of repeated indpendent events gets closer and closer to the true relative frequency as the number of trails increases.

• if a coin is tossed many times, the overall percentage will settile down to about 50$$\%$$ as the umber of tosses increases

• this is why probability is defined as a long run relative frequency event

$$\textbf{Impossibility to a certainty}$$
probabilities must be between 0 and 1. 0 means impossible and 1 is certainty.
$$\textbf{Compliment Rule}$$
Set of ourcomes that are not in the event A is called the compliment of A, denoted $$A^C$$. The probability of an event occuring is 1-Probability(it doesnt occur).
$Prob(A^C)=1-Prob(A)$ $$\textbf{Disjoint Events}$$
Events that have no outcomes in common are called disjoint( or mutually exclusive). Examples:
The outcome of a coing toss cant be a head and a tail. so disjoint
student cant fail and pass an exam:disjoint
$$\textbf{Addition Rule}$$
for two disjoint events A and B (think like heads and tails for coins), the probability that one $$\textbf{OR}$$ the other occurs is the sum of the two probabilies. $Prob(A or B)=P(A)+P(B)$ $$\textbf{Multiplication Rule}$$
For two independent events A and B, the probability that both A $$\textbf{AND}$$ B occur is the product of the individual events together. $Prob(A and B)=Prob(A)Prob(B)$
$$\textbf{Examples}$$
In a multiple choice exam there are 5 questions and 4 choices for each question (a, b, c, d). Nancy has not studied for the exam at all, and decided to randomly guess the answers. What is the probability that she gets the first question right?
0.25
What is the probability that she gets the second question right?
0.25
What is the probability that the first question she gets right is the 5th question?
if she get just the fifth one right that means the first 4 were wrong and the last one was right. so that is $$(0.75)^4*0.25=0.0791$$
What is the probability that she gets all the questions right?
$$(0.25)^5=0.0010$$
What is the probability that the first question she gets at least one question right?
They are asking for at least once question right so using the compliment rule, which is to say 1-probability(none right)=1-probability(all wrong)=$$1-(0.75)^5=0.7627$$
$$\textbf{Independent vs Disjoint}$$
can two events be independent and disjoint?
Remember independence means that the outcome of an event doesnt influence the outcome of another event. Disjoint means no outcomes in common like not being able to have heads or tails. If we know that the outcome of a coin toss was head, we know its not tails. So whether or not the outcome is tails it $$\textbf{depends}$$ on whether or not the outcomes was heads. so that would be called disjoint and dependent.

• disjoint events cannot be independent

• since we know that disjoints have no outcomes in common, then we know if one occured, the other didnt.

• just because two events can occur at the same time doesnt mean they need to be dependent.

• two students can get an A in a class but they may not have studied together etc

• if you did study together and both got As then your grade could be dependent

$$\textbf{Examples}$$
A middle school estimates that 20$$\%$$ of its students miss one day of school per semester due to sickness, 13$$\%$$ miss two days, and 5$$\%$$ miss three or more days. What is the probability that a student chosen at random doesn’t miss any days of school due to sickness?
Not missing any school is the compliment of missing all days. so $$prob(no misses)=1-(0.20+0.13+0.05)=0.62$$
What is the probability that a student chosen at random misses no more than one day?
$$prob(at most 1 day)=Prob(no misses)+prob(1 miss)=0.82$$
If a parent has two kids at this middle school, what is the probability that neither will miss any school?
$$prob(neither miss any)=(prob(no miss))^2$$=0.3844
We used the multiplication rule to calculate the probability in the previous example.
a) What must be true about these kids to make that approach valid?
independence.
b) Do you think this assumption is reasonable?
yes.
what is the probability that one kid misses some school and the other doesn’t miss any?
Prob(one misses some school)=prob(1 kid misses some school and the other doesnt)+prob(1st kid doesnt miss any school and the 2nd does)=0.38*0.62+0.62*0.38)=0.4712

$$\textbf{general addition rule}$$
If A and B are disjoint,$Prob(A or B)=prob(A)+prob(B)$
If A and B are not disjoint(independent) $prob (A or B)=Prob(A)+prob(B)-prob(A and B)$

$$\textbf{Example}$$
In a class where everyone’s native language is English, 70$$\%$$ of students speak Spanish, 45$$\%$$ speak French as a second language and 20$$\%$$ speak both. Assume that there are no students who speak another second language. What is the probability that a randomly selected students speaks Spanish or French?
This is independent because its students who speak spanish or french, those dont effect each other. by the general addition rule then, $$prob(Spanish or French)=prob(spanish)+prob(french)-prob(both)=.70+.45-.20=0.95$$

$$\textbf{Conditional Probability}$$
Bayes theorem: $Prob(A\vert B)=\frac{Prob(A and B)}{Prob(B)}$
Say you have a chart that has smokers and there sex amd the total people were 1691. if people who smoke are 421 and female are 234 of the smokers a question could be, what is the probability that a randomly chosen smoker is female?
This follows what bayes theorem is saying. probabilities of A given B. In this example we have the probability of find smokers given they are female form. so $prob(F\vert S)=\frac{234/1691}{421/1691}=234/421$ this is something we could have guessed but it could get trickier.

$$\textbf{back to missing school example}$$
What is the probability that a randomly selected student speaks French given that they speak Spanish?
$$prob(F \vert S)= Prob(F and S)/prob(S)=.20/.70=0.29$$
Check professors notes for burger example.
$$\textbf{General Multiplication Rule}$$
If A and B are independent, $Prob(A and B)=Prob(A)*Prob(B)$
If A and B do not need to be independent, $Prob( A and B)=Prob(A\vert B)*Prob(B)$
$$\textbf{ONLY ASSUME INDEPENDENCE IF THE QUESTION SPECFIES IT OR YOU CHECKED FOR YOURSELF}$$
$$\textbf{Checking For Independence using conditional probabilities}$$
if $$Prob(A)=Prob(A \vert B)$$ then the events are independent.
$$\textbf{Independent vs disjoint-recap}$$
if A and B are disjoint:

• Prob(A and B)=0

• A and B are not independent

If A and B are not disjoint:

• Prob(A and B)$$>$$0

• A and B may or not be independent