
Understanding Random Variables in Statistics
Learn about random variables in statistics, including discrete and continuous types, through examples like playing the lottery and vehicle ownership data. Explore how random variables are used to model numerical outcomes in various scenarios.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Statistics Session 12 Random Variables part 1 Ezra Halleck, City Tech (CUNY), Fall 2021
Opening Example Now that you know a little about probability, do you feel lucky enough to play the lottery? If you have $20 to spend on lunch , how much of it are you willing to spend on $5 lottery tickets? Do you think you will profit, on average, if you continue buying lottery tickets over time? When you purchase a lottery ticket for $5 and you don t win anything, then your earnings are 5. If you get a $20 prize, then your earnings are 20 5 = 15. Playing the lottery and determining your earnings is an experiment with a numeric outcome and hence is an example of a random variable. 2
5.1 Random Variables A random variable (RV) is a variable whose numerical value is determined by the outcome of a random experiment. There are two types of RV s depending on the nature of the numeric outcome: A discrete random variable (DRV) assumes countable values. A continuous Random Variable (CRV) assumes any value in one or more intervals. Playing the lottery is discrete. 3
2nd example of DRV: # of Vehicles Owned by Families Number of Vehicles Owned Frequency 0 1 2 3 4 Blank N = 2000 Note how the DRV is given as a table, with outcomes in one column and their probabilities (relative frequencies) in another. Relative Frequency .015 .235 .425 .245 .080 30 470 850 490 160 Sum = 1.000 Vehicles here would mean cars and light trucks. Would this table be valid for NYC? Where do you think the data for this table were collected? 4
Examples of Discrete Random Variables The number of: 1. vehicles owned by a family in a suburban community 2. cars sold at a dealership during a given month 3. houses in a certain block 4. fish caught on a fishing trip 5. complaints received at the office of an airline on a given day 6. customers who visit a bank during any given hour 7. heads obtained in three tosses of a coin Earnings (prize minus cost of ticket) for lottery 5
Continuous Random Variable Definition A random variable that can assume any value in one or more intervals is called a continuous random variable. 6
Examples of Continuous Random Variables 1. life of a battery in hours (depicted on previous slide) 2. length of a room in cm 3. time taken to commute from home to work in minutes 4. amount of milk in a gallon jug in gallons (note that we do not expect a gallon to contain exactly 1 gallon of milk but either slightly more or slightly less than one gallon) 5. weight of a letter in oz (for determining postage) 6. value (worth) of a house in dollars Note that worth may be treated as a continuous random variable, although often it is rounded to the nearest $ or . 7
The Hypergeometric Probability Distribution We now turn our attention to one specific DRV. In the next session, we will go into how to find the mean and standard deviation for a DRV. For a Hypergeometric Probability Distribution, the probability of x successes in n trials is given by C C ( ) = n r P x r x N r C N n These are the binomial coefficients or combinations which were introduced in the previous session. 8
The Hypergeometric Probability Distribution For a Hypergeometric Probability Distribution, the probability of x successes in n trials is given by C P x = C ( ) n r r x N r C N n We would like to develop an intuition behind the formula. The lower-case r and x refer to the sizes of the success pool and successes selected, respectively. The upper-case N and lower-case n refer to the sizes of the entire pool which includes both successes and failures . ? ? and ? ? are the sizes of the failure pool and failures selected, respectively. 9
Exercise: fill in the #s successes failures C C ( ) = n r P x r x N r C N overall n symbol value 2 x 6 = 12 3 36 9 r x N n N-r 4 x 6 = 24 6 n-x Now fill in formula 10 Diagram courtesy of https://www.wizeprep.com/
symbol value 2 x 6 = 12 3 36 9 r x N n n-r 4 x 6 = 24 6 N-x C C ( ) = n r P x r x N r C N n ? 3 12?3 24?6 36?9 = As check, sum of left # s in top = left # in bottom Ditto for right: sum of right # s in top = right # in bottom 11
C C ( ) = n r P x r x N r C N n ? 3 12?3 24?6 36?9 = These # s are too big to do by hand Instead, we use Excel (combination is COMBIN): = COMBIN(12,3)* COMBIN(24,6) /COMBIN(36,9) For clarification, parentheses would not hurt. However, they are not necessary. Why? 12
Example 5-16 Brown Manufacturing makes auto parts. Last week the company shipped 25 auto parts to a dealer. Later, it found out that 5 of those parts were defective. By the time the company manager contacted the dealer, 4 auto parts from that shipment had already been sold. What is probability that 3 of those 4 parts were good and 1 was defective? N 25 4 ( ) 3 P = symbol value 20 3 r x 20! 5! - ( ) 25! ( ) 3! 20 3 ! 1! 5 1 ! - C C C C n N-r = = - n x - 20 3 5 1 r x N r C C 5 1 25 4 N n ( ) - 4! 25 4 ! These # s are big, so again we use Excel: = COMBIN(20,3)* COMBIN(5,1) /COMBIN(25,4)=.4506 n-x ( )( ) 1140 5 12,650 = = Thus, the probability that three of the four parts sold are good and one is defective is .4506. .4506 13
Example 5-16: Defective parts Brown Manufacturing makes auto parts. Last week the company shipped 25 auto parts to a dealer. Later, it found out that 5 of those parts were defective. By the time the company manager contacted the dealer, 4 auto parts from that shipment had already been sold. What is the probability that 3 of those 4 parts were good and 1 was defective? ( ) 3 N n C These # s are a little big to do by hand, so again we use Excel: = COMBIN(20,3)* COMBIN(5,1) /COMBIN(25,4)=.4506 20! 5! - ( ) 25! ( ) 3! 20 3 ! 1! 5 1 ! - C C C C = = = N r - n x - 20 3 5 1 P r x C 25 4 ( ) - 4! 25 4 ! ( )( ) 1140 5 12,650 = = .4506 14
Example 5-17: employee selection by gender Dawn Corp. has 12 employees who are managers. Of them, 7 are female and 5 are male. The company will send 3 of the managers to a conference. If the 3 managers are randomly selected, find probability that (a) all 3 of them are female; (b) at most 1 of them is female. 15
Example 5-17: employee selection by gender symbol value 12 employees: 7 female and 5 male. Selection of 3: (a) chance all 3 of them are female? 7 3 r x 12 3 N n N-r 5 0 N-x )( ) 220 ( 35 1 C C C C C ( ) 3 = = = = n x .1591 P 7 3 5 0 r x N r C 12 3 N n Thus, chance that all 3 managers selected are female is .1591. 16
Example 5-17: employee selection by gender symbol value 12 employees: 7 female and 5 male. Selection of 3: (b) chance at most 1 of them is female? r 7 0, 1 x 12 3 5 3,2 N ( )( 1 10 220 7 10 220 = = ) ( )( 1 10 ) ( )( 1 10 220 ( )( = ) x r C 0 C - C 12 C C C 5 C C C r C = C C 7 C = - C C n x - n x C N r C ( ) 0 ( ) 0 P = = ( ) 0 n N-r = = = = = = = .0455 .0455 = 220 7 10 220 .3637 = - n x - N r - .0455 7 0 5 3 P r x N r C N C x C 0 7 3 5 3 P x 12 1 7 3 C 5 C C N n N 12 3 C n 3 n ( )( ( )( 7 10 220 ) ) ) x r - 2 C r C = C C 7 C = 5 1 - C n x - n x C N r C N-x ( ) 1 ( ) 1 P = = ( ) 1 = = = = = .3182 .3182 = = - n x - N r - .3182 7 1 P r x N r C N C P 2 5 2 P C C 12 12 .0455 .3182 + ( ) 1 .0455 .3182 = 3 12 N n N 3 n 3 n ( ) ( ) 0 ( ) 0 P = ( ) 1 ( ) 1 P + ( P ) + + ( ) 0 ( ) = = 1 = .0455 .3182 + = + 1 1 .3637 .3637 P x P x P P x P Thus, chance that at most 1 of 3 managers selected is female is .3637. 17
Example 5-17: employee selection by gender Dawn Corp. has 12 employees who are managers. Of them, 7 are female and 5 are male. The company will send 3 of the managers to a conference. If the 3 managers are randomly selected, find probability that (a) all 3 of them are female; (b) at most 1 of them is female. ? ? = ???????.???? ?,?,?,?,????? = ???????.???? 3,7,3,12,????? ? ? = ???????.???? ?,?,?,?,???? = ???????.???? 1,7,3,12,???? x n r N varies # successes selected 3 selection size 7 # successes in pool 12 pool size x P(x) 0 0.0455 0.0455 1 0.3182 0.3636 2 0.4773 0.8409 3 0.1591 sum P(X<=x) 1 1 18