You are on page 1of 40

# Random Variables

 A variable that associates a number with the outcome of a „random experiment‟ is a random variable  Denoted by an uppercase letter such as „X‟

 Examples:

If two dice are thrown, the sum of the faces is a random variable, as in: X = 3, X = 11, etc.

• •

If two coins are tossed, then the number of heads is a random variable, as in: X = 0, X = 2, etc. In a speed (rpm) measurement: X = 457, X = 1209, etc. In a dimension measurement with the help of a caliper: X = 23.46, X =

48.97, etc.

1

Random Variables (cont…)
Discrete Random Variables  A random variable with a finite or countable infinite range  Examples:

• • •

Number of scratches on a surface Proportion of defective parts among 1000 tested Number of people arriving at a bank in a given time interval

2

Random Variables (cont…)
Continuous Random Variables  A random variable with an interval (either finite or infinite) of real numbers for its range  Examples:

• • •

Length dimension (like „diameter of a shaft‟) Time dimension (like „time between failure for a machine‟) Temperature dimension (like „temperature inside a heat treatment furnace‟)

3

Random Variables (cont…)
Expression of Random Variables  The manner in which random variables are expressed sometimes depends on the problem at hand

 Sometimes

a random variable is discrete in nature, but it is

treated continuous

• •

This is because the range of values it can take is too large Example: Marks of a student in a 100 marks paper

 Sometimes a random variable is continuous in nature, but it is treated discrete

• •

This is because the exact value (to the smallest level) is not required Example: Age of a person may be expressed as a discrete random variable forming different categories: 0-21, 21-35, 35-50, 50-65, 65+

4

if we are interested in the „number of defective pieces in a sample of 5‟ then: P(X = 0) = 0.991 5 . then: P(X = 0) = 0.590 P(X = 2) = 0.001 P(X = 1) = 0.073 = 0.50) = 0.328 + 0.008 P(X = 5) ≈ 0.590 + 0.073 P(X = 4) ≈ 0.Discrete Random Variables  Examples: • If two coins are tossed and we are interested in the event „number of heads obtained‟.328 P(X = 3) = 0.000 P(X <= 2) = P(X = 0) + P(X = 1) + P(X = 2) = 0.50 P(X = 3) = 0 P(X > 1) = 1 – [P(X = 0) + P(X = 1)] = 1 – (0.25 • In a lot that contains 10% defective pieces.25 + 0.25 P(X = 1) = 0.25 P(X = 2) = 0.

Discrete Random Variables (cont…)  Terminologies associated with discrete random variables • • Probability mass function (pmf) – denoted by f(x) Cumulative distribution function (cdf) – denoted by F(x) 1 5/6 F(x) 4/6 3/6 f(x) x 0 1 2 3 4 5 6 x 2/6 1/6 Probability mass function of a fair dice Cumulative distribution function of a fair dice f(xi) = P(X = xi) F(x) = P(X <= x) = ∑ f(xi) xi <= x 6 .

Discrete Random Variables (cont…) Mean and Variance of a Discrete Random Variables  Mean of a discrete random variables • • • Mean is the expected value of the random variable – denoted by μ or E(X) It is the measure of the „center‟ of the probability distribution Formula: μ = E(X) = ∑ x f(x) x  Variance of a discrete random variables • • • • Denoted by σ2 or V(X) It is the measure of the „dispersion‟ or „variability‟ in the probability distribution ∑ Formula: σ2 = V(X) = x x2 f(x) – μ2 The standard deviation (σ) of X is the square root of the variance 7 .

Bernoulli Trial  A basic building block for all the distributions  A trail with only two possible outcomes • • Usually termed as: „success‟ and „failure‟  The trials constitute random experiment and are independent The outcome from one trial has no effect on the outcome obtained from other trials  Probability of a „success‟ (as well as a „failure‟) in each trial is constant  Examples: • • • • Did tossing of a coin lead to a head (success) or not? Did the student pass the exam (success) or not? Did India lose the match (success) or not? Was the part defective (success) or not? 8 .

2.Binomial Random Variable  A random experiment consists of n Bernoulli trials such that: • • • The trials are independent Each trial results in only two possible outcomes – „success‟ and „failure‟ The probability of success in each trial (denoted as p) remains constant  The random variable X that equals the number of trials that result in a success has a binomial random variable  A binomial distribution is denoted by: B(n. p)  „n‟ and „p‟ are the parameters of the binomial distribution • • n = 1. n = n! / [x! (n-x)!]  For a binomial random variable with parameters „n‟ and „p‟: mean = μ = n p and variance = σ2 = n p (1-p) 9 . 1. …. 2. 3. … and 0<p<1  The pmf of the binomial random variable X is given by: f(x) = nCx px (1 – p)n-x Note: nC x x = 0.

Poisson Distribution  It is derived from a binomial distribution • • Limiting case of the binomial distribution Applied to systems with large number of possible events. each of which are rare  With reference to a binomial distribution. if „n‟ becomes very large and „p‟ becomes considerably small. the distribution of „number of errors‟ in a book will be a Poisson distribution 10 . such that the product of „n‟ and „p‟ (denoted by „λ‟) remains some manageable constant. say 500 (this is „n‟) In this case. then limn∞ P(X = x) = (e–λ λx) / (x!)  Example (to distinguish Poisson distribution from Binomial distribution): • • • • A page in a book can have two outcomes: „with error‟ and „without error‟ The probability of „with error‟ in a page of a book published by a good publishing house is very small (this is the „p‟) But the number of pages in the book will be large.

number of defects per square meter of a surface)  It is important to use consistent units in calculating probabilities. 2. 1.Poisson Distribution (cont…)  A Poisson distribution is denoted by Pois(λ)  „λ‟ is the parameter of the Poisson distribution • „λ‟ is the product of „n‟ and „p‟  The pmf of the Poisson random variable X is given by: • f(x) = (e–λ λx) / (x!) x = 0. means. λ will correspond to the ‘rate’ of something per some unit (example: number of people arriving at a bank per hour. and variances involving Poisson random variables 11 . … λ>0 Note: The range of X is integers from 0 to infinity (and not bounded by „n‟)  For a Poisson random variable with parameter „λ‟: mean = μ = λ and variance = σ2 = λ Important Notes:  In practical applications.

• What is the range of random variables? 12 . until a nonconforming part is obtained.Problems Discrete Random Variables  A batch of 500 machined parts contains 10 that are defective. Parts are selected successively without replacement. The random variable is the number of parts selected.

Assume that the probability that the wafer passes the test is 0. mean and variance of Discrete Random Variables  In a semiconductor manufacturing process. three wafers from a lot are tested. • • • Determine the probability mass function of the number of wafers from a lot that passes the test. Determine the mean and the variance of the random variable. Each wafer is classified as „pass‟ or „fail‟.8. cdf. Determine the cumulative distribution function for the random variable.Problems (cont…) pmf. 13 . and that the wafers are independent.

1 and all the passengers are assumed to behave independently. an airline adopts a policy of overbooking 5 seats for a flight that has a capacity of 120 seats. The probability that a passenger does not show up is 0. • • What is the probability that every passenger who shows up can take the flight? What is the probability that the flight departs with empty seat(s)? 14 .Problems (cont…) Binomial Distribution  Because not all airline passengers show up for their reserved seat.

Problems (cont…) Binomial Distribution  A manufacturer has 100 customer orders to be satisfied. 2% of the components are identified as defective and the components are assumed to be independent. Each order requires on component part that is purchased from a supplier. • • If the manufacturer stocks 100 components what is the probability that the 100 orders can be filled up? If the manufacturer stocks 105 components what is the probability that the 100 orders can be filled up? 15 . However.

• • What is the probability that a student answers more than 20 questions correctly? What is the probability that the student answers less than 5 questions correctly? • • What will be the mean marks scored by a student? What is the variance of the marks scored? 16 .Problems (cont…) Binomial Distribution  A multiple choice test contains 25 questions. each with 4 answers. Assume that a student just guesses each question.

• • Determine the mean of X? Determine the variance of X? 17 . and suppose that P(X = 0) = 5%.Problems (cont…) Poisson Distribution  Suppose that the number of customers that enter a bank in an hour is a Poisson random variable.

• What is the probability that there are no surface flaws in an auto‟s interior? • • If 10 cars are sold to a rental company. what is the probability that at most one car has any surface flaws? 18 . Assume that an automobile interior contains 10 square feet of plastic panel.05 flaws per square foot of plastic panel.Problems (cont…) Poisson Distribution  The number of surface flaws in plastic panels used in the interior of automobiles has a Poisson distribution with a mean of 0. what is the probability that none of the 10 cars has any surface flaws? If 10 cars are sold to a rental company.

• • What is the probability that the instrument does not fail in an 8-hour shift? What is the probability that there is at least one failure in a 24-hour day? 19 .02 failures per hour.Problems (cont…) Poisson Distribution  The number of failures of a testing instrument from contamination particles on the product is a Poisson random variable with a mean of 0.

Continuous Random Variables  Examples: • When a machine breaks down. based on past data.35 < X < 0. It runs for some time until it again breaks down.) of different organizations. For a particular organization. Y. it is serviced. etc. he may be interested in: P(X > 0. then: P(X < 10) = ? P(50 < X < 150) = ? P(X > 250) = ? • A finance executive wants to predict the various financial ratios (say X. We are interested in the event „time (in hours) between successive breakdowns‟.6) = ? 20 .50) = ? P(Y < 0.75) = ? P(0.

Continuous Random Variables (cont…)  Terminologies associated with continuous random variables • • Probability density function (pdf) – denoted by f(x) Cumulative distribution function (cdf) – denoted by F(x) pdf cdf  An alternative way to represent the distribution  Resembles a histogram  Used to calculate an „area‟ that represents the probability that X takes the values between [a. b]  P(a <= X <= b) = f(x)dx a b  Extends the definition of f(x) to the entire real line  F(x) = P(X <= x) = f(u)du for    x   - x    Example: 21 .

Continuous Random Variables (cont…) Mean and Variance of a Continuous Random Variables  Mean of a continuous random variables • • • Defined similarly to that of a discrete random variable Denoted by μ or E(X) Formula: μ  E(X)   [x f(x)]dx    Variance of a continuous random variables • • Defined similarly to that of a discrete random variable Denoted by σ2 or V(X)  • • Formula: σ 2  V(X)  {  [x 2 f(x)]dx}.μ 2  The standard deviation (σ) of X is the square root of the variance 22 .

a <= x <= b  „a‟ and „b‟ are the parameters of the uniform distribution  For a uniform random variable over a <= x <= b: mean = μ = [(a + b)/2] and variance = σ2 = [(b – a)2 / 12] 23 . b)  The pdf of a uniform distribution is: f(x) = 1 / (b – a).Uniform Distribution  The simplest type of continuous distribution  Often denoted by: U(a.

and not the ‘mean time between arrivals’)  The pdf of an exponential distribution is: f(x) = λe-λx for 0 <= x <= ∞ 24 .e. “arrival rate”) is of interest In some cases the „time between arrivals‟ may be of interest This is exactly what is described by an „exponential distribution‟ If the „arrival rate‟ is a Poisson random variable then the corresponding „time between arrivals‟ is an exponential random variable  Denoted by: Exp(λ) • • ‘λ‟ is the parameter of the exponential distribution Important: ‘λ’ is the mean of the corresponding Poisson process (example: ‘arrival rate’. the „number of people arriving at a bank in one hour‟ (i.Exponential Distribution  Preamble: • • • • For a Poisson distribution.

If you have already waited at the bus stop for 1 hour. then the probability that a bus will arrive in the next 10 minutes is equal to the probability that a bus would have arrived in the next 10 minutes as soon as you come to the bus stop (that is.Exponential Distribution (cont…)  The cdf of an exponential distribution is: F(x) = P(X <= x) = 1 – e-λx for x >= 0  For an exponential random variable with parameter λ: mean = μ = [1 / λ] and variance = σ2 = [1 / (λ2)]  „Lack of memory‟ property of the exponential distribution • • Mathematically: P(X < (t1 + t2) | X > t1) = P(X < t2) Implication (Example): Suppose the time between arrival of a city bus is „exponentially distributed‟ with a mean of 15 minutes. without the fact that you waited for one hour) 25 .

and „mode‟ of a normal random variable is same The range of variable extends from -∞ to +∞  Denoted by: N(μ. „median‟. σ2) ‘μ‟ and „σ2‟ are the parameters of the normal distribution 26 .Normal Distribution  Preamble: • • • • The most widely used model for describing a random variable The „mean‟.

1). σ2) can be mapped to the standard normal random variable: • Z = [(X – μ) / σ]  How to read and use the standard normal distribution table? 27 . that is μ = 0 and σ2 = 1. is called a standard normal random variable • Denoted by „Z‟  Any normal random variable X ~ N(μ.Normal Distribution (cont…)  A normal random variable described by N(0.

what proportion of the rods fail to meet the specifications? Determine the mean and the variance of the length of the metal rod 28 . mean and variance of Continuous Random Variables  The probability density function of the length of a metal rod is f(x) = 2 for 2.25 to 2.3 < x < 2.8 meters • • If the specifications of this process are 2.Problems pdf.75 meters.

1 kilogram. 29 . Determine the probability of a randomly selected package being less than 50.25 kilogram • • Determine the mean and the variance of the weight of the packages.75 < x < 50.Problems (cont…) Uniform Distribution  The net weight (in kilogram) of a packaged chemical powder follows a uniform distribution for 49.

Problems (cont…) Exponential Distribution  The time between arrivals of taxis at a busy intersection is exponentially distributed with a mean of 10 minutes. • • What is the probability that you wait longer than one hour for a taxi? Suppose you have already been waiting for one hour for a taxi. what is the probability that one arrives within the next 10 minutes? 30 .

Problems (cont…) Exponential Distribution  The lifetime of a mechanical assembly in a vibration test is exponentially distributed with a mean of 400 hours. what is the probability of a failure in the next 100 hours? 31 . • • What is the probability that an assembly on test fails in less than 100 hours? What is the probability that an assembly operates for more than 500 hours before failure? • If an assembly has been on test for 400 hours without a failure.

Problems (cont…) Normal Distribution  The compressive strength of samples of cement can be modeled by a normal distribution with a mean of 6000 kilograms per square centimeter and a standard deviation of 100 kilograms per square centimeter. • • • What is the probability that a sample‟s strength is less than 6250 Kg/cm2? What is the probability that a sample‟s strength is between 5800 and 5900 Kg/cm2? What strength is exceeded by 95% of the samples? 32 .

Problems (cont…) Normal Distribution  The reaction time of a driver to visual stimulus is normally distributed with a mean of 0.05 seconds.5 seconds? • What is the reaction time that is exceeded 90% of the time? 33 .5 seconds? What is the probability that a reaction requires between 0.4 and 0. • • What is the probability that a reaction requires more than 0.4 seconds and a standard deviation of 0.

 Example: If „length‟ (say X1) and „width‟ (say X2) are random variables. X2. … Xp 34 . X2. …. c2. then: • Y = c1X1 + c2X2 + … + cpXp is a linear combination of X1.Linear Combination of Random Variables  The linear combination of random variables leads to another random variable. cp. then the „perimeter‟ (say Y) is another random variable and Y = 2(X1 + X2) • „Y‟ is a linear combination of X1 and X2  In general. given random variables X1. …. Xp and constants c1.

X2. then • • Mean of „Y‟ is: E(Y) = c1 E(X1) + c2 E(X2) + … + cp E(Xp) Variance of „Y‟ is: V(Y) = c12 V(X1) + c22 V(X2) + … + cp2 V(Xp) 35 . Xp are independent.Linear Combination of Random Variables (cont…)  If Y is a linear combination of X1. X2. … Xp AND if X1. ….

X2. with each having a mean „μ‟ and a variance „σ2‟ and if Y = [(X1 + X2 + … + Xp) / p]. then. • Mean of „Y‟ is: E(Y) = (1/p) μ + (1/p) μ + (1/p) μ + …. = σ2 / p 36  [„p‟ times] . … Xp are independent random variables. =μ  [„p‟ times] • Variance of „Y‟ is: V(Y) = (1/p)2 σ2 + (1/p)2 σ2 + (1/p)2 σ2 + ….Linear Combination of Random Variables (cont…) Special Case 1 Combination that represents the average of p independent random variables with identical means and variances  If X1.

X3 ~ N(μ3. • • „Y‟ is also a normal random variable Mean of „Y‟ is: E(Y) = c1 μ1 + c2 μ2 + … + cp μp • Variance of „Y‟ is: V(Y) = c12 σ12 + c22 σ22 + … + cp2 σp2 37 .Linear Combination of Random Variables (cont…) Special Case 2 Reproductive property of Normal Distribution  If X1. X2. and if Y = c1X1 + c2X2 + … + cpXp then. X2 ~ N(μ2. Xp ~ N(μp. …. σ32). σ12). such that: X1 ~ N(μ1. … Xp are independent normal random variables. σp2). σ22).

5 oz. what is the probability that the average fill volume of the 100 cans is below 12 oz? • • What should the mean fill volume equal so that the probability that the average of 100 cans is below 12 oz is 0. what should the standard deviation of fill volume equal so that the probability that the average of 100 cans is below 12 oz is 0. determine the number of cans that need to be selected such that the probability that the average fill volume is less than 12 oz is 0.1 oz and the standard deviation is 0. Assume that the fill volumes of the cans are independent. 38 . • • What is the standard deviation of the average fill volume of 100 cans? If the mean fill volume of a can is 12.005? If the mean fill volume is 12.01.1 oz.1 oz.Problems Linear combination of random variables  Soft-drink cans are filled by an automated filling machine and the standard deviation is 0.005? • If the mean fill volume is 12. normal random variables.5 oz.

Suppose that 25 people squeeze into an elevator that is designed to hold 4300 pounds. • • What is the probability that the load (total weight) exceeds the design limit? What design limit is exceeded by 25 occupants with probability 0.Problems (cont…) Linear combination of random variables  Assume that the weights of individuals are independent and normally distributed with a mean of 160 pounds and a standard deviation of 30 pounds.001? 39 .

0625 inch. • Determine the mean and standard deviation of the difference between the width of the casing and the width of the door. The width of a door is normally distributed with a mean of 23.125 inch.Problems (cont…) Linear combination of random variables  The width of a casing for a door is normally distributed with a mean of 24 inches and a standard deviation of 0.25 inch? What is the probability that the door does not fit in the casing? 40 . • • What is the probability that the width of the casing minus the width of the door exceeds 0.875 inches and a standard deviation of 0. Assume independence.