Presentation is loading. Please wait.

Presentation is loading. Please wait.

TOPIC 2 Random Variables. Discrete Random Variables Continuous Random Variables.

Similar presentations


Presentation on theme: "TOPIC 2 Random Variables. Discrete Random Variables Continuous Random Variables."— Presentation transcript:

1 TOPIC 2 Random Variables

2 Discrete Random Variables Continuous Random Variables

3 Discrete Random Variables Random Variable :Random Variable :  A numerical outcome of an experiment  Example: the sum of two fair dice, count number of tails from tossing 2 coins Discrete Random Variable :Discrete Random Variable :  Whole number (0, 1, 2, 3, etc.)  Obtained by counting  Usually a finite number of values : Poisson random variable is exception (∞) Poisson random variable is exception (∞)

4 Probability Mass Function (PMF) A set of probability valuesA set of probability values List of all possible [x, P (x)] pairsList of all possible [x, P (x)] pairs  x = value of random variable X (outcome)  P (x) = probability associated with value Mutually exclusive (no overlap)Mutually exclusive (no overlap) Collectively exhaustive (nothing left out)Collectively exhaustive (nothing left out) 0 ≤ P (x) ≤ 1 for all x0 ≤ P (x) ≤ 1 for all x Also referred as discrete random probability distributionAlso referred as discrete random probability distribution

5 PMF Example Experiment: Toss 2 coins. Count number of tails (as a random variable of X). Discrete Probability Distribution Discrete Probability Distribution Random Var, x Probabilities, P(x) 01/4 = 0.25 01/4 = 0.25 12/4 = 0.50 12/4 = 0.50 21/4 = 0.25 21/4 = 0.25 All Possible Occurence

6 Visualization of PMF Example Listing Table Formula P (x) n x!(n – x)! ! = p x (1 – p) n - x Graph.00.25.50 012 x P(x)P(x) { (0,.25), (1,.50), (2,.25) } Note: p = trial probability = ½ n = sample size = 2 n = sample size = 2 # Tails f (x) Frequency P (x) 0 1.25 2.50 1.25 (x)(x) 1 2

7 Cumulative Distribution Functions An alternative way of specifying the probabilistic properties of a random variable X is through the functionAn alternative way of specifying the probabilistic properties of a random variable X is through the function This function is known as the cumulative distribution function of a discrete random variableThis function is known as the cumulative distribution function of a discrete random variable

8 ExampleExample Suppose X has a probability mass function given bySuppose X has a probability mass function given by then the cumulative distribution function F of X is given bythen the cumulative distribution function F of X is given by

9 Summary Measures Expected value or expectation of a discrete random variable (Mean of probability distribution) :Expected value or expectation of a discrete random variable (Mean of probability distribution) :  average value of the random variables (all possible values)  Variance :Variance :  Measures the spread or variability in the values taken by the random variable  Standard DeviationStandard Deviation  The positive square root of the variance 

10 ExampleExample Experiment : You toss 2 coins. You’re interested in the number of tails. What are the expected value, variance, and standard deviation of this random variable, number of tails? 0.251.00 1.5000 2.251.00 0.50  = 1.0 xP(x)x P(x)x –  (x –   (x –   P(x).25 0    

11 ExercisesExercises 1)An office has four copying machines, and the random variable x measures how many of them are in use at a particular moment in time. Suppose that P(X=0) = 0.08, P(X=1) = 0.11, P(X=2) = 0.27, and P(X=3) = 0.33. a)What is P(X=4) ? b)What is P(X≤2) ? (Cumulative probability distribution) 2)Four cards are labeled $1, $2, $3, and $6. A player pays $4 selects two cards at random, and then receives the sum of the winnings indicated on the two cards. Calculate the probability mass function and the cumulative distribution functions of the net winnings. 3)A consultant has six appointment times that are open, three on Monday and three on Tuesday. Suppose that when making an appointment a client randomly chooses one of its remaining open times, with each of those open times equally likely to be chosen. Let the random variable X be the total number of appointment that have already been made over both days at the moment when Monday’s schedule has just been completely filled a)What is the state space of the random variable of X b)Calculate the probability mass function of X c)What is the expected value and standard deviation of the total number of appointments that have already been made over both days at the moment when Monday’s schedule has just been completely filled?

12 Answers to Exercises 1)a) b)2) Calculation: Calculation:

13 Answers to Exercises 3)a) b) Probability Mass Function Cumulative Distribution Function c)

14 Continuous Random Variables Continuous Random VariableContinuous Random Variable  A numerical outcome of an experiment  Whole or fractional number  Obtained by measuring  Weight of a student (e.g., 115, 156.8, etc.)  Infinite number of values in interval Too many to list like a discrete random variable Too many to list like a discrete random variable

15 ExampleExample Measure Time Between Arrivals Inter-Arrival Time 0, 1.3, 2.78,... Experiment Random Variable Possible Values Weigh 100 People Weight 45.1, 78,... Measure Part Life Hours 900, 875.9,... Amount spent on food $ amount 54.12, 42,...

16 Defines the probabilistic properties of a continuous random variableDefines the probabilistic properties of a continuous random variable Shows all values, x, and frequencies, f (x)Shows all values, x, and frequencies, f (x)  f (x) is a Probability Density Function (Not Probability Random Variable) PropertiesProperties   Probability Density Functions Value (Value, Frequency) Frequency f(x) ab x (Area Under Curve) fxdx() All x   1 fx() a x b  0,

17 Continuous Random Variable Probability Probability is Area Under Curve! Paxb fxdx a b () ()   f(x) x ab

18 Continuous Random Variable Probability f(x) x a This is in contrast to discrete random variables, which can have non zero probabilities of taking specific values.This is in contrast to discrete random variables, which can have non zero probabilities of taking specific values. Continuous random variables can have nonzero probabilities of falling within certain continuous region (e.g. a ≤ x ≤ b)Continuous random variables can have nonzero probabilities of falling within certain continuous region (e.g. a ≤ x ≤ b)

19 Cumulative Distribution Function The cumulative distribution function of a continuous random variable X is defined asThe cumulative distribution function of a continuous random variable X is defined as The cumulative distribution function F(x) is a continuous non-decreasing function that takes the value 0 prior to and at the beginning of the state space and increases to a value of 1 at the endThe cumulative distribution function F(x) is a continuous non-decreasing function that takes the value 0 prior to and at the beginning of the state space and increases to a value of 1 at the end

20 Summary Measures Expected Value or expectation (Mean of random variable) :Expected Value or expectation (Mean of random variable) :  Weighted average of all possible values   If the probability density function f(x) is symmetric then the expectation of the random variable x is equal to the point of symmetry Variance :Variance :  Weighted average of squared deviation about mean  Standard Deviation :Standard Deviation :  Median :Median : 

21 Variances/Standard Deviations Variance shows the spread or variability in the values taken by the random variableVariance shows the spread or variability in the values taken by the random variable Standard deviation is often used in place of the variance to describe the spread of the distributionStandard deviation is often used in place of the variance to describe the spread of the distribution

22 ExampleExample Suppose that the diameter of a metal cylinder has a probability density function f(x) = 1.5 – 6(x – 50) 2 for 49.5 ≤ x ≤ 50.5 Is this a valid probability density function?Is this a valid probability density function? Is the probability density function symmetric? What is the point of symmetry?Is the probability density function symmetric? What is the point of symmetry? What is the probability that the metal cylinder has a diameter between 49.8 and 50.1 mm?What is the probability that the metal cylinder has a diameter between 49.8 and 50.1 mm? What is the cumulative distribution function of the metal cylinder diameter?What is the cumulative distribution function of the metal cylinder diameter? What is the expected diameter of the metal cylinder?What is the expected diameter of the metal cylinder? What is the variance and standard deviation of the metal cylinder diameters?What is the variance and standard deviation of the metal cylinder diameters?

23 Answer to the Example Is this a valid probability density function? Yes.Is this a valid probability density function? Yes. What is the probability that the metal cylinder has a diameter between 49.8 and 50.1 mm?What is the probability that the metal cylinder has a diameter between 49.8 and 50.1 mm? What is the cumulative distribution function of the metal cylinder diameter?What is the cumulative distribution function of the metal cylinder diameter?

24 What is the expected diameter of the metal cylinder?What is the expected diameter of the metal cylinder? Is the probability density function symmetric? What is the point of symmetry? Yes. μ = 50 is the point of symmetryIs the probability density function symmetric? What is the point of symmetry? Yes. μ = 50 is the point of symmetry What is the variance and standard deviation of the metal cylinder diameters?What is the variance and standard deviation of the metal cylinder diameters? Answer to the Example

25 Graphs of the exampleGraphs of the example 49.5 50.5 50 μ = E(X) f (x) f (x) = 1.5 – 6(x – 50) 2 Probability density function 49.5 50.5 F(x)F(x) F (x) = 1.5x – 2(x – 50) 3 – 74.5 0 1 Cumulative distribution function σ = 0.224 0.5 50 Median Mean

26 Chebyshev’s Inequality If a random variable has a mean µ and a variance σ 2, thenIf a random variable has a mean µ and a variance σ 2, then For example, taking c = 2 and 3 givesFor example, taking c = 2 and 3 gives σ σ σ σ σσ E (x) = µ

27 27 Alternative ways of describing spread of data include determining the location of values that divide a set of observations into equal parts. The p th quantile or 100p th percentile of a random variable X with a cumulative distribution function F(x) is defined to be the value of x for which  p = 0.25 is called 25 th percentile or lower quartile (Q 1 )  p = 0.50 is called 50 th percentile or median (Q 2 )  p = 0.75 is called 75 th percentile or upper quartile (Q 3 ) Interquartile Range (IQR) = Q 3 – Q 1 Quantiles of Random Variables

28 28 Quantiles of Random Variables Upper Quartile Median Lower Quartile Area = 0.25 f(x)f(x) Interquartile Range

29 ExampleExample A random variable X has a probability density function a)What is the value of A? b)What is the median of X? c)What is the lower quartile of X? d)What is the upper quartile of X? e)What is the interquartile range? a)

30 Answer to the Example b)c)d)e)

31 Jointly Discrete Random Variables Joint Probability DistributionJoint Probability Distribution Y random values Y1Y1Y1Y1 Y2Y2Y2Y2 YnYnYnYn XrandomValues X1X1X1X1 p 1,1 p 1,2  p 1,n X2X2X2X2 p 2,1 p 2,2  p 2,n XmXmXmXm p m,1 P m,2  p m,n or Joint Cumulative Distribution FunctionJoint Cumulative Distribution Function

32 Marginal Probability Distribution Y random values Y1Y1Y1Y1 Y2Y2Y2Y2 YnYnYnYn XrandomValues X1X1X1X1 p 1,1 p 1,2  p 1,n X2X2X2X2 p 2,1 p 2,2  p 2,n XmXmXmXm p m,1 P m,2  p m,n  Marginal distribution of x Marginal distribution of y

33 Marginal Probability Distribution Variance: Standard Deviation: Expectation (Mean):

34 Conditional Probability Distribution If two discrete random variables X and Y are jointly distributed, then the conditional distribution of random variable X conditional on the event Y = y j consists the probability values What is this next equation about?

35 Covariance and Correlation Covariance: The correlation takes values between -1 and 1, and the discrete random variables x and y are independent if Corr (X,Y) = 0 [or Cov(X,Y) = 0]independent if Corr (X,Y) = 0 [or Cov(X,Y) = 0] strongly dependent if Corr (X,Y) = -1 or 1 (negatively or positively)strongly dependent if Corr (X,Y) = -1 or 1 (negatively or positively) To indicate the strength of the dependence of two random variables In practice, the most convenient way to asses the strength of the dependence between two random variable is through their Correlation

36 ExampleExample A company that services air conditioner (AC) units in residence and office blocks is interested in how to schedule its technicians in the most efficient manner. Specifically the company is interested in how long a technician takes on a visit to a particular location, and the company recognizes that this mainly depends on the manner of AC units at the location that need to be servicedA company that services air conditioner (AC) units in residence and office blocks is interested in how to schedule its technicians in the most efficient manner. Specifically the company is interested in how long a technician takes on a visit to a particular location, and the company recognizes that this mainly depends on the manner of AC units at the location that need to be serviced Service Time (hours) 1234 Number of AC units 10.120.080.070.05 20.080.150.210.13 30.010.010.020.07 Check thatCheck that

37 ExampleExample What is the probability that a location has no more than two AC units that take no more than 2 hours to service? (Joint cumulative probability function)What is the probability that a location has no more than two AC units that take no more than 2 hours to service? (Joint cumulative probability function) What are the expected number, variance and standard deviation of AC? of the service time?What are the expected number, variance and standard deviation of AC? of the service time? Service Time (hours) 1234 Number of AC units 10.120.080.070.05 20.080.150.210.13 30.010.010.020.07 sum0.32 0.57 0.11 sum0.210.240.300.25

38 ExampleExample Is there any correlation between the number of ACs and the service hours?Is there any correlation between the number of ACs and the service hours? Positively correlated!

39 ExampleExample Suppose that a technician is visiting a location that is known to have three air conditioner units, what is the probability that the service time is four hours?Suppose that a technician is visiting a location that is known to have three air conditioner units, what is the probability that the service time is four hours?

40 Linear Function of a Random Variable If X and Y are two random variables, and For some a, b that are real number, the expectation, the variance and the standard deviation of the random variable Y are

41 Linear Combination of Random Variables If X 1 and X 2 are two random variables, and and the variance If X 1 and X 2 are independent random variables so that Cov(X 1,X 2 ) = 0, then The standard deviation

42 ExampleExample 1)Use the answers of the previous example (E(X), E(Y), E(XY), Var(X) and Var(Y)) and assume that X and Y are independent variables. Find the expectation and variance of the following random variables 2X+6Y2X+6Y 5X-9Y+85X-9Y+8 From the previous example: Then,

43 Averaging Independent Random Variables Suppose that X 1, X 2,..…, X n is a sequence of independent random variables each with an expectation μ and a variance σ 2, and with an average Then

44 ExampleExample 1)The weight of a certain type of brick has an expectation of 1.12 kg with a standard deviation of 0.03 kg a)What are the expectation and variance of the average weight of 25 bricks randomly selected? b)How many bricks need to be selected so that their average weight has a standard deviation of no more than 0.005 kg? a) Since independent variable, then b)

45


Download ppt "TOPIC 2 Random Variables. Discrete Random Variables Continuous Random Variables."

Similar presentations


Ads by Google