introduction to random variables - wordpress.com · 2013-12-04 · introduction to random variables...

14
MATH 320: Probability and Statistics 4. Introduction to Random Variables Page 1 of 14 Introduction to Random Variables Readings: Pruim 2.1.3, 2.3.1, 2.5 Learning Objectives: 1. Be able to define a random variable and its probability distribution 2. Be able to determine probabilities associated with events composed of random variable values 3. Be able to apply the definition of expected value to a generic distribution 4. Be able to find the variance of a generic distribution 5. Be able to find the expected value of a cost function or other function of a random variable 6. Be able to find the expected values of the known discrete and continuous distributions 7. Be able to find the mgf of a generic distribution 8. Be able to use the mgf to find the mean and variance of a distribution

Upload: vudien

Post on 06-Jul-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Random Variables - WordPress.com · 2013-12-04 · Introduction to Random Variables ... The probability distribution for a discrete variable Y can be represented by

MATH 320: Probability and Statistics 4. Introduction to Random Variables

Page 1 of 14

Introduction to Random Variables Readings: Pruim 2.1.3, 2.3.1, 2.5 Learning Objectives:

1. Be able to define a random variable and its probability distribution 2. Be able to determine probabilities associated with events composed of random variable

values 3. Be able to apply the definition of expected value to a generic distribution 4. Be able to find the variance of a generic distribution 5. Be able to find the expected value of a cost function or other function of a random variable 6. Be able to find the expected values of the known discrete and continuous distributions 7. Be able to find the mgf of a generic distribution 8. Be able to use the mgf to find the mean and variance of a distribution

Page 2: Introduction to Random Variables - WordPress.com · 2013-12-04 · Introduction to Random Variables ... The probability distribution for a discrete variable Y can be represented by

MATH 320: Probability and Statistics 4. Introduction to Random Variables

Page 2 of 14

We have been discussing the basic rules and theorems of probability. Specifically, we have been determining probabilities by determining the sample point in the sample space that results from a probability experiment. In random processes in which the sample space is composed of numerical events, or numbers, we define those events as random variables. Definition: A random variable is essentially a random number, a function from the sample space S to the real numbers. Generally denoted as X or Y.

Discrete Random Variables So far, the examples we have discussed have been discrete random variable, or random variables that take on only discrete values. Definition: A random variable Y is discrete if it can assume only a finite or countably infinite number of distinct values.

Note: Countably infinite means that the elements in the set can be put into one-to-one correspondence with the positive integers.

While we will use capital letters, such as Y to denote a random variable, we will use lower case letters, such as y to denote the value of the random variable

Probability Distribution We will reiterate some old definitions in the context of discrete random variables as we continue our discussion of discrete random variables and their probabilities. Definition: The probability that Y takes on the value y, ( )P Y y= is defined as the sum of the

probabilities of all sample points in S that are assigned the value y. We will sometimes denote

( )P Y y= by ( )p y .

The probability distribution for a random variable is a function that assigns a probability to each value of random variable. Definition: The probability distribution for a discrete variable Y can be represented by a formula, table, or a graph that provides ( ) ( )p y P Y y= = for all y.

Recall the axioms of probability; we will reiterate those axioms in the context of a discrete

random variable { }0,1,2,3,...,Y n=

Theorem: For any discrete probability distribution, the following must be true:

1. 0 ( ) 1p y≤ ≤ for all y

2. ( ) 1y

p y =∑ , where the summation is over all values of x with nonzero probability

The above is also called the probability mass function (pmf).

Page 3: Introduction to Random Variables - WordPress.com · 2013-12-04 · Introduction to Random Variables ... The probability distribution for a discrete variable Y can be represented by

MATH 320: Probability and Statistics 4. Introduction to Random Variables

Page 3 of 14

Example: Let us go back to our standard example of two coin tosses. Define the pmf for Y, the number of heads in two coin tosses. Example: Consider our five-card poker hand: Define the number of five-card hands possible from 52 total cards: Define the number of five-card hands that have 0 Aces, 1 Aces, 2 Aces… Define the probability mass function for Y, the number of Aces in a five-card hand, ( )p y as both

a probability mass function and a table

y ( )p y

0

1

2

3

4

Page 4: Introduction to Random Variables - WordPress.com · 2013-12-04 · Introduction to Random Variables ... The probability distribution for a discrete variable Y can be represented by

MATH 320: Probability and Statistics 4. Introduction to Random Variables

Page 4 of 14

Example: Tay-Sachs disease is a rare but fatal disease of genetic origin occurring chiefly in infants and children, especially those of Jewish or eastern European extraction. If a couple are both carriers of Tay-Sachs disease, a child of theirs has a probability of 0.25 of being born with the disease. If such a couple has four children, the probability distribution for the number of children with the disease is

y ( )p y 0 0.316 1 0.422 2 3 0.047 4 0.004

Define the random variable, Y, in words, Find the probability that 2 of the 4 children have Tay-Sachs, or p(2), Find the probability that at most one child has Tay-Sachs. Find the probability that at least one of the children has Tay-Sachs

0 1 2 3 4

Number of Children with Tay-Sachs

Pro

bab

ility

0.0

0.1

0.2

0.3

0.4

Page 5: Introduction to Random Variables - WordPress.com · 2013-12-04 · Introduction to Random Variables ... The probability distribution for a discrete variable Y can be represented by

MATH 320: Probability and Statistics 4. Introduction to Random Variables

Page 5 of 14

Expected Value We often want to determine the expected value of a random variable, or the average value of a random variable. Essentially, we weight the values of a random variable by their probabilities to determine the expected value of the random variable. In addition, the expected value is often referred to as the mean and is often denoted as µ . It can also be interpreted as the long-run average or the center of the probability mass function. Definition: If Y is a discrete random variable with a frequency function (pmf) ( )p y , the expected

value of Y, denoted by ( )E Y , is

( ) ( )i i

i

E Y y p y=∑

provided that | | ( )i i

i

y p y < ∞∑ . If the sum diverges, the expectation is undefined. ( )E Yµ =

Practically, what is the expected value calculating? Example: Let us go back to you coin toss example where Y is the number of heads in two coin tosses. Find the expected value of Y.

y ( )p y

0 0.25 1 0.50 2 0.25

Example: Determine the expected value, or the average number of aces expected in a hand of five cards in repeated processes.

Page 6: Introduction to Random Variables - WordPress.com · 2013-12-04 · Introduction to Random Variables ... The probability distribution for a discrete variable Y can be represented by

MATH 320: Probability and Statistics 4. Introduction to Random Variables

Page 6 of 14

Example: Determine the expected number of children in a family of four that have Tay-Sachs when both parents are carriers.

Example: In a gambling game, a person draws a single card from an ordinary 52-card deck. A person is paid $15 for drawing a jack or a queen and $5 for drawing a king or an ace. A person who draws any other card pays $4. If a person plays this game, what is the expected gain?

Example: It is known that 35% of job applicants falsify their credentials when applying for jobs. What is the expected number of falsified applicants in a sample of five applications?

Page 7: Introduction to Random Variables - WordPress.com · 2013-12-04 · Introduction to Random Variables ... The probability distribution for a discrete variable Y can be represented by

MATH 320: Probability and Statistics 4. Introduction to Random Variables

Page 7 of 14

Expectations as Functions of Random Variables We can use our knowledge of the expected value of a random variable to determine characteristics of a random variable and its probability distribution. We can determine the expected value of a function of a random variable as follows:

Theorem: Let Y be a discrete random variable with probability function ( )p y and ( )g Y be a

real-valued function Y. Then the expected value of ( )g Y is given by

( ( )) ( ) ( )Y

E g Y g y p y=∑

provided that | ( ) | ( )Y

g y p y < ∞∑ .

Note: [ ( )] [ ( )]g X g XΕ ≠ Ε

Theorem: Let Y be a discrete random variable with probability function ( )p y and c be a

constant, then: a. ( )E c c=

b. ( ) ( )( ) ( )E cg Y cE g Y=

Theorem: Let Y be a discrete random variable with probability function ( )p y and

1 2( ), ( ),..., ( )k

g Y g Y g Y be k functions of Y. Then

( ) ( ) ( ) ( )1 2 1 2( ) ( ) ... ( ) ( ) ( ) ... ( )k kE g Y g Y g Y E g Y E g Y E g Y+ + + = + + +

Example: The manager of a stockroom in a factory has constructed the following probability distribution for the daily demand (number of times used) for a particular tool. It costs $10 each time the tool is used.

y 0 1 2

( )p y 0.1 0.5 0.4

What is the expected number of uses of the tool per day? What is the expected cost of the use of the tool per day?

Page 8: Introduction to Random Variables - WordPress.com · 2013-12-04 · Introduction to Random Variables ... The probability distribution for a discrete variable Y can be represented by

MATH 320: Probability and Statistics 4. Introduction to Random Variables

Page 8 of 14

Example: Let Y be a random variable with ( )p y given in the accompanying table. Complete the

following table:

y ( )p y 2y 2 1y − 1 y

1 0.40

2 0.30

3 0.20

4 0.10

Find the following: ( )E Y , ( )2E Y , ( )2 1E Y − , ( )1E Y

Page 9: Introduction to Random Variables - WordPress.com · 2013-12-04 · Introduction to Random Variables ... The probability distribution for a discrete variable Y can be represented by

MATH 320: Probability and Statistics 4. Introduction to Random Variables

Page 9 of 14

Variance and Standard Deviation While the expected value of a random variable provides us with a measure of the average value of the random variable, we often want a measure of the variability of a random variable, or how the possible values of the random variable differ with respect to the mean, or expected value. The variance is a measure of the spread or how dispersed a probability distribution is about its center or expectation. Definition: If Y is a random variable with expected value ( )E Y , the variance of Y is

2 2 2( ) [( ( )) ] ( ) [ ( )]Var Y E Y E Y E Y E Y= − = −

provided that the expectation exists. The standard deviation of Y is the square root of the

variance. The variance is often denoted as 2σ .

Proof: 2 2 2[( ( )) ] ( ) [ ( )]X X X XΕ − Ε = Ε − Ε

Example: The manager of a stockroom in a factory has constructed the following probability distribution for the daily demand (number of times used) for a particular tool. It costs $10 each time the tool is used.

y 0 1 2

( )p y 0.1 0.5 0.4

What is the variance of the use of the tool per day?

What is the variance of the cost of the use of the tool per day?

Page 10: Introduction to Random Variables - WordPress.com · 2013-12-04 · Introduction to Random Variables ... The probability distribution for a discrete variable Y can be represented by

MATH 320: Probability and Statistics 4. Introduction to Random Variables

Page 10 of 14

Example: The maximum patent life for a new drug is 17 years. Subtracting the length of time required by the FDA for testing and approval of the drug provides the actual patent life for the drug-that is, the length of time that the company has to recover research and development costs and to make a profit. The distribution of the lengths of actual patent lives for new drugs is given below:

Years, y 3 4 5 6 7 8 9 10 11 12 13

( )p y 0.03 0.05 0.07 0.10 0.14 0.20 0.18 0.12 0.07 0.03 0.01

Find the mean (expected) patent life for a new drug. Find the standard deviation of Y = the length of life of a randomly selected new drug Find the probability that the value Y falls in the interval 2µ σ±

Page 11: Introduction to Random Variables - WordPress.com · 2013-12-04 · Introduction to Random Variables ... The probability distribution for a discrete variable Y can be represented by

MATH 320: Probability and Statistics 4. Introduction to Random Variables

Page 11 of 14

Visualization of Expected Value and Variance

It is often useful to create a visualization of the probability distribution. That visualization for random variables is generally in the form of a histogram or bar graph. Let us look at our previous example for Tay-Sachs. Example: Tay-Sachs disease is a rare but fatal disease of genetic origin occurring chiefly in infants and children, especially those of Jewish or eastern European extraction. If a couple are both carriers of Tay-Sachs disease, a child of theirs has a probability of 0.25 of being born with the disease. If such a couple has four children, the probability distribution for the number of children with the disease is

y ( )p y 0 0.316 1 0.422 2 0.211 3 0.047 4 0.004

Find the expected value and variance of Y. Mark the expected value as well as µ σ± on the

graph.

0 1 2 3 4

Number of Children with Tay-Sachs

Pro

ba

bility

0.0

0.1

0.2

0.3

0.4

Page 12: Introduction to Random Variables - WordPress.com · 2013-12-04 · Introduction to Random Variables ... The probability distribution for a discrete variable Y can be represented by

MATH 320: Probability and Statistics 4. Introduction to Random Variables

Page 12 of 14

Moment-Generating Functions The expected value and variance are valuable descriptive numerical measures of a random variable. However, those values are not unique to a distribution. For example, consider the following simple probability distributions

y ( )p y x ( )p x 9 0.5 6 0.5

11 0.5 14 0.5

Determine the expected value of Y and X. Therefore, we can expand our repertoire of numerical descriptive measures of a random variable that will more fully define the probability distribution.

Definition: The kth moment of a random variable is ( )k

kYµ ′ = Ε

Notice that the 1st moment is just the expected value of the random variable ( )E Y

Definition: The kth central moment of a random variable is [ ]( )( )

kY YΕ − Ε

Notice that the 2nd central moment of a random variable is the variance, ( )Var Y

We can often define all of the moments of a probability distribution of a random variable in terms of a function, called the moment-generating function. Definition: The moment-generating function (mgf) of a random variable X is

( ) ( ) ( )tY ty

y

m t E e e p y= =∑

Property: If the moment-generating function exists for t in an open interval containing zero, it uniquely determine the probability distribution. Note: the proof relies on properties of the Laplace Transform.

Page 13: Introduction to Random Variables - WordPress.com · 2013-12-04 · Introduction to Random Variables ... The probability distribution for a discrete variable Y can be represented by

MATH 320: Probability and Statistics 4. Introduction to Random Variables

Page 13 of 14

Theorem: If the moment-generating function exists in an open interval containing zero, then

( )( ) (0)k k

km Y µ ′= Ε =

where ( )

0

( )(0)

kk

kt

d m tm

dt =

=

Example: Consider the following basic probability distribution for the random variable Y.

y ( )p y

1 1/6 2 2/6 3 3/6

Find the expected value and the variance Find the moment-generating function Use the moment-generating function to determine the mean and variance. Compare to your previous answer.

Page 14: Introduction to Random Variables - WordPress.com · 2013-12-04 · Introduction to Random Variables ... The probability distribution for a discrete variable Y can be represented by

MATH 320: Probability and Statistics 4. Introduction to Random Variables

Page 14 of 14

Example: If Y has a moment-generating function 6( 1)( )te

m t e−= .

Find the expected value Find the variance

What is ( )2P Y µ σ− ≤

Non-existence of the moment-generating function There will be situations in which the moment-generating function does not exist. In such cases, the characteristic function may be used in a similar manner and it always exists. Definition: The characteristic function of a random variable Y is defined to be

( ) ( )itYt eφ = Ε

where 1i = − . Even though the characteristics function exists for all values of t and is thus defined for all distributions, its properties are similar to those of the mgf, but using the characteristic function requires familiarity with complex analysis. Therefore, we will not be using it in this class.