Random Variables - University of Torontofisher.utstat.toronto.edu/~hadas/STA257UTM/Lecture...

15

Click here to load reader

Transcript of Random Variables - University of Torontofisher.utstat.toronto.edu/~hadas/STA257UTM/Lecture...

Page 1: Random Variables - University of Torontofisher.utstat.toronto.edu/~hadas/STA257UTM/Lecture notes/week4.pdfThe probability distributionof a discrete random variable X is represented

week 4 1

Random Variables

• Example:We roll a fair die 6 times. Suppose we are interested in the number of 5’s in the 6 rolls. Let X = number of 5’s. Then X could be 0, 1, 2, 3, 4, 5, 6. X = 0 corresponds to the 56 elements of our 66 elements of Ω.X = 1 corresponds to the elements etc.X is an example of a random variable.

• Probability models often stated terms of random variables.E.g. - model for the # of H’s in 10 flips of a coin.

- model for the height of a randomly chosen person.- model for size of a queue.

Page 2: Random Variables - University of Torontofisher.utstat.toronto.edu/~hadas/STA257UTM/Lecture notes/week4.pdfThe probability distributionof a discrete random variable X is represented

week 4 2

Discrete Probability Spaces (Ω, F, P)

Page 3: Random Variables - University of Torontofisher.utstat.toronto.edu/~hadas/STA257UTM/Lecture notes/week4.pdfThe probability distributionof a discrete random variable X is represented

week 4 3

Discrete Random Variable• Definition:

A random variable X is said to be discrete if it can take only a finite or countablyinfinite number of distinct values.

• A discrete random variable X maps the sample space Ω onto a countable set. Define a probability mass function (pmf) or frequency function on X such that

Where the sum is taken over all possible values of X.• Note that there is a theorem that states that there exists a probability triple and

random variable whenever we have a function p such that

• Definition:The probability distribution of a discrete random variable X is represented by a formula, a table or a graph which provides the list of all possible values that X can take and the pmf for each value

Page 4: Random Variables - University of Torontofisher.utstat.toronto.edu/~hadas/STA257UTM/Lecture notes/week4.pdfThe probability distributionof a discrete random variable X is represented

week 4 4

Examples of Discrete Random Variables

• Discrete Uniform DistributionWe roll a fair die. Let X = the # that comes up. We have that This is an example of equiprobable outcomes, that is

To state the probability distribution of X we need to give its possible values and its pmf

X is a discrete Uniform random variable. X has a uniform distribution.

( ) ωω =X

Page 5: Random Variables - University of Torontofisher.utstat.toronto.edu/~hadas/STA257UTM/Lecture notes/week4.pdfThe probability distributionof a discrete random variable X is represented

week 4 5

Bernoulli Distribution

Page 6: Random Variables - University of Torontofisher.utstat.toronto.edu/~hadas/STA257UTM/Lecture notes/week4.pdfThe probability distributionof a discrete random variable X is represented

week 4 6

Binomial Distribution• Roll a die n time and count the number of times 6 came up. Let X be the

number of 6’s in n rolls. X has image 1, 2, …, nThe probability distribution of X is given by the following formula

• In general, if identical Bernoulli trail is repeated n times independently and X is a random variable that count the number of success in the n trails then the probability distribution of X is given by

Where p is the probability of success on any one experiment.X is a Binomial random variable. X has a Binomial Distribution.

• Question: is this a valid pmf? Prove!

Page 7: Random Variables - University of Torontofisher.utstat.toronto.edu/~hadas/STA257UTM/Lecture notes/week4.pdfThe probability distributionof a discrete random variable X is represented

week 4 7

Geometric Distribution

• We roll a fair die until the first 6 comes up. Let X = the number of rolls until we get the first 6.Possible values of X: 1, 2, 3, …..The probability distribution of X is given by the following formula

• In general, if identical Bernoulli trail is repeated independently until the first success is obtained and X is a random variable that count the number of trials until the first success then the probability distribution of X is given by

X is a Geometric random variable. X has a Geometric Distribution.

• Question: is this a valid pmf? Prove!

Page 8: Random Variables - University of Torontofisher.utstat.toronto.edu/~hadas/STA257UTM/Lecture notes/week4.pdfThe probability distributionof a discrete random variable X is represented

week 4 8

• In general for a Geometric distribution:

• Memory-less property of geometric random variable: for i > j

Page 9: Random Variables - University of Torontofisher.utstat.toronto.edu/~hadas/STA257UTM/Lecture notes/week4.pdfThe probability distributionof a discrete random variable X is represented

week 4 9

Negative Binomial Distribution• We roll a fair die until the second 6 comes up. This is the waiting time for the

second 6. Let X = the number of rolls until we get two 6’s.Possible values of X: 2, 3, 4, …..The probability distribution of X is given by the following formula

• Is this a valid pmf? Prove!

• In general, X is the total number of experiments when waiting for rth success in a sequence of independent Bernoulli trails. The probability distribution of X is given by

X has a Negative Binomial random Distribution.

Page 10: Random Variables - University of Torontofisher.utstat.toronto.edu/~hadas/STA257UTM/Lecture notes/week4.pdfThe probability distributionof a discrete random variable X is represented

week 4 10

Hypergeometric Distribution

• A hat contains 12 tickets, 7 black and 5 white. Three tickets are drawn at random. Let X = the # of black tickets drawn. X could be 0, 1, 2, 3.The probability mass for each value can be calculated using combinatorics. For example,

Page 11: Random Variables - University of Torontofisher.utstat.toronto.edu/~hadas/STA257UTM/Lecture notes/week4.pdfThe probability distributionof a discrete random variable X is represented

week 4 11

Poisson Distribution

• Model for the number of events occurring in a time (or space) interval where λ(a parameter of the distribution) is the rate of the occurrence of the events per one unit of time (or space).

• A Poisson random variable X = number of events per one unit of time (space). Possible values for X: 0, 1, 2, … The probability distribution of X is given by

• Is this a valid pmf? Prove!

Page 12: Random Variables - University of Torontofisher.utstat.toronto.edu/~hadas/STA257UTM/Lecture notes/week4.pdfThe probability distributionof a discrete random variable X is represented

week 4 12

Distribution Function of Random Variables

• DefinitionA cumulative distribution function (cdf) of a random variable X is a mapping F: R [0, 1] defined by

• If X is a discrete random variable with pmf for x = 0, 1, 2, … then

where is the greatest integer ≤ v.

• Example:

⎣ ⎦v

( )xpX

Page 13: Random Variables - University of Torontofisher.utstat.toronto.edu/~hadas/STA257UTM/Lecture notes/week4.pdfThe probability distributionof a discrete random variable X is represented

week 4 13

Properties of Distribution Function

• F is monotone, non decreasing i.e. F(x) ≤ F(y) if x ≤ y.

• As x - ∞ , F(x) 0

• As x ∞ , F(x) 1

• F(x) is continuous from the right

• For a < bWhy?

( ) ( ) ( )aFbFbXaP XX −=≤<

Page 14: Random Variables - University of Torontofisher.utstat.toronto.edu/~hadas/STA257UTM/Lecture notes/week4.pdfThe probability distributionof a discrete random variable X is represented

week 4 14

Exercises

1. A box contain 20 notes numbered 20 to 39. We randomly pick one note and record its number. What is the probability that the number we got is greater then 32?

2. 30% of U of T students wear glasses. We select a random sample of size 10 students. a) What is the probability that exactly 4 of them wear glasses?b) What is the probability that more then 3 wear glasses?

3. We roll a die until we obtained an even outcome. a) What is the probability that we will roll the die exactly 5 times? b) What is the probability that we roll the die more then 7 times ? c) What is the probability that we roll the die more then 7 times if we

know that we need more then 2 rolls?

Page 15: Random Variables - University of Torontofisher.utstat.toronto.edu/~hadas/STA257UTM/Lecture notes/week4.pdfThe probability distributionof a discrete random variable X is represented

week 4 15

4. We roll a die until we get 6 even outcomes.a) What is the probability that we need exactly 10 rolls?b) What is the probability that we need less 10 rolls?

5. The number of cars that cross Spadina and Bloor intersection is a Poisson random variable with λ = 15 cars per minute.a) What is the probability that in a given minute exactly15 cars will cross

the intersection?b) What is the probability that in a given minute more then 15 cars will

cross the intersection?c) What is the probability that during half an hour there where exactly 2

minutes in which 15 cars crossed the intersection?