Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sections 5-1 & 5-2 Random Variables.

Similar presentations


Presentation on theme: "Sections 5-1 & 5-2 Random Variables."— Presentation transcript:

1 Sections 5-1 & 5-2 Random Variables

2 Overview In this chapter, we combine probability with the statistics we were doing before. We will describe what could happen instead of what actually did happen.

3 Definition A random variable is a variable (similar to a data value) that measures the number of times a certain outcome happens. A random variable is a quantitative variable whose value depends on chance.

4 Definitions Discrete Variable
variable where the number of possible values is either a finite number or a ‘countable’ number of possible values. 0, 1, 2, 3, . . . Example: The number of eggs that hens lay, the number of cars on the street, the cost of college textbooks, etc. Usually whole numbers or money. *We will deal with discrete variables in this chapter.

5 Definitions Continuous Variable
variable which has infinitely many possible values that correspond to some continuous scale that covers a range of values without gaps, interruptions, or jumps. 2 3 Example: The amount of milk that a cow produces is gallons per day, the weight of the supermodel is lbs, etc. Distance, Weight, and Height are ALWAYS continuous. We will deal with continuous variables in the next chapter.

6 Example Let's say that the experiment is to flip a coin twice and see how many times you flip heads. Let the random variable x = number of heads that appear in 2 flips of the coin List the sample space and the corresponding values of the random variable x. See next slide

7 Example Let the random variable x = number of heads that appear in 2 flips of the coin List the sample space and the corresponding values of the random variable x. S={HH, HT, TH, TT} Because our variable x = the number of heads that appear in 2 flips of the coin, then x = 2 for HH x = 1 for HT x = 1 for TH x = 0 for TT Since x can only be a whole number, this is a discrete variable.

8 Definition A probability distribution gives the probability for each value of the random variable. When collecting data, you want to know what events can happen, but MORE importantly, you need to know how LIKELY each event is to happen.

9 Probability Distribution
Let the random variable x = number of heads that appear in 2 flips of the coin S={HH, HT, TH, TT} x can be 0, 1, or 2 heads. We list each possibility with the probability that it will happen to create a probability distribution. x P(x) 1/4 = 0.25 1 2/4 = 0.5 2 Out of the 4 possibilities: one has 0 heads, two have 1 head, one has 2 heads

10 Graphs The probability histogram is very similar to a relative frequency histogram, but the vertical scale shows probabilities.

11 Requirements for Probability Distribution
P(x) = 1 all probabilities must add up to 1 0  P(x)  1 each probability must be valid (between 0 and 1)

12 What does that mean??? The first requirement is that the sum of all the probabilities must equal 1. If you were to go back to the table, and add up all the probabilities on the right hand side, they would total one. This comes from our rules from probability. If the probabilities do not add up to one, you do not have a probability distribution. At times, the probabilities might add up to or something close to that. Assume that is one--it could be off a little because of rounding.

13 What does that mean??? The second requirement implies that each separate probability must be between 0 and 1 for any value of x. Again, this comes from probability rules. All probability values fall between 0 and 1. If any one of the probability values for x does not fall between 0 and 1, you do not have a probability distribution.

14 Example X P(X) 0.2 1 0.5 2 0.4 3 0.3 X P(X) 1/4 1 2/4 2 Using the two requirements we just learned, are these tables probability distributions?

15 X P(X) 0.2 1 0.5 2 0.4 3 0.3 X P(X) 1/4 1 2/4 2 Notice in both tables, all P(x) values are between 0 and 1. In the first table, they are represented by fractions, but if to change to decimals, they would be between 0 and 1. The second requirement is fulfilled in each table. Checking the first requirement: In the first table, those four fractions add up to 1: ( = 1). In the 2nd table, ( = 1.4) the probabilities do not total 1, but instead total 1.4. Hence, Table 1 is a probability distribution, but Table 2 is not.

16 Using Addition Rule with Probability Distributions
x P(x) 0.23 1 0.41 2 0.29 3 0.01 4 0.03 5 0.02 6 P(less than 3) = P(more than 4) = P(2 < x < 6) = P(2 ≤ x ≤ 6) = See following slides for solutions

17 Using Addition Rule with Probability Distributions
x P(x) 0.23 1 0.41 2 0.29 3 0.01 4 0.03 5 0.02 6 P(less than 3) = P(0) + P(1) + P(2) = = 0.93 or 93% (add together the probabilities for all x-values smaller than 3) P(more than 4) = P(5) + P(6) = = 0.03 or 3%

18 Using Addition Rule with Probability Distributions
x P(x) 0.23 1 0.41 2 0.29 3 0.01 4 0.03 5 0.02 6 P(2 < x < 6) = P(3) + P(4) + P(5) = = 0.06 or 6% (does not include 2 or 6) P(2 ≤ x ≤ 6) = P(2) + P(3) + P(4) + P(5) + P(6) = = 0.36 or 36% (does include 2 and 6)

19 Mean and Standard Deviation of a Probability Distribution
Note that we are making inferences about probabilities in the population, so we use the population symbols. This says to multiply each x by its probability, and then add up those answers. Note: You are not responsible for knowing the standard deviation formula. We will be using the calculator.

20 Calculator Mean and St Dev of Prob Distribution
Create two lists (STAT, 1: Edit): One list for the left column and one for the right column of the probability distribution table. Let’s use the table in our slides about # heads when flipping 2 coins.) Once you have created your lists, go to 1-Var Stats. (STAT,  CALC) Type L1, L2 then hit enter. (Remember to type in the correct lists. Yours might be different then L1, L2) OR with newer calculators:

21 Calculator Mean and St Dev of Prob Distribution
The calculator uses for µ. This is σ So the mean is 1.0 and the standard deviation is On average, you expect 1.0 head when you flip a coin twice, with a standard deviation of 0.7 from that.

22 Identifying Unusual Results
Range Rule of Thumb As before, our general rule is that usual results will lie within 2 standard deviations of the mean. We can therefore identify “unusual” values by determining if they lie outside these limits: Maximum usual value = μ + 2σ Minimum usual value = μ – 2σ

23 Expected Value The expected value is the average value if you keep trying indefinitely. For discrete probability distributions, this is the same as the mean. We use the Classical Approach for Equally Likely Outcomes when possible. If necessary we can estimate the expected value based on finite tries (Relative Frequency Approximation), and the more tries the more accurate. Note: expected value is the expected average, not what we expect to have happen most often.

24 Example There are 300 raffle tickets sold for $2 each. If your ticket is drawn you win $100. What is your expected gain? First, set up a probability distribution for your profit.

25 Solution There are 2 possibilities for profit. If you win, you leave $98 richer. (Win $100, but the ticket cost $2) If you lose, you leave $2 poorer (because you paid $2 for the ticket.)

26 Solution (continued) Create a probability distribution with
x = profit, given that you have 1 chance of winning and 299 chances of losing. x P(x) $ /300 -$ /300 The mean of this distribution is 98(1/300) + (-2)(299/300) = -$ So you expect to lose an average of $1.67 per ticket you buy. (If you could play the raffle over and over indefinitely.)

27 Binomial Probability Distributions
Section 5-3 Binomial Probability Distributions

28 Binomial Distribution
In the last section we discussed probability distributions. In this section we will be focusing on one specific type: Binomial Distribution

29 Definitions A binomial probability distribution results from an experiment in which: 1. The procedure has a fixed number of trials. 2. Each trial must have all outcomes classified into two categories. 3. The trials must be independent. (One result doesn’t affect what happens next time.) 4. For each trial, the probability of success is the same.

30 See next slides for solutions
Example Determine if the following meet the requirements for a binomial probability distribution Flipping a coin 100 times B. Flipping a coin until the first head appears C. Rolling a die 60 times D. Genders of 3 children E. Recording the ethnicity for 200 students in a particular degree program. See next slides for solutions

31 Solution Determine if the following meet the requirements for a binomial probability distribution Flipping a coin 100 times There are a fixed number of trials (100) There are two possible outcomes (a head or a tail) Each flip of a coin is independent from the next (getting heads on one flip does not affect the chance of getting heads on the next flip) The probability of heads or tails is the same each time (the probability of getting a head on the 1st flip is the same as it is on the 100th flip) You would get a Binomial Probability Distribution

32 Solution Determine if the following meet the requirements for a binomial probability distribution B. Flipping a coin until the first head appears There are not a fixed number of trials! Not a Binomial Probability Distribution

33 Solution Determine if the following meet the requirements for a binomial probability distribution C. Rolling a die 60 times There are a fixed number of trials (60) There are not two outcomes (you could roll a 1, 2, 3, 4, 5, or 6) Not a Binomial Probability Distribution

34 Solution Determine if the following meet the requirements for a binomial probability distribution D. Genders of 3 children There are a fixed number of trials (3) There are two possible outcomes on each trial (either a boy or a girl) Each birth is independent of the next The chance of boy or girl is the same each time You would get a Binomial Probability Distribution

35 Solution Determine if the following meet the requirements for a binomial probability distribution Recording the ethnicity for 200 students in a particular degree program. There are a fixed number of trials (200) There are not two possible outcomes (there are more than two ethnicities) This is not a Binomial Probability Distribution

36 Notation for Binomial Probability Distributions
If what we are looking for happens, that is a success (S) and if not you have failure (F). P(S) = p (p = probability of success) P(F) = 1 – p = q (q = probability of failure) Note: The probability of a success does not necessarily mean something good. For example, if I wanted to find the probability of deaths from hang-gliding, our “success” would be deaths.

37 Notation n denotes the number of fixed trials.
x total # of successes you are interested in p denotes the probability of success in one trial q denotes the probability of failure in one trial P(x) denotes the probability of getting exactly x successes among the n trials.

38 Important Hint **x counts successes and p is the probability of success, so x and p must both refer to the same outcome.**

39 Example Tossing a coin 100 times and counting heads.
S = flipping heads x = the number of heads in 100 flips n = 100 (total number of trials) p = ½ = 0.5 (the probability of ONE success, so the probability of flipping a head in one toss)

40 P(x) = • px • qn-x Binomial Probability Formula n ! (n – x)!x!
for x = 0, 1, 2, . . ., n This formula is very cumbersome, so we will be using our calculators instead.

41 Calculator Function to find P(x)
Binomial Prob. Dist. Calculator Function to find P(x) Push 2nd VARS to open the DISTR menu. Scroll down to 0: binompdf (Numbering may be different on the TI-84) Binompdf computes the probability of EXACTLY x successes, P(x).

42 Calculator Continued binompdf(
will appear on your screen. The format for this function is binompdf(n, p, x). Enter the values of n, p, and the x you are asking about, with commas in between, and the right parenthesis. Then press ENTER. Or, with the newer TI-84’s, you’ll get a nice screen that asks you to fill in these values. See next slide for an example.

43 Example If the number of trials is 100 and the probability of a success on any one of the trials is 0.5, compute the probability of getting 40 successes. n = 100 (number of trials) p = 0.5 x = 40 P(40) = binompdf(100, 0.5, 40) = Because this is a probability we round to 3 significant digits, so P(40) =

44 Round to 3 significant digits, so P(3) = 0.0154
Example A die is rolled 4 times. Find the probability of getting three 1’s. (Note: we can count this as two outcomes if we define success as getting a 1, and failure as not getting a 1.) n = 4 p = 1/6 x = 3 P(3) = binompdf(4, 1/6, 3) = Round to 3 significant digits, so P(3) =

45 Cumulative Binomial The calculator function binompdf gives the probability that x equals a given value. But in the last section we saw that often we want the probability that a value is more or less than a given number. The binomial cumulative distribution formula adds up the probabilities of each x from 0 up to the one you are looking at, to give you P(x or less). You find “binomcdf” on your calculator just as you would for “binompdf”, but it is one below it. See next slide.

46 Binomial Cumulative Dist. Calculator Function to find
P(x or less) Push 2nd VARS to open distribution menu. Scroll down until binomcdf Binomcdf computes the probability of the random variable x being LESS THAN OR EQUAL TO to a particular number, P(x or less).

47 Calculator Continued Once you hit “2nd Vars” choose “A” which is binomcdf not binompdf. (Again, numbering may be different on the TI-84.) binomcdf( will appear on your screen. As before, enter n, p, and x with commas in between, and then press ENTER. (Again, with the newer TI-84’s, you may get a nice screen that asks you to fill in these three values.) See next example.

48 See next slides for solutions
Example Curtis accidentally walked into the LSAT instead of the ACT. He randomly guessed on all 30 questions in the first section. Each question was a multiple choice question with 5 possible answers. Will this produce a binomial probability distribution? What is the probability that he got 20 correct? What is the probability that he got at most 20 correct? What is the probability that he got at least 20 correct? See next slides for solutions

49 Solution Curtis accidentally walked into the LSAT instead of the ACT. He randomly guessed on all 30 questions in the first section. Each question was a multiple choice question with 5 possible answers. Will this produce a binomial probability distribution? Yes. There are 30 trials, with two possibilities on each: correct or incorrect. The probability on each question of being correct is 1/5 = 0.2

50 Solution Remember to round to 3 significant digits!
Curtis accidentally walked into the LSAT instead of the ACT. He randomly guessed on all 30 questions in the first section. Each question was a multiple choice question with 5 possible answers. What is the probability that he got 20 correct? EXACTLY 20, so binompdf P(20) = binompdf(30, 0.2, 20) = E-8 Note: This is calculator notation for scientific notation, x Move the decimal point 8 to the left and round. P(20) = Remember to round to 3 significant digits!

51 Solution Curtis accidentally walked into the LSAT instead of the ACT. He randomly guessed on all 30 questions in the first section. Each question was a multiple choice question with 5 possible answers. What is the probability that he got at most 20 correct? Not exactly 20, but 20 OR LESS, so binomcdf. P(20 or less) = binomcdf(30, 0.2, 20) = Note: exception to the rounding rule. Don’t round when it would round up to 1, because this is misleading. A probability of 1 would indicate that this will certainly happen, which is not the case.

52 Solution Curtis accidentally walked into the LSAT instead of the ACT. He randomly guessed on all 30 questions in the first section. Each question was a multiple choice question with 5 possible answers. What is the probability that he got at least 20 correct? Pay attention to this one! We need P(20 or more), but we don’t have a calculator function that does P(x or more). We must adjust it a bit. We can use complements to help us. “20 or more” would be the complement of “19 or less”. So P(20 or more) = 1 – P(19 or less) = 1 – binomcdf(30, 0.2, 19) =

53 Mean, Variance, and Standard Deviation for the Binomial Distribution
Section 5-4 Mean, Variance, and Standard Deviation for the Binomial Distribution

54 Example Let’s say you flip a fair coin 4 times and count the number of heads. Compute the mean and standard deviation for the number of heads in 4 flips.

55 Solution First find n, p, and x
n = 4 (total number of trials) p = 0.5 (1 in 2 chance in getting a head on each flip) x = the number of heads that occur on four flips

56 This would take some time!
Using our information from section 5-2, if we wanted to find the mean and standard deviation of this probability distribution, it would be quite a task. The next slide shows everything we would have to do. First, find the probability of each using binompdf. Then plug the two lists into our calculator, and then find the mean and standard deviation. This would take some time! But luckily, we have a formula that will make it a lot simpler and faster.

57 The Long Way x P(x) 1 2 3 4 binompdf(4,.5,0) =.0625
binompdf(4,.5,0) =.0625 1 binompdf(4,.5,1) = .250 2 binompdf(4,.5,2) = .375 3 binompdf(4,.5,3) = .250 4 binompdf(4,.5,4) =.0625

58 Binomial Distribution: Formulas
In the case of binomial distributions, we have formulas that make life easier. Mean µ = n • p Std. Dev.  = n • p • q Where n = number of fixed trials p = probability of success in one of the n trials q = probability of failure in one of the n trials

59 Solution From our coin experiment above:
n = p = q = 1 – p = = 0.5 With this information, we can find the mean and standard deviation by using the formulas: Interpretation: On average, you can expect to flip a head 2 out of every 4 flips. The average spread from the mean is 1.0 heads.

60 Example This scenario is a binomial distribution where: n = 10
Several students are unprepared for a surprise multiple choice test with 10 questions, and all of their answers are guesses. Each question has five choices, one of which is correct. Find the mean and standard deviation for the number of correct answers for such students. This scenario is a binomial distribution where: n = 10 p = 1/5 = 0.2 q = 1 – 0.2 = 0.8

61 Solution Interpretation: On average, you can expect to guess correctly 2 out of every 10 questions. The average spread from the mean of 2.0 correct guesses is 1.3 guesses.

62 Usual values of the random variable
Range Rule of Thumb When we are working with means and standard deviations, we can use the range rule of thumb to identify unusual results. Usual values of the random variable Unusually low values of X Unusually high values of X µ – 2  Mean µ + 2  Remember if something is within 2 standard deviations it is considered to be usual.

63 Example Continued Would it be unusual for a student to pass by guessing at least 7 correct answers? Why or why not? For this binomial distribution, µ = 2.0 correct,  = 1.3 correct (we found this from the previous example) 2.0-2(1.3) = -0.6 2.0 2.0+2(1.3) = 4.6 It would be unusual for a student to pass by guessing at least 7 correct answers because 7 does not fall within the interval (-0.6, 4.6).

64 Try this one on your own, check next the next slide for the solution
Example According to Crime in the United States, 1998, 65% of murders are committed with a firearm. Would it be unusual to observe 70 murders by firearm in a random sample of 100 murders? Why? Try this one on your own, check next the next slide for the solution

65 Solution Min usual = µ - 2σ = 65.0 – 2(4.8) = 55.4
First you want to find n, p, and q, so you can find the mean and standard deviation. n = 100 p = 0.65 (65% of murders are committed with a firearm) q = = 0.35 Min usual = µ - 2σ = 65.0 – 2(4.8) = 55.4 Max usual = µ + 2σ = (4.8) = 74.6 It would not be unusual to observe 70 murders by firearm in a random sample of 100 murders because it falls within in the interval (55.4, 74.6).

66 Symbols in Cobra When you are typing homework or quiz answers into Cobra, you can enter symbols using the HTML Editor. Click on the pencil next to the answer space (unless you can already see the tabs), then click on Advanced. This will give you a toolbar across the top. Click on the Ω button.

67 Symbols Square root symbol is here Greek letters like µ and σ are here

68 We do not cover section 5-5 in the textbook.


Download ppt "Sections 5-1 & 5-2 Random Variables."

Similar presentations


Ads by Google