lecture 13 - fred park - dr. fred park · math 80: elementary statistics lecture 13 dr. fred park...

118
Lecture 13

Upload: others

Post on 16-Oct-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

•  Lecture 13

Page 2: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 13

Dr. Fred Park

HW#3Chapter 2: 76, 78, 85, 90Chapter 3: 81, 85, 86, 88Chapter 4: 69, 71, 77, 79

Page 3: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 13

Dr. Fred Park

Chebyshev’s Thrm vs Empirical Rule

Chebyshev’s Thrm Empirical Rule

must be normally distr’dall distributions

Page 4: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 13

Dr. Fred Park

Create a Box-and-Whiskers Plot (Box Plot) for followingex. The life expectancy for a person living in one of 11 countriesin a region of South East Asia in 2012 is given below

Find the 5 number summary of the data and the IQR and drawa box-and-whiskers plot.Starter:variable x = life expectancy of a personsort the listcalculate approp. medians to split the data into different quartiles

Page 5: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 13

Dr. Fred Park

ex. The life expectancy for a person living in one of 11 countriesin a region of South East Asia in 2012 is given below 64 65 65 67 68 69 69 70 74 75 77

64 65 65 67 68 69 69 70 74 75 77

sorted data

median69 yrs

64 65 65 67 68 69 70 74 75 77

Q165 yrs

Q374 yrs

five number summary (in yrs):min: 64Q1: 65Median: 69Q3: 74Max: 77

Page 6: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 13

Dr. Fred Park

box-and-whiskers plot

skewed right due to tail being longer on right

Page 7: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 13

Dr. Fred Park

#R programming:

x<-c(70,67,..., 64)quantile(x)

R does things slightly different as do other booksmedian calculated diff’ly for Q1 and Q3

64 65 65 67 68 69 69 70 74 75 77

64 65 65 67 68 69 69 70 74 75 77

sorted data

median69 yrs

64 65 65 67 68 69

69 69 70 74 75 77Q1

(65+67)/2 = 66 yrsQ3(70+74)/2 = 72 yrs

5 number sum’ry (in yrs):min: 64Q1: 66Median: 69Q3: 72Max: 77

Page 8: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 13

Dr. Fred Park

%rx<-c(64,65,65,67,68,69,69,70,74,75,77)xq = quantile(x)sprintf("5 number summary = ")print(xq)boxplot(x,horizontal=TRUE,main ="Life Expectancy of Southeast Asian Countries in 2011")

R boxplot

Page 9: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 13

Dr. Fred Park

Empirical Probability

Experiment: an activity with specific results that can occur Outcomes: the results of the experimentEvent: a set of certain outcomesSample Space: the set of all possible outcomesEvent Space: the set of outcomes that make up an event

ex. Experiment: rolling a die (singular for dice)SS = {1,2,3,4,5,6}Let Event E = roll a 6Event Space = {6}Roll die 10 times

Trials for Die Experiment

Page 10: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 13

Dr. Fred Park

Trials for Die Experiment

as n increases, rel freq à fixed numberExperimental Prob = (number times event E occurs) / (total # of trials)P(E) = (number of times E occurs) / (number of trials) = 163 / 1000 = 0.163 = 16.3%note as n à infinity, Experimental Prob à Theoretical Prob

Page 11: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 13

Dr. Fred Park

Law of Large Numbersas n à infinity, Experimental Prob à Theoretical Prob Theoretical Probability:

assume all outcomes in sample space are equally likelye.g rolling a fair die, flipping non-loaded coinTheoretical Prob: if all outcomes in SS are equally likely, then P(E) = # outcomes in event space / # of outcomes in sample spaceThus just need to count to get Theoretical Prob.

Page 12: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 13

Dr. Fred Park

ex. Experiment: Flip a fair coin twiceSS = ?P(exactly 1 head) = ?P(at least one head) = ?P(heads and a tails)P(heads or a tails)=?P(foot)=?P(of each outcome)=?

Page 13: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 13

Dr. Fred Park

a) sample space SS = {HH,HT,TH,TT}

Page 14: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 13

Dr. Fred Park

Page 15: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 13

Dr. Fred Park

Page 16: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 13

Dr. Fred Park

Page 17: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 13

Dr. Fred Park

ex. Experiment Roll 2 fair dicea) what is the sample space?b) P(sum of 5)c) P(1st die = 2)d) P(sum of 7)e) P(sum of 5 and first die a 2)f) P(sum of 5 or first die a 2)g) P(sum of 5 and sum of 7)h) P(sum of 5 or sum of 7)

Page 18: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 13

Dr. Fred Park

Page 19: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 13

Dr. Fred Park

Page 20: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 13

Dr. Fred Park

Page 21: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 14

Dr. Fred Park

Page 22: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 14

Dr. Fred Park

Odds:odds in favor of event A = P(A)/P(Ac)

odds against event A = P(Ac)/P(A)

Payoff Odds against event A = (net profit) : (amount bet)

Page 23: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 14

Dr. Fred Park

In the game of Craps if a shooter has a come-out roll of a 7 or 11, it’s called a natural and the pass line wins. payoff odds given by casino as 1:1

Page 24: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 14

Dr. Fred Park

Page 25: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 14

Dr. Fred Park

Page 26: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 14

Dr. Fred Park

Conditional Probabilitycondition imposed à restrict to portion of the SSA & B two eventsP(A, given B) = P(A|B)event after vertical line = restricted SS

ex. suppose you roll 2 dice, what is the prob. of geping a sum of 5 given the first die is a 2A: sum of 5, B: first die is a 2restrict SS to all outcomes where first die is a 2R = {(2,1), (2,2), (2,3), (2,4), (2,5), (2,6)}Out of this restricted SS, way to get a sum of 5 is {(2,3)}P(sum 5| first die = 2) = 1/6

Page 27: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 14

Dr. Fred Park

ex. suppose you pick two cards from a deck. What is the prob. of drawing a Spade given that the first card is a Jack? restricted SS:R = {JS, JC, JD, JH}P(Spade|Jack) = ¼Independent Events:two events A and B are independent if the fact that one event happens does not change the prob. of the other event happeningA& B independent ifP(A|B) = P(A) and P(B|A) = P(B)

Page 28: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 14

Dr. Fred Park

A& B independent ifP(A|B) = P(A) and P(B|A) = P(B)note this is different than mutually exclusiveex. flip a single coinevent A: heads is mutually exclusive of the event B:tailsp(A and B) = 0, P(A or B) = P(A) + P(B)cannot get both heads and a tails at same time

Page 29: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 14

Dr. Fred Park

ex. flip 2 coins. outcome of first coin does not affect the outcome of second coin. Let A: event Heads on coin 1, B: event Tails on coin 2R = {HT, TT}P(A|B) = P(H on C1|T on C2 ) = 1/2P(A) = ?SS = {HT, HH, TT, TH}P(A) = 2/4 = 1/2P(A|B) = P(A and B)/P(B) = (P(A)*P(B))/P(B) = P(A)if A and B are independent

Page 30: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 14

Dr. Fred Park

Multiplication Rules:if 2 events are independent, then P(A and B) = P(A)*P(B)if 2 events are dependent, then P(A and B) = P(A)*P(A|B)In general, conditional prob formula:P(A|B) = P(A and B)/P(B)

Page 31: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 14

Dr. Fred Park

In general, conditional prob formula:P(A|B) = P(A and B)/P(B)

ex. pick 3 cards from a deck w/o replacement.P(3 Queens) = ?P(3 Queens) = P(Q on 1st and Q on 2nd and Q on 3rd)

= P(Q on 1st)*P(Q on 2nd|Q on 1st)*P(Q on 3rd|Q on 1st and 2nd) = (4/52)*(3/51)*(2/50)

= 24/132600 = 0.0001809955

Page 32: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 14

Dr. Fred Park

In general, conditional prob formula:P(A|B) = P(A and B)/P(B)

ex. pick 3 cards from a deck *with* replacement.P(3 Queens) = ?all events independentP(3 Queens) = P(Q on 1st and Q on 2nd and Q on 3rd)

= P(Q on 1st)*P(Q on 2nd)*P(Q on 3rd) = (4/52)*(4/52)*(4/52)

= 64/140608 = 0.0004551661

Page 33: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 14

Dr. Fred Park

Counting Techniques

Multiplication Rule in Counting TechniquesIf task 1 can be done m1 ways and task 2 can be done m2 ways,then the # of ways to do task 1 and 2 together would bem1*m2~’ly task 1, task 2,... task n can be done m1, m2, ..., mn waysthen # of ways to do task 1, task 2, ..., task m together would bem1*m2*...*mn

Page 34: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 14

Dr. Fred Park

ex. how many ways can you draw 3 cards without replacement from a 52 card deck?card 1 has 52 ways to be drawncard 2 has 51 ways to be drawncard 3 has 50 ways to be drawntotal # ways to draw 3 = 52*51*50 = 135200 ways

Page 35: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 14

Dr. Fred Park

Factorial:n! = n(n-1)(n-2)...(3)(2)(1)ex. 5! = 5*4*3*2*1ex. 0! = 1, 1! = 1

What if you want to select r objects from n total objects?ex. choose 3 cards out of 52ex. trying to call someone, need all #’s in right orderex. picking lopery numbers, the order doesn’t maperPermutation: arrangement of items in a specific orderuse to count items when the order mapersCombination: arrangement of items when order is not important

Page 36: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 14

Dr. Fred Park

Permutation: arrangement of items in a specific orderuse to count items when the order mapersCombination: arrangement of items when order is not importantWhen counting: ask if order of items being selected mapernPr = P(n,r) = n!/(n-r)!nCr = C(n,r) = n!/(r!(n-r)!)

Page 37: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 14

Dr. Fred Park

ex. In a club with 15 members, how many ways can a slater of 3 officers consisting of president, vice president, and secretary/treasurer be chosen?Here, order mapers. If you pick person 1 for pres., person 2 for vice-president, and person 3 for secretary/treasurer would bedifferent than if you picked person 2 for pres., person 1 for VP, and person 3 for secretary/treasurer.P(15,3) = 15!/(15-3)! = 15!/12! = 2730

Page 38: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 14

Dr. Fred Park

ex. Suppose you want to pick 7 out of 20 people to take partin a survey. How many ways can you do this?order doesn’t maper since you just need 7 people. This is a combination problem.C(20,7) = 20!/(7!(20-7)!) = 20!/(7!13!) = 77520

Page 39: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

Page 40: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

Discrete Probability Distributions

x: random variable. for now, x is a quantitative variable measured from an experiment Probability Distribution: is an assignment of probabilitiesto the values of a random variableprobability distribution function (pdf) is a function form of this assignmentIf P(x) represents a prob. distribution, then

Page 41: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

Probability Distribution: is an assignment of probabilities to the values of a random variable

ex. Household Size from 2010 US census

random variable x = size of household (discrete)above is a prob. distr. since have random variable and prob’s. assoc’d to it.

Page 42: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

ex. Household Size from 2010 US census

plot of prob dist = histogram of relative freq’s for large sample

Page 43: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

In general, pdf represents the entire population

The expected value = mean of the populationThis is the value you expect to get if trials for experiment were repeated infinitely many times

The meanor expected value

The variance

The StandardDeviation

x: value of random variableP(x): prob. corresp. to x value

Page 44: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

ex. Household Size from 2010 US census

find the mean, variance, and stdv?a. mean?

µ = 2.518

Thus, you expect a household to have between 2 and 3 peoplewith slightly more 3 people households vs 2

Page 45: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

b. variance?

sum last row to get variance

σ2 = 2.0033357 people2

c. Standard Deviation?

σ = (2.0033357 people2)1/2 = 1.42 people

Page 46: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

ex. In the Arizona Lopery called pick 3, a player pays $1 and thenpicks a 3-digit number. If those numbers are picked in a specific orderthe person wins $500. What is the expected value in this game?

Page 47: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

ex. In the Arizona Lopery called pick 3, a player pays $1 and thenpicks a 3-digit number. If those numbers are picked in a specific orderthe person wins $500. What is the expected value in this game?digits 0-9P(win) = (1/10)(1/10)(1/10) = .001P(lose) = 1-.001 = 0.999

expected value = $0.499 + (-$0.999) = -$0.50. So you will lose $0.50 in the long runnot a fair game since expected value is not 0Arizona makes money

Page 48: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

Rare Event Rule for Inferential StatisticsIf, under a given assumption, the probability of a particular observedevent is extremely small, then you can conclude that the assumption is probably not correctex. Suppose you roll a fair die 1000 times and get a six 600 times,when you should have rolled a six 160 times, then you should believe yourassumption about a fair die is incorrect

Guidelines:if P(x or more successes) < 0.05 à event is unusualif P(x or fewer successes) < 0.05 à event is unusual

Page 49: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

Guidelines:if P(x or more successes) < 0.05 à event is unusualif P(x or fewer successes) < 0.05 à event is unusual

random variable = x = household sizeIs it unusual for a household to have 6 people in the family?P(x<= 6) = p(x=1) + ... p(x=6) = 98.5% > 5% à not unusually lowP(x>=6) = p(x=6)+p(x>=7) = 2.4% + 1.4% = 3.8% < 5% à unusually high valuei.e. 6 people is unusually high value for a household

Page 50: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

Binomial Probability Distributioncertain types of experiments allow you to calculate the theoretical prob.in general, you cannot do this.One is called the Binomial Experiment

Properties of a binomial experiment (Bernoulli trial):1.  Fixed # of trials, n. i.e. experiment is repeated fixed # of times2.  n trials are indep. i.e. one trial does not influence another3.  only 2 outcomes, success and failure4.  prob of a success doesn’t change from trial to trial, p = prob of success and q = prob of failure. q = 1-p.real life examples:toss a fair coin 100 times and find p(heads)shoot 5 arrows at a target and find prob of hiping it 5 times

Page 51: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

ex. Suppose you are given a 3 question multiple choice test. Each quest.has 4 responses and only 1 is correct. Suppose you want to findP(guess at answers and get 2 questions right). Test is in an unknown language to make sure that you are going to guess.a.  what is the random variable?b.  is this a binomial experiment?c.  what is the prob of geping 2 questions right?

Page 52: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

ex. Suppose you are given a 3 question multiple choice test. Each quest.has 4 responses and only 1 is correct. Suppose you want to findP(guess at answers and get 2 questions right). Test is in an unknown language to make sure that you are going to guess.a.  what is the random variable?x = number of correct questions

Page 53: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

ex. Suppose you are given a 3 question multiple choice test. Each quest.has 4 responses and only 1 is correct. Suppose you want to findP(guess at answers and get 2 questions right). Test is in an unknown language to make sure that you are going to guess.b. is this a binomial exp?1.  fixed # of trials = 3 since there are 3 questions. each question is a trial.2.  geping 1st quest right has no bearing on others so trials are indep.3.  2 outcomes: right or wrong4.  p(quest right) = ¼ same for every trial since each quest has 4 responses5.  p = ¼, q = 1-1/4 = 3/4

Page 54: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

ex. Suppose you are given a 3 question multiple choice test. Each quest.has 4 responses and only 1 is correct. Suppose you want to findP(guess at answers and get 2 questions right). Test is in an unknown language to make sure that you are going to guess.c. P(2 quests right) = ?SS = {RRR, RRW, RWR, WRR, WWR, WRW, RWW, WWW}event space for 2 right = {RRW, RWR, WRR}can’t just divide 3/8consider P(RRW) = P(R on 1st, R on 2nd, and W on 3rd)since trials indep,P(RRW) = P(R on 1st)*P(R on 2nd)*P(W on 3rd) = p*p*q = (1/4)*(1/4)*(3/4) = (1/4)2(3/4)1This is same for P(RWR) and P(WRR)Thus, P(2 correct) = P(RRW) + P(RWR) + P(WRR) = 3*((1/4)2(3/4)1)

Page 55: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

ex. Suppose you are given a 3 question multiple choice test. Each quest.has 4 responses and only 1 is correct. Suppose you want to findP(guess at answers and get 2 questions right). Test is in an unknown language to make sure that you are going to guess.d. P(0 right)? P(1 right)? P(3 right)?

Page 56: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

Page 57: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

Page 58: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

Page 59: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

Page 60: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

Page 61: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 15

Dr. Fred Park

Page 62: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 16

Dr. Fred Park

Using R to compute binomial prob’s.n: number of trialsp: probability of successwant to find P(x=r), P(x<=r), and P(x>=r)note: P(x>=r) = 1 – P(x<=r-1)(x>=r and x<r or x<=r-1 are complimentary)

Page 63: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 16

Dr. Fred Park

Back to eye color problem where 1% of people have green eyes.We consider a group of 20 peoplex = rand var’ble = # of people with green eyesfind P(none have green eyes)same as finding P(x=0) use dbinom commanddbinom(x=r, size=n, prob=p)> dbinom(0, size=20, prob=0.01)[1] 0.8179069so 81.8% is prob that in a group of 20 people, none will have green eyes

Page 64: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 16

Dr. Fred Park

P(nine have green eyes)P(x=9)dbinom(x=r, size=n, prob=p)

> dbinom(9, size=20, prob=0.01)[1] 1.50381e-13small prob that out of 20, 9 will have green eyes

Page 65: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 16

Dr. Fred Park

P(at most 3 will have green eyes)P(x<=3)use pbinompbinom(x=r, size=n, prob=p)cumulative prob distrib. fctn

> pbinom(3, size=20, prob=0.01)[1] 0.9999574so in group of 20, high chance at most 3 will have green eyes

Page 66: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 16

Dr. Fred Park

P(at most 2 will have green eyes)P(x<=2)use pdbinomdbinom(x=r, size=n, prob=p)cumulative prob distrib. fctn

> pbinom(x=2, size=20, prob=0.01)[1] 0.9989964so in group of 20, high chance at most 2 will have green eyes

Page 67: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 16

Dr. Fred Park

P(at least 4 will have green eyes)P(x>=4)use pdbinom and complimentdbinom(x=r, size=n, prob=p)cumulative prob distrib. fctnP(x>=4) = 1-P(x<=3)> 1-pbinom(3, size=20, prob=0.01)[1] 4.262093e-05so in group of 20, low chance at least 4 will have green eyes

Page 68: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 16

Dr. Fred Park

According to the Center for Disease Control (CDC), about 1 in 88 children in the U.S. have been diagnosed with autism (2013). Suppose you have a group of 10 children.a)  state the random variableb) argue this is a binomial experimentc)  find prob that none have autismd) seven have autisme)  at least 5 have autismf)  at most 2 have autismg) Suppose 5 out of 10 have autism, is this unusual?

Use binomial prob formula and check your work in R!

Page 69: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 16

Dr. Fred Park

According to the Center for Disease Control (CDC), about 1 in 88 children inthe U.S. have been diagnosed with autism (2013). Suppose you have a group of 10 children.a)  state the random variable. x = # children with autismb)  argue this is a binomial experiment

i. 10 childen, each is a trial, fixed number of trials = 10ii. trials are indep since children chosen at randomiii. either a child has autism or doesn’t. success = child has autism in this experimentiv. prob of a child having autism = 1/88. p = 1/88 and 1 = 1-1/88 = 87/88

Page 70: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

According to the Center for Disease Control (CDC), about 1 in 88 children inthe U.S. have been diagnosed with autism (2013). Suppose you have a group of 10 children.a)  find prob that none have autism

R:> dbinom(0, size=10, prob=1/88)[1] 0.892002

a)  seven have autism

R:> dbinom(7, size=10, prob=1/88)[1] 2.837346e-12

Math 80: Elementary StatisticsLecture 16

Dr. Fred Park

Page 71: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 16

Dr. Fred Park

According to the Center for Disease Control (CDC), about 1 in 88 children inthe U.S. have been diagnosed with autism (2013). Suppose you have a group of 10 children.a)  at least 5 have autism

R:> 1-pbinom(4, size=10, prob=1/88)[1] 4.553416e-08

Page 72: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 16

Dr. Fred Park

According to the Center for Disease Control (CDC), about 1 in 88 children inthe U.S. have been diagnosed with autism (2013). Suppose you have a group of 10 children.f) at most 2 have autismR: > pbinom(2, size=10, prob=1/88)[1] 0.9998341

Page 73: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 16

Dr. Fred Park

According to the Center for Disease Control (CDC), about 1 in 88 children inthe U.S. have been diagnosed with autism (2013). Suppose you have a group of 10 children.g) Suppose 5 out of 10 have autism, is this unusual?

Page 74: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 16

Dr. Fred Park

According to the Center for Disease Control (CDC), about 1 in 88 children inthe U.S. have been diagnosed with autism (2013). Suppose you have a group of 10 children.a)  state the random variableb)  argue this is a binomial experimentc)  find prob that none have autismd)  seven have autisme)  at least 5 have autismf)  at most 2 have autismg)  Suppose 5 out of 10 have autism, is this unusual?

Use binomial prob formula and check your work in R!

Page 75: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 16

Dr. Fred Park

Mean and Standard Deviation of Binomial DistributionIf you list all the values of x in a Binomial Distribution, you getthe Binomial Probability Distribution (pdf)You can histogram it, find the mean, variance, and stdv

usually use:

Binomial Distr. is easier!

Page 76: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 16

Dr. Fred Park

Consider 1% of people have green eyes and choose 20 peoplelet x = number of people who have green eyes prob distribution looks like

histogram. skewed right

Page 77: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 16

Dr. Fred Park

mean = ?

variance, stdv = ?

Page 78: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 16

Dr. Fred Park

Page 79: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 17

Dr. Fred Park

Page 80: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 17

Dr. Fred Park

Continuous Probability Distributions

previous: prob distributions from discrete data e.g. coin flipnow: prob dist’s from continuous data

Uniform Distributions:Situation where probability is always the sameex. waiting for a commuter train

waiting times for regional transit authority (RTA) in Cleveland Ohiohave waiting times of 10 minutes during peak hours.avg. wait time for train = anywhere from 0 to 10 mins.

Prob. of waiting any number of minutes in that interval is the same.

Page 81: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 17

Dr. Fred Park

ex. waiting for a commuter train

waiting times for regional transit authority (RTA) in Cleveland Ohiohave waiting times of 10 minutes during peak hours.avg. wait time for train = anywhere from 0 to 10 mins.

Prob. of waiting any number of minutes in that interval is the same.

Page 82: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 17

Dr. Fred Park

quest: what is prob. that you wait between 5 and 10 mins for next train?

calculus à wait time is area under the curve

length = 10-5 = 5, height = 0.1

P(5<x<10) = length*height = 0.1*5 = 0.5

x: waiting time during peak hours

Page 83: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 17

Dr. Fred Park

ex. The commuter trains on the Blue and Green lines for the Metropolitan Transit Authority (MTA) in Los Angeles duringpeak rush hour periods of 10 mins.a)  State the random variable?b)  Find the prob. that you have to wait between 4 and 6 mins for a train?c)  Find the prob. that you have to wait bet. 3 and 7 mins for a train?d)  Find prob. that you have to wait between 0 and 10 mins for a train?e)  Find prob. that you have to wait exactly 5 mins?

Page 84: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 17

Dr. Fred Park

ex. The commuter trains on the Blue and Green lines for the Metropolitan Transit Authority (MTA) in Los Angeles duringpeak rush hour periods of 10 mins.a)  State the random variable?x = waiting time during peak hours

b) Find the prob. that you have to wait between 4 and 6 mins for a train?P(4<x<6) = (6-4)*0.1 = 0.2

c) Find the prob. that you have to wait bet. 3 and 7 mins for a train?P(3<x<7) = (7-3)*0.1 = 0.4

d) Find prob. that you have to wait between 0 and 10 mins for a train?P(0<x<10) = (10-0)*0.1e) Find prob. that you have to wait exactly 5 mins?

Page 85: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 17

Dr. Fred Park

e) Find prob. that you have to wait exactly 5 mins? P(x=5) = 0*0.1 = 0

Note that P(0<x<10) = 1In general, height of uniform dist. that ranges between a and bis 1/(b-a)

Page 86: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 17

Dr. Fred Park

Normal Distributions:

Many real life problems produce a histogram that is-symmetric-unimodal (single mode)-bell shaped continuous prob. distribution.e.g. height, blood pressure, cholesterol levelNot all bell shaped curves are NormalNormal curves have a relationship between its height and width

Page 87: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 17

Dr. Fred ParkTypical Normal Distribution

•  Center or highest point = pop’n mean µ•  Transition points (inflection pts. from calc.) change in concavity distance from mean to transition point is 1 standard deviation σ•  Area under the whole curve is 1. Thus, area below or above the mean is 0.5

Page 88: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 17

Dr. Fred ParkTypical Normal Distribution

Page 89: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 17

Dr. Fred ParkTypical Normal Distribution

Empirical Rule:

Page 90: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 17

Dr. Fred Park

Empirical Rule just an approx.To find area under the curve, you need calculus or ability to approx. it. (Later)z-score: measure of how many standard deviations an x value is from the mean.

z-score is normally distributed with a mean of 0 and stdv of 1It is known as the standard normal curve.Way of standardizing a normal curve

Page 91: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 17

Dr. Fred Park

z-score is normally distributed with a mean of 0 and stdv of 1It is known as the standard normal curve.Way of standardizing a normal curve

Page 92: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 18

Dr. Fred Park

General Normal Distribution

ex. Length of Human Pregnancy is normally dist’d with mean 272 days and standard deviation 9 daysa)  state random variableb)  find P(x>280)c)  find P(x<250)d)  find P(265<x<280)e)  find length of pregnancy that 10% of all pregnancies last less thanf)  suppose you meet a woman who says she was pregnant for less than 250 days, is this unusual?

Page 93: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 18

Dr. Fred ParkGeneral Normal Distribution

ex. Length of Human Pregnancy is normally dist’d with mean 272 days and standard deviation 9 daysa)  state random variable: x = length of human pregnancyb)  find P(x>280) i.e. prob that pregnancy lasts more than 280 days

use R!!> pnorm(280, mean=272, sd=9, lower.tail = FALSE )> 0.1870314Thus P(x>280) = 18.7%

ß prob is area under curve for values >280

Page 94: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 18

Dr. Fred ParkGeneral Normal Distribution

b) find P(x>280) i.e. prob that pregnancy lasts more than 280 days

use R!!> pnorm(280, mean=272, sd=9, lower.tail = FALSE )> 0.1870314Thus P(x>280) = 18.7%

ß prob is area under curve for values >280

Page 95: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 18

Dr. Fred Park

General Normal Distribution

ex. Length of Human Pregnancy is normally dist’d with mean 272 days and standard deviation 9 daysc) find P(x<250)

Use R!!> pnorm(250, mean=272, sd=9, lower.tail = TRUE)> 0.00725377112486782so 7/10 of 1%

Page 96: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 18

Dr. Fred Park

General Normal Distribution

ex. Length of Human Pregnancy is normally dist’d with mean 272 days and standard deviation 9 daysd) find P(265<x<280)

R!> pnorm(280,mean=272,sd=9)-pnorm(265,mean=272,sd=9)[1] 0.5946186or 59.5% of all pregnancies lie between 265 and 280 days

Page 97: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 18

Dr. Fred Park

General Normal Distribution

validate the empirical rule for this distribution

inverse normal distribution operator

Page 98: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 18

Dr. Fred Park

General Normal Distribution

ex. Length of Human Pregnancy is normally dist’d with mean 272 days and standard deviation 9 dayse) find length of pregnancy that 10% of all pregnancies last less than.

use R!!!!> qnorm(0.10, mean=272, sd=9)[1] 260.466

inverse normal distribution operator

Page 99: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 18

Dr. Fred Park

General Normal Distribution

ex. Length of Human Pregnancy is normally dist’d with mean 272 days and standard deviation 9 daysf)  suppose you meet a woman who says she was pregnant for less than 250 days, is this unusual?from part c) the probability a pregnancy lasts < 250 daysis 0.73%. Since this is less than 5%, it is very unusual. à either premature baby or wrong about actual date of impregnation/conception

Page 100: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 18

Dr. Fred Park

class exercise:In the United States, males between the ages of 40 and 49 eat on average 103.1 gof fat every day with a standard deviation of 4.32 g ("What we eat," 2012).Assume that the amount of fat a person eats is normally distributed.a.) State the random variable.b.) Find the probability that a man age 40-49 in the U.S. eats more than 110 g offat every day.c.) Find the probability that a man age 40-49 in the U.S. eats less than 93 g of fatevery day.d.) Find the probability that a man age 40-49 in the U.S. eats less than 65 g of fatevery day.e.) If you found a man age 40-49 in the U.S. who says he eats less than 65 g of fatevery day, would you believe him? Why or why not?f.) What daily fat level do 5% of all men age 40-49 in the U.S. eat more than?

Page 101: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 18

Dr. Fred Park

class ex

The mean starting salary for nurses is $67,694 nationally ("Staff nurse -," 2013).The standard deviation is approximately $10,333. Assume that the starting salaryis normally distributed.a.) State the random variable.b.) Find the probability that a starting nurse will make more than $80,000.c.) Find the probability that a starting nurse will make less than $60,000.d.) Find the probability that a starting nurse will make between $55,000 and$72,000.e.) If a nurse made less than $50,000, would you think the nurse was under paid?Why or why not?f.) What salary do 30% of all nurses make more than?

Page 102: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 19

Dr. Fred Park

HW#4ch 4: 82, 89, 90, 92ch 5: 60, 61, 68, 69, 74, 78

Page 103: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 19

Dr. Fred Park

How to Determine if a Distribution is Normal?

Systematic approach:•  Histogram: for larger samples, should be bell shaped•  Outliers: normal dist. à not more than 1 outlier

Outliers are values that are: -Above Q3 by amount > 1.5*IQR -Below Q1 by amount < 1.5*IQRIQR = Interquartile Range

•  Normal Probability Plot: Plot via R where data should be linear checking normality by seeing if it follows normal dist. papern

Page 104: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 19

Dr. Fred Park

Checking Normality

ex. Kiama blowhole in Australia. Look at times between eruptions in secs:

a)  state the random variable?x = time between eruptions of Kiama Blowhole

Page 105: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 19

Dr. Fred Park

b) draw a histogramUse 7 bins/classesR:> x <- c(83, 51, 87, 60, 28, 95, 8, 27,15, 10, 18, 16, 29, 54, 91, 8,17, 55, 10, 35, 47, 77, 36, 17,21, 36, 18, 40, 10, 7, 34, 27,28, 56, 8, 25, 68, 146, 89, 18,73, 69, 9, 37, 10, 82, 29, 8,60, 61, 61, 18, 169, 25, 8, 26,11, 83, 11, 42, 17, 14, 9, 12)> hist(x,nclass=7)

looks skewed right and notsymmetric

Page 106: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 19

Dr. Fred Park

c) find number of outliers?R:> qt = quantile(x)IQR = qt[4]-qt[2]Q1 = qt[2]; Q3 = qt[4];out_rg1 = Q1-1.5*IQRout_rg2 = Q3+1.5*IQR

sprintf("Q1-1.5*IQR = %2.2f", out_rg1)sprintf("Q3+1.5*IQR = %2.2f", out_rg2)

x_out = (x<out_rg2)xp = x[x_out]

sprintf("number of x > out_rg2 = %2.2f", sum(x>out_rg2))sprintf("number of xp > out_rg2 = %2.2f", sum(xp>out_rg2))

xp1 = x[x<out_rg1]xp2 = x[x>out_rg2]

print(xp1) #outliers below 1.5*Q1print(xp2) #outliers above 1.5*Q3

output: 0% 25% 50% 75% 100% 7.00 14.75 28.00 60.00 169.00 'IQR = 45.25''1.5*IQR = 67.88''Q1-1.5*IQR = -53.12‘'number of x > out_rg2 = 2.00''number of xp > out_rg2 = 0.00'numeric(0)[1] 146 169

Page 107: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 19

Dr. Fred Park

normal probability plot

use R!> qqnorm(x)

norm prob plotnot-linear, more than 1 outlierà not normal

e) do data come from normal dist?not likely.

Page 108: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 19

Dr. Fred Park

ex. IQ scores50 IQ scores. Does sample come from a pop’n thatis normally distributed?

a)  state random variable? x = IQ score.b)  draw a histogram?c)  find # of outliersd)  draw normal prob plote)  do data come from pop’n that is normally dist’d?

Page 109: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 19

Dr. Fred Park

use R!

#print(x<out_rg2)x_out = (x<out_rg2)xp = x[x_out]#print(xp)sprintf("number of x > out_rg2 = %2.2f", sum(x>out_rg2))sprintf("number of xp > out_rg2 = %2.2f", sum(xp>out_rg2))xp1 = x[x<out_rg1]xp2 = x[x>out_rg2]print(xp1) #outliers below 1.5*Q1print(xp2) #outliers above 1.5*Q3qqnorm(x)

%rx<-c(78, 92, 96, 100, 67, 105, 109, 75, 127, 111,93, 114, 82, 100, 125, 67, 94, 74, 81, 98,102, 108, 81, 96, 103, 91, 90, 96, 86, 92,84, 92, 90, 103, 115, 93, 85, 116, 87, 106,85, 88, 106, 104, 102, 98, 116, 107, 102, 89)

hist(x, nclass = 7)qt = quantile(x)print(qt)IQR = qt[4]-qt[2]sprintf("IQR = %2.2f", IQR)Q1 = qt[2]; Q3 = qt[4];sprintf("1.5*IQR = %2.2f", 1.5*IQR)out_rg1 = Q1-1.5*IQRout_rg2 = Q3+1.5*IQRsprintf("Q1-1.5*IQR = %2.2f", out_rg1)sprintf("Q3+1.5*IQR = %2.2f", out_rg2)

Page 110: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 19

Dr. Fred Park

output 0% 25% 50% 75% 100% 67.00 87.25 96.00 104.75 127.00 'IQR = 17.50''1.5*IQR = 26.25''Q1-1.5*IQR = 61.00''Q3+1.5*IQR = 131.00''number of x > out_rg2 = 0.00''number of xp > out_rg2 = 0.00'numeric(0) numeric(0)

hist à looks bell shaped, symmetricnormal plot à looks linear

no outliers

outcome: sample comes from normally distributed population!

Page 111: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 19

Dr. Fred Park

class exercise:The WHO MONICA Project collected blood pressure data for people in China(Kuulasmaa, Hense & Tolonen, 1998). Data based on information from the studyis in the table below. Determine if the data is from a population that is normallydistributed.

blood pressure values for people in China

hint: use R!

Page 112: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 19

Dr. Fred Park

Sampling Distribution and the Central Limit Theorem

Statistical Inference: to make accurate decisions about parameters from statistics

previously: need to know distribution e.g. binomial/normal etc. to makeaccurate decisions

Sampling Distribution: how a sample statistic is distributed whenrepeated trials of size n are taken

Here, what is the distribution of a statistic taken from samplese.g. how are the means of samples distributed?

Page 113: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 19

Dr. Fred Park

ex. Throw a coin and count how often a heads comes up.random variable x = number of headsprob. dist. (pdf) of this random variable is below

repeat this 10 times (n=10). data looks like:{1,1,1,1,0,0,0,0,0,0}: mean of sample = 0.4{1,1,1,0,1,0,1,1,0,0}: mean = 0.6{0,1,0,1,1,1,1,1,0,1}: mean = 0.7

sample means when n=10

Page 114: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 19

Dr. Fred Park

sampling means

dist’n. of sample meanshistogram of sample means

what if n increases?looks somewhat normali.e. sample means normally dist’d.

Page 115: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 19

Dr. Fred Park

n=20sample means

dist. of sample means histogram of sample means

looks normal!

Page 116: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 19

Dr. Fred Park

what happens as n increases?

main point: sample mean follows a normal dist’n. as n increases!

Page 117: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 19

Dr. Fred Park

ex. The birth weight of boy babies of European descent who were delivered at 40 weeksis normally distributed with a mean of 3687.6 g with a standard deviation of 410.5 g(Janssen, Thiessen, Klein, Whitfield, MacNab & Cullis-Kuhl, 2007). Suppose therewere nine European descent boy babies born on a given day and the mean birthweight is calculated.

a)  random variable = x = birth weight of boy babies.b)  what is the mean of the sample mean?

Page 118: Lecture 13 - Fred Park - Dr. Fred Park · Math 80: Elementary Statistics Lecture 13 Dr. Fred Park Empirical Probability Experiment: an activity with specific results that can occur

Math 80: Elementary StatisticsLecture 19

Dr. Fred Park

ex. The birth weight of boy babies of European descent who were delivered at 40 weeksis normally distributed with a mean of 3687.6 g with a standard deviation of 410.5 g(Janssen, Thiessen, Klein, Whitfield, MacNab & Cullis-Kuhl, 2007). Suppose therewere nine European descent boy babies born on a given day and the mean birthweight is calculated.