4 Continuous Probabilities

download 4 Continuous Probabilities

of 73

description

CONT

Transcript of 4 Continuous Probabilities

  • DSC1007 Lecture 5

    Continuous Probability Distributions

  • Continuous Random Variables

    Probability Density Function

    Uniform Distribution

    Cumulative Distribution Function

    Exponential Distribution

    Normal Distribution

    Computing Probabilities for Normal Distribution

    Sum of Normally Distributed R.V.s

    Central Limit Theorem

    Normal Approximation to Binomial

    Continuous Probability Distributions

  • In a class of 50 students, Mike said his height was 1.70m.

  • You randomly select a

    student from the

    class. What is the

    probability that his or

    her height is exactly

    1.70m?

  • Continuous Random Variables

    A continuous random variable can take any value in

    some interval.

    Examples : Temperature, Weight, Time

  • Continuous Random Variables

    X P(X)

    0 0.343

    1 0.441

    2 0.189

    3 0.027

    Discrete Probability Distribution

    How to count the

    probabilities for continuous

    random variables?

  • You randomly select a

    student from the

    class. What is the

    probability that his or

    her height is exactly

    1.70m?

    Concept 1: For a continuous random variable x,

    the probability for x to be a particular value is

    nearly zero.

  • You randomly select a

    student from the

    class. What is the

    probability that his or

    her height is between

    1.69m and 1.71m?

    Concept 2: It makes sense to measure the

    probability of a random variable over a range of

    values.

  • You randomly select

    an adult. Is he or she

    more likely to have a

    height of exactly 2m

    or have a height of

    exactly 1.7m?

    Concept 3: It is still possible to compare the

    likelihood of the probabilities of a random

    variables taking different values.

  • PDF and CDF

  • Histogram

  • We can describe the probability distribution of a

    continuous r.v. X by its probability density function

    (pdf), usually denoted by f (x ) .

    Probability Density Function

    -5.0 -4.0 -3.0 -2.0 -1.0 0.0 1.0 2.0 3.0 4.0 5.0

    x

    f (x)

  • -5.0 -4.0 -3.0 -2.0 -1.0 0.0 1.0 2.0 3.0 4.0 5.0

    Probability Density Function

    a b

    area =

    The probability density function (pdf) of a r.v. X has the

    following characteristics:

    Area under the pdf curve is equal to 1

    Probability that X lies between values a and b is equal to the

    area under the curve between a and b

    x

    P(a X b)

    f (x)

  • -5.0 -4.0 -3.0 -2.0 -1.0 0.0 1.0 2.0 3.0 4.0 5.0

    Probability Density Function

    a b

    Q1 : Given the pdf f(x), how do we compute the area

    under the curve between a and b?

    x

    f (x)

    In general, we will have to evaluate the integral

    area = P(a X b)

  • PDF for a womans height in US

    PDF for a mans height in US

    http://www.johndcook.com/blog/2008/07/20/why-heights-are-normally-distributed/

  • -5.0 -4.0 -3.0 -2.0 -1.0 0.0 1.0 2.0 3.0 4.0 5.0

    Probability Density Function

    x

    f (x)

    Q2 : Given the pdf f(x), how do we compute the

    mean and variance of X ?

    Mean = =

    Variance = = ( )2

  • Discrete vs Continuous

    Discrete Continuous

    Probability distribution

    x1 p1 x2 p2

    xn pn

    p d f f (x)

    = 1

    =1

    = 1

    Mean

    =1

    Variance 2 ( )

    2

    =1 ( )2

  • For a given t, the cumulative distribution function

    (cdf) F(t) of a continuous r.v. X is defined by

    = =

    Cumulative Distribution Function

    -5.0 -4.0 -3.0 -2.0 -1.0 0.0 1.0 2.0 3.0 4.0 5.0t

    f (t) 0 F(t) 1

    By definition :

    F(t) is a non-decreasingfunction of t

    P(X t)

    F(t) is the probability that X does not exceed t.

  • Cumulative Distribution Function

    It is also easy to see that :

    P(X > t) = 1 F(t)

    P(c X d) = F(d) F(c)

    For a given t, the cumulative distribution function

    (cdf) F(t) of a continuous r.v. X is defined by

    = =

    Note: P(X t) = P(X < t)

  • Uniform Distribution

  • Uniform Distribution

    X is uniform on [a ,b] if X is equally likely to take any value in the range from a to b.

    Uniform Distribution

    a b

    f (t)

    t

  • Example

    Suppose that travel time (by bus) between Clementi and NUS is uniformly distributed between 12 and 20 minutes.

    1. What is the mean travel time?

    2. What is the probability that the travel time exceeds 14 minutes?

    3. What is the probability that the travel time is between 14 and 18 minutes?

  • If the r.v. X is equally likely to take any value in the range

    from a to b (where b > a), then we say that X obeys a

    uniform distribution over [a ,b].

    Uniform Distribution

    a b

    1/(ba)

    f (t)

    PDF of X

    t

    =

    1

    0 otherwise

    Equation of f(t) ?

    We write : X U[a ,b]

    area = 1

  • CDF of Uniform Distribution

    a b

    1/(ba)

    f (t)

    PDF of X

    t

    =

    1

    0 otherwise

    CDF of X ?

    F(t) = P(X t)

  • CDF of Uniform Distribution

    a b

    1

    F (t)

    t

    =

    0 <

    1 >

    Equation of F(t) ?CDF of X

    F(t) = P(X t)

  • Mean & Variance of Uniform Distribution

    a b

    1/(ba)

    f (t)PDF

    t

    X U[a,b]

    =

    1

    0 otherwise

    E (X) = ?

    Var (X) = ?

    (a+b)/2

    ( )2

    12

  • Example

    The mens 100 meter sprint at the 1996 Olympic Games in Atlanta was a hotly contested event between three athletes.

    Donovan Bailey

    (Canada)

    Frankie Fredericks

    (Namibia)Ato Boldon

    (Trinidad)

  • Example

    Assume that the probability distribution of the time to run the race is the same for the three, and that this time obeys a uniform distribution between 9.75 seconds and

    9.95 seconds.

    What is the probability that Donovans time will beat the previous record of 9.86 seconds?

    What is the probability that the winning time will beat the previous records of 9.86 seconds?

  • Exponential Distribution

  • Exponential Distribution

  • Exponential Distribution

    Often arises as the distribution of amount of time until an event occurs.

    Useful for waiting line problems.

    A random variable X is said to be an exponential r.v. with rate

    parameter ( > 0) if it has the pdf

    f (x ) = e x for x > 0

  • Exponential Distribution

    It can be shown that

    Mean E ( X) =

    Variance Va r ( X ) =

    1

    1

    2

    = 1

    It can be shown that

    X has the cdf

  • Poisson and Exponential

    There is a close relationship between the two distributions.

    = =

    ! for = 0, 1, 2, . . .

    N is Poisson r.v. with parameter (>0):

    X is exponential r.v. with parameter ( > 0) :

    f(x) = ex for x > 0

  • Poisson and Exponential

    Parameter Poisson Exponential

    Mean 1

  • Example:Suppose the usage duration of a particular ATM is an exponential r.v. with a mean of 3 mins. If someone arrives at the ATM immediately ahead of you, find the probability that you have to wait (a) more than 2 minutes, and (b) between 2 and 3 minutes

    X is exponential r.v. with parameter ( > 0)

    PDF f(x) = ex for x> 0

    CDF

    Exponential Distribution

    = 1

    X = usage duration (in mins) of ATM is exponential r.v. with parameter = 1/3.

    (a) P ( X > 2 ) = 1 P ( X < 2 ) = 1 F ( 2 ) = e 2 0.51342

    (b) P ( 2 < X < 3 ) = P ( X < 3 ) P ( X < 2 ) = ( 1 e 3 ) ( 1 e 2 )

  • X = usage duration (in mins) of ATM is exponential r.v. with parameter = 1/3.

    (a) P ( X > 2 ) = 1 P ( X < 2 ) = 1 F ( 2 ) = e 2 0.51342

    (b) P ( 2 < X < 3 ) = P ( X < 3 ) P ( X < 2 ) = ( 1 e 3 ) ( 1 e 2 )

    Exponential Distribution

    Example:Suppose the usage duration of a particular ATM is an exponential r.v. with a mean of 3 mins. If someone arrives at the ATM immediately ahead of you, find the probability that you have to wait (a) more than 2 minutes, and (b) between 2 and 3 minutes

    X is exponential r.v. with parameter ( > 0)

    PDF f(x) = ex for x> 0

    CDF = 1

  • Exponential Distribution

    Excel Function : EXPONDIST (x, , cumulative)

    = 1

    cumulative = 0 f (x )

    1 F (x )

    X is exponential r.v. with parameter ( > 0)

    PDF f(x) = ex for x> 0

    CDF = 1

  • Exponential Distribution

    Excel Function : EXPONDIST (x, , cumulative)

    = 1/3

    Example

    P (X > 2) = 1 - EXPONDIST (2, 1/3, 1)

    P (2 < X < 3) = EXPONDIST (3, 1/3, 1) - EXPONDIST (2, 1/3, 1)

    Suppose the usage duration of a particular ATM is an exponential r.v. with a mean of 3 mins. If someone arrives at the ATM immediately ahead of you,

    find the probability that you have to wait (a) more than 2 minutes, and

    (b) between 2 and 3 minutes

  • Exponential Distribution

    Excel Function : EXPONDIST (x, , cumulative)

    = 1/3

    Example

    P (X > 2) = 1 - EXPONDIST (2, 1/3, 1)

    P (2 < X < 3) = EXPONDIST (3, 1/3, 1) - EXPONDIST (2, 1/3, 1)

    Suppose the usage duration of a particular ATM is an exponential r.v. with a mean of 3 mins. If someone arrives at the ATM immediately ahead of you,

    find the probability that you have to wait (a) more than 2 minutes, and

    (b) between 2 and 3 minutes

  • Normal Distribution

  • Density function is the familiar bell-shaped curve

    Normal Distribution

    t

    f(t)

    A r.v. X that obeys a Normal distribution is completely described by

    two parameters : mean and standard deviation .

    We write : X N( ,).

    = 1

    22

    ()2

    22

    Note: f(t) is symmetric around the mean

    f(t) is highest at its mean

  • Normal Distribution

    PDFs of 4 Normally distributed r.vs

  • Many phenomena obey the Normal distribution:

    PSLE scores

    Height of a group of people (e.g., DSC1007 students)

    Stock return over short periods of time

    Width of steel plate from a production process

    Consumer demand for a product on a given day

    But ... some phenomena are not Normally distributed:

    Stock returns over longer periods of time

    Income distributions

    Normal Distribution

  • Suppose : X N( ,)

    How do we compute probabilities such as : P ( a X b ) ?

    Computing Probabilities for Normal Distributions

    Lets first look at the standard Normal case: Z N(0 , 1)

    How do we compute : P ( a Z b ) ?

    = 1

    22

    ()2

    22

  • Consider the standard Normal random variable Z ~ N(0,1)

    Determine the following:

    P(Z 1.55) = ?

    P(0.55 Z 0.50) = ?

    Computing Probabilities for Standard Normal Distributions

  • We have seen how to use a standard Normal table to

    compute probabilities for a r.v.

    Z N(0,1).

    Next :

    We can use the same table to compute probabilities for any

    r.v. that obeys a Normal distribution :

    X N( ,).

    Computing Probabilities for Normal Distributions

  • If X N( ,), then the r.v. Z defined by

    obeys a standard Normal distribution.

    Computing Probabilities for Normal Distributions

    =

    There is a special relationship between N(0,1) and N( ,).

    Because :

    In other words :

    ~ ,

    ~ (0,1)

  • Application of Normal Distribution

  • x 3

    2 +

    + 2 + 3

    68.26%

    95.44%

    99.72%

    Normal Distribution

  • Are you normal?

    Mean = 100 & SD = 15

    The IQ of famous people

  • Example

    The personnel department of Ztel, a large communications company, is reconsidering its hiring policy. Each applicant for a job must take a standard exam, and the hire or no-hire

    decision depends at least in part on the result of the exam. The scores of all applicants have

    been examined closely. They are approximately normally distributed with mean 525 and

    standard deviation 55.

    The current hiring policy occurs in two phases. The first phase separates all applicants into three categories:

    automatic accepts test scores 600 or above

    automatic rejects test scores 425 or below

    maybe the rest

    All the maybes are passed on to a second phase where their previous job experience, special talents, and other factors are used as hiring criteria.

  • Questions

    What is the percentage of applicants who are automatic accepts or rejects?

    If ZTel wants to automatically accept 15% of applicants and automatically reject 10% of them,

    how should the standards be changed?

  • Power of Collaboration

    A Retail Example

  • Two retail chains (lets call them COURTS and Challenger) are planning to

    sell the Apple iPad. Demands at the two retail chains are random variables.

    Let

    X = daily demand for the iPad at COURTS

    Y = daily demand for the iPad at Challenger

    Suppose that X and Y are Normally distributed with

    X = 800 Y = 160

    X = 500 Y = 100

    Corr(X,Y) = 0.23

    A Retail Example

  • Q1: What is probability that the demand for iPads

    in COURTS exceed 1000?

    A Retail Example

  • Q2: Challenger would like to stock enough iPad so that the

    probability that all customers will be able to purchase and

    carry home an iPad is 98%.

    How many iPad does Challenger need to stock per day?

    A Retail Example

    t

    f(t)

    160Stock

  • Q3: COURTS would like to stock enough iPad so that the

    probability that all customers will be able to purchase and

    carry home an iPad is 98%.

    How many iPads does COURTS need to stock per day?

    A Retail Example

  • Lets summarize:To ensure that the probability that all customers will be able to

    purchase and carry home an iPad is 98% ,

    COURTS would need to stock : 1827

    Challenger would need to stock : 365

    Total :

    2192

    A Retail Example

  • A weighted sum of jointly Normal r.v.s

    is a Normal r.v.

    (d) What is the distribution of W?

    Suppose that X and Y are jointly Normal random variables, and

    W = aX + bY

    (a) What is E(W)?

    (b) What is Var(W)?

    (c) What is SD(W)?

    = a E(X) + b E(Y) = a X + b Y

    = a2 Var (X ) + b2 Var (Y ) +2 ab X Y Corr(X ,Y )

    Sums of Normal RVs

  • Suppose that COURTS and Challenger are considering a merger

    (or just a merger of their warehousing operations).

    Q4 : What is the distribution of the demand for iPads from the combined company?

    Q5 : How many iPads would the combined warehouse need to

    stock per day in order to achieve the 98% customer service requirement?

    Sums of Normal RVs

  • Q4 : What is the distribution of the demand for iPads from the combined company?

    We know that W = X + Y ( total demand for iPads at Courts &

    Challenger ) is a Normal r.v.

    Mean W = X + Y = 800 + 160 = 960

    Variance W2 = X

    2 + Y2 + 2X Y Corr(X,Y)

    =5002 + 1002 + 2(500)(100)(0.23) = 283,000

    Std Deviation W2 531.98

    Corr(X,Y) = 0.23

    A Retail Example

    X and Y are Normally distributed with

    X =800 Y =160

    X = 500 Y=100

  • Q5 : How many iPads would the combined warehouse need tostock per day in order to achieve the 98% customer service requirement?

    Corr(X,Y) = 0.23

    A Retail Example

    X and Y are Normally distributed with

    X =800 Y =160

    X = 500 Y=100

  • Q5 : How many iPads would the combined warehouse need tostock per day in order to achieve the 98% customer service requirement?

    Corr(X,Y) = 0.23

    P( Z [(b960)/531.98] ) = 0.98

    [(b960)/531.98] ) ) 2.054

    b 2052.7

    Need to find b such that : P(W b) = 0.98

    A Retail Example

    X and Y are Normally distributed with

    X =800 Y =160

    X = 500 Y=100

  • Normal Distribution Approximation

  • Suppose X1, X2, . . ., Xn are independent and identically distributed (i.i.d.)

    random variables with

    E(Xi) = and SD(Xi) =

    SD(Sn) =

    E(Sn) = n

    Var(Sn) = n2

    Let Sn = X1 + X2 + . . . + Xn

    n

    Sum of Random Variables

  • Suppose X1, X2, . . ., Xn are independent and identically distributed (i.i.d.)

    random variables with

    E(Xi) = and SD(Xi) =

    SD(Sn) =

    E(Sn) = n

    Var(Sn) = n2

    The Central Limit Theorem (for the sum). If n is large (say, at

    least 30), then Sn is approximately Normally distributed with

    mean n and standard deviation n .

    Let Sn = X1 + X2 + . . . + Xn

    n

    Central Limit Theorem

    Let An = 1+2++

    E(An) =

    Var(An) = 2 /n

  • 0.000

    0.050

    0.100

    0.150

    0.200

    0.250

    1 3 5 7 9

    11

    13

    15

    17

    0.000

    0.050

    0.100

    0.150

    0.200

    0.250

    1 3 5 7 9

    11

    13

    15

    17

    0.000

    0.050

    0.100

    0.150

    0.200

    0.250

    1 3 5 7 9

    11

    13

    15

    17

    Example: cast a die n times

    n = 3

    n = 2

    Central Limit Theorem

    n = 1

  • n does not have to be very large (30 is often good enough), especially if the probability distribution of Xi is nice (i.e., it is not too skewed to the left or to the right, and that its tails are not too wide.

    The Central Limit Theorem (CLT) makes use of only two pieces of information: the mean and standard deviation of Xi .

    (This goes a long way in justifying the use of the standard deviation as a

    measure of spread.)

    The Normal distribution can arise in at least three ways :(i) as a natural model for many physical processes,

    (ii) as a sum of several Normal random variables, or

    (iii) as an approximation of a sum (or average) of several iid r.v.s

    Some Comments on CLT

  • Example: An electrical component is guaranteed by its suppliers to have

    2% defective components. To check a shipment, you test a

    random sample of 500 components.

    If the suppliers claim is true, what is the probability of finding 15 or more

    defective components?

    Let X be the number of defective components found during the test.

    Then X is Binomial (500, 0.02).

    P(X15) = 1 P(X14)

    Approximating Binomial with Normal

    Probability of finding 15 or more defective components

    0.08136 (using BINOMDIST)

  • 0.00

    0.05

    0.10

    0.15

    0.20

    0.25

    0.30

    0.35

    0 5

    10

    15

    20

    25

    0.00

    0.05

    0.10

    0.15

    0.20

    0.25

    0.30

    0.35

    0 5

    10

    15

    20

    25

    Examples: p = 0.8

    n = 20

    0.00

    0.05

    0.10

    0.15

    0.20

    0.25

    0.30

    0.35

    0 5

    10

    15

    20

    25

    0.00

    0.05

    0.10

    0.15

    0.20

    0.25

    0.30

    0.35

    0 5

    10

    15

    20

    25

    n = 15

    n = 25

    n = 10

  • Then Y would be a good approximation of X if n is large.

    Suppose that X is Binomial (n, p).

    Then :

    E(X) = np

    Var(X) = np(1-p)

    Let Y be a Normal r.v. with :

    mean np

    variance np(1p)

    Approximating Binomial with Normal

    Good rule of thumb : use the Normal distribution as an

    approximation of the Binomial distribution if

    np 5 and n(1 p) 5

  • Back to Example:

    Let X be the number of defective components found during the test. X is Binomial (500, 0.02).

    np = 500 * 0.02 = 10 > 5

    n (1p) = 500 * 0.98 = 490 > 5

    X ~ N (10, 3.130)

    P(X 15) 1 P(X