Ch 16 Random Variables AP Statistics halfway through
Ch. 16 Random Variables AP Statistics – halfway through Unit 4
Vocab! • Random variable = value is based on random outcome – Discrete Random Variable – all outcomes can be specifically listed – Continuous Random Variable – range of outcomes • Probability Model = all possible values and the probabilities that they occur • E(X) = expected value (or mean) of a random variable x = μ = Σx. P(x)
Example • Jill has athletes foot. On a tube of Tinactin, she sees that it resolves cases of athletes foot 79% of the time after 2 weeks of use, twice per day. One tube costs $6. 99 and will last for the entire treatment cycle. If that fails, then she can see her doctor for $20 and get a prescription treatment for $15, which will resolve the problem. a) Define the random variable and construct the probability model. Outcome X = cost Probability Tinactin works __________ _______ b) What is the expected value of the cost of this remedy? Hint: Σx. P(x) c) What does (b) mean in this context?
Example • Jill has athletes foot. On a tube of Tinactin, she sees that it resolves cases of athletes foot 79% of the time after 2 weeks of use, twice per day. One tube costs $6. 99 and will last for the entire treatment cycle. If that fails, then she can see her doctor for $20 and get a prescription treatment for $15, which will resolve the problem. a) Define the random variable and construct the probability model. Outcome X = cost Probability Tinactin works $6. 99 0. 79 Doctor visit and prescription $6. 99+ $20 + $15 0. 21 b) What is the expected value of the cost of this remedy? Hint: Σx. P(x) 6. 99(0. 79) + 41. 99(0. 21) = $14. 34 c) What does (b) mean in this context? Athletes Foot sufferers will spend an average of $14. 34 on treatment.
Standard Deviation & Variance of Probability Model • Standard deviation – Deviation = x – μ recall μ = Σx. P(x) – Variation = square deviation = Σ(x-μ)2 P(x) = σ2 = Var (x) – Square root (Var(x)) = standard deviation = σ = SD (x) • Example: Outcome X = cost Probability Tinactin $6. 99 0. 79 MD visit & Rx $6. 99 + $20 + $15 0. 21 Variation for model: (-7. 35)2(0. 79)+27. 652(0. 21)=203. 2275 SD for model: 14. 26 Deviation 6. 99 – 14. 34=-7. 35 41. 99 – 14. 34 =27. 65
TI Variance and SD • L 1(cost): 6. 99, 41. 99 • L 2(P): 0. 79, 0. 21 • STAT CALC – 1 -Var. Stats • L 1, L 2 • Mean, SD (though mislabeled – YOU need to be wiser than your machine and not use x-bar)
Transformations… (again) • + or – by constant: shift mean, but doesn’t mod variance, SD E(X + c) = E(X) + c Var(X + c) = Var (X) • x or divide by constant: x mean by constant, x variance by square of constant E(a. X) = a. E(X) Var(a. X) = a 2 Var(X) • More than one person? – Expected value of sum = sum of Expected Values E(X + Y) = E(X) + E(Y) * Note that we would only multiply 2 E(X) if the two X are dependent, meaning EXACTLY the same… That’s why most of the time we will add. – Addition Rule of Variances: Variance of sum of 2 indep. random var. s = sum of their indiv. Variances Var (X + Y) = Var(X) + Var(Y) SD 2(X + Y) = SD 2(X) + SD 2(Y) * Standard deviations don’t add – variations do. * Even if looking at difference btwn variations, always add them.
Example • The time it takes for a customer to get and pay for seats at a movie theatre is a random variable with a mean of 100 seconds and a SD of 50 seconds. When you get there, you find 2 people in front of you. a) How long do you expect to wait to get your ticket? b) What’s the SD of your wait time? c) What assumption did you make about the two customers in finding the SD?
Example • The time it takes for a customer to get and pay for seats at a movie theatre is a random variable with a mean of 100 seconds and a SD of 50 seconds. When you get there, you find 2 people in front of you. a) How long do you expect to wait to get your ticket? 100 + 100 = 200 seconds b) What’s the SD of your wait time? square root (502 + 502) = 70. 7 seconds c) What assumption did you make about the two customers in finding the SD? The times for the 2 customers are independent.
Working with Continuous Random Variables • Can’t use a table for this Prob Model – can’t list each outcome. • Use Normal Model (if possible) – Must pass Normality Assumption • Unimodal, symmetric – When 2 independent continuous random var. s have Normal models, so does their sum or difference. • P isn’t for a discrete outcome, but for an interval of outcomes – P = area under curve
Example: Continuous Random Vars At a doctor’s office: - Time for medical assistant to meet with you can be described by a Normal model with a mean of 12 minutes and standard deviation of 2 minutes. - Time for doctor to meet with you can be described by a Normal model with a mean of 10 minutes and a standard deviation of 1 minute. a. P that med assistant meeting with two consecutive patients takes over 25 minutes? Let P 1 = time for assistant to meet with patient 1 Let P 2 = time for assistant to meet with patient 2 Let T = total time for meeting with both patients; T = P 1 + P 2 Check: meet Normality Assumption? 2 times independent? E(T) = E (P 1 + P 2) E(T) = E(P 1) + E(P 2) E(T) = 12 + 12 = 24 minutes Var (T) = Var (P 1 + P 2) Var (T) = Var (P 1) + Var(P 2) Var (T) = 22 + 22 = 8 minutes SD = 2. 83 minutes Model of N(24, 2. 83). Let’s draw it! Label mean, draw z (below) and shade for answer. z = (25 – 24) / 2. 83 = 0. 35 P(T>25) = P(z>0. 35) = 0. 3632 I used my table. There is about 36. 32% chance that it will take over 25 minutes for a med assistant to meet two patients.
Example: Continuous Random Vars At a doctor’s office: - Time for medical assistant to meet with you can be described by a Normal model with a mean of 12 minutes and standard deviation of 2 minutes. - Time for doctor to meet with you can be described by a Normal model with a mean of 10 minutes and a standard deviation of 1 minute. a. What percentage of patients take longer to meet with the med. asst. than to meet with the doctor? Let M = time for patient to meet with assistant Let D = time for patient to meet with doctor Let F = difference between time to meet assistant and doctor; F = M – D E(F) = E(M – D) E(F) = E(M) – E(D) E(F) = 12 – 10 = 2 minutes Var (F) = Var(M – D) Var (F) = Var(M) + Var (D) ALWAYS ADD VARs Var (F) = 22 + 12 = 5 minute SD (F) = 2. 236 minute Normal model (2, 2. 236). Let’s draw it! Label mean, draw z (below) and shade for answer. Use 0 as difference if it did not take longer (this is a cutoff) z = (0 - 2) / 2. 236 = -0. 8945 P(F > 0) = P(z>-0. 8945) = 0. 7995 About 79. 95% of patients meet with medical assistants longer than with doctors.
- Slides: 12