Lecture Discrete and continuous.pdf

download Lecture Discrete and continuous.pdf

of 16

Transcript of Lecture Discrete and continuous.pdf

  • 7/29/2019 Lecture Discrete and continuous.pdf

    1/16

    1

    Random Variables

    isa number that you dont know yet

    is variable defined by the probabilities of eachpossible value in the population.

    A random variable

    Types ofRandom Variables

    Discrete Random Variable Whole Number (0, 1, 2, 3 etc.)

    Countable, Finite Number of Values Jump from one value to the next and cannot take any

    values in between.

    Continuous Random Variables Whole or Fractional Number

    Obtained by Measuring

    Infinite Number of Values in Interval Too Many to List unlike Discrete Variable

  • 7/29/2019 Lecture Discrete and continuous.pdf

    2/16

    Discrete Random VariableExamples

    Experiment Random

    Variable

    Possible

    Values

    Children of One

    Gender in Family

    # Girls 0, 1, 2, ..., 10?

    Answer 33 Questions # Correct 0, 1, 2, ..., 33

    Count Cars at Toll

    Between 11:00 & 1:00

    # Cars

    Arriving

    0, 1, 2, ...,

    Open Check in Lines # Open 0, 1, 2, ..., 8

    Washington State PopulationSurvey and Random Variables

    A telephone survey ofhouseholds throughoutWashington State.

    But some households dont havephones.

    number of telephones,x P(x)

    0 0.03500

    1 0.70553

    2 0.21769

    3 0.02966

    4 0.00775

    5 0.00332

    6 0.00088

    7 0.00002

    8 0.00000

    9 0.00015

    Total 1.00000

    0.04

    0.71

    0.22

    0.03 0.01 0.000.00

    0.10

    0.20

    0.30

    0.40

    0.50

    0.60

    0.70

    0 1 2 3 4 5 6 7 8 9

    Number of Telephone Lines (x)

    P(x)

  • 7/29/2019 Lecture Discrete and continuous.pdf

    3/16

    Definitions: Binomial

    Binomial: Suppose that n independent experiments, or

    trials, are performed, where n is a fixed number, and that

    each experiment results in a success with probabilityp

    and a failure with probability 1-p. The total number of

    successes, X, is a binomial random variable with

    parameters n and p.

    We write:X ~ Bin (n, p) {reads: X is distributedbinomially with parameters n and p}

    And the probability that X=r(i.e., that there areexactly rsuccesses) is:

    rnrn

    r

    pprXP

    )1()(

    Binomial example

    Take the example of 5 coin tosses. Whats

    the probability that exactly 3 heads in 5coin tosses will occur?

  • 7/29/2019 Lecture Discrete and continuous.pdf

    4/16

    P(getting exactly 3 heads ) = (1/2)3 (1-1/2)2

    = (1/2)3 (1-1/2)2

    =10 ()5 =0.3125=31.25%

    5

    3

    rnrn

    r

    pprXP

    )1()(

    SOLUTION

    !3!5(/!5 3)-

    x0 3 4 52

    Binomial distributionfunction:X= the number of heads tossed in 5 cointosses

    number of heads

    p(x)

    number of heads

    0.3125 -

    0.03125 -0.15625 -

  • 7/29/2019 Lecture Discrete and continuous.pdf

    5/16

    Definitions: Bernouilli

    Bernouilli trial: If there is only 1 trial with

    probability of successp and probability of

    failure 1-p, this is called a Bernouilli

    distribution. (special case of the binomial

    with n=1)

    Probability of success:

    Probability of failure:

    pppXP

    111

    1

    1

    )1()1(

    pppXP

    1)1()0( 010

    1

    0

    Binomial distribution: example In tossing a coin 20 times, whats the

    probability of getting exactly 10 heads?

    176.)5(.)5(. 101020

    10

  • 7/29/2019 Lecture Discrete and continuous.pdf

    6/16

    Binomial distribution: example If 20 consumers are asked whether they like

    to buy a certain product , whats theprobability that 2 or fewer of themdislike?(Assume that there is a 50% chancea consumer buys the product )

    4

    472018220

    2

    572019120

    1

    72020020

    0

    108.1

    108.1105.9190)5(.

    !2!18

    !20)5(.)5(.

    109.1105.920)5(.!1!19

    !20)5(.)5(.

    105.9)5(.!0!20

    !20)5(.)5(.

    x

    xxx

    xxx

    x

    Example: Poisson distribution

    Suppose that food poisoning case in certain restaurant has an

    incidence of 1 in 1000 person-years. Assuming that members of

    the population are affected independently, find the probability of kcases in a population of 10,000 (followed over 1 year) for k=0,1,2.

    The expected value (mean) = = .001*10,000 = 1010 new cases expected in this population per year

    00227.!2

    )10()2(

    000454.!1

    )10()1(

    0000454.!0

    )10()0(

    )10(2

    )10(1

    )10(0

    eXP

    eXP

    eXP

  • 7/29/2019 Lecture Discrete and continuous.pdf

    7/16

    more on Poisson

    Poisson Process (rates)

    Note that the Poisson parameter can be given asthe mean number of events that occur in a definedtime period OR, equivalently, can be given as arate, such as =2/month (2 events per 1 month) thatmust be multiplied by t=time (called a PoissonProcess)

    X ~ Poisson ()

    !

    )()(

    k

    etkXP

    tk

    E(X) = tVar(X) = t

    Example

    For example, if closing of savings accountsin a certain bank are occurring at a rate of

    about 2 per month, then whats theprobability that exactly 4 cases will occur inthe next 3 months?

    X ~ Poisson (=2/month)

    %4.13!4

    6

    !4

    )3*2(months)3in4P(X

    )6(4)3*2(4

    ee

    Exactly 6 cases?

    %16!6

    6

    !6

    )3*2(months)3in6P(X

    )6(6)3*2(6

    ee

  • 7/29/2019 Lecture Discrete and continuous.pdf

    8/16

    Continuous Probability Distributions

    A continuous random variable is a variable thatcan assume any value in an interval

    thickness of an item

    time required to complete a task

    temperature of a solution

    height, in inches

    These can potentially take on any

    value, depending only on the ability to measure

    accurately.

    The Uniform Distribution

    The uniform distribution is a probability

    distribution that has equal probabilities for all

    possible outcomes of the random variable

    xmin xmaxx

    f(x)Total area under the

    uniform probability

    density function is 1.0

  • 7/29/2019 Lecture Discrete and continuous.pdf

    9/16

    The Continuous Uniform Distribution:

    otherwise0

    bxaifab

    1

    where

    f(x) = value of the density function at any x value

    a = minimum value of x

    b = maximum value of x

    The Uniform Distribution(continued)

    f(x) =

    Uniform Distribution Example

    Example: Uniform probability distributionover the range 2 x 6:

    2 6

    .25

    f(x) = = .25 for 2 x 66 - 21

    x

    f(x)

    42

    62

    2

    ba

    1.33312

    2)-(6

    12

    a)-(b

    222

  • 7/29/2019 Lecture Discrete and continuous.pdf

    10/16

    The Normal ProbabilityDensity Function

    The formula for the normal probability densityfunction is

    Where e = the mathematical constant approximated by 2.71828 = the mathematical constant approximated by 3.14159 = the population mean = the population standard deviationx = any value of the continuous variable, < x <

    22 /2)-( x

    2e

    2

    1=f( x)

    Cumulative Normal Distribution

    For a normal random variable X with mean and

    variance 2 , i.e., X~N(, 2), the cumulative

    distribution function is

    )xP(X)F(x 00

    x0 x0

    )xP(X 0

    f(x)

  • 7/29/2019 Lecture Discrete and continuous.pdf

    11/16

    xba

    xba

    xba

    Finding Normal Probabilities(continued)

    F( a)F( b)=b)

  • 7/29/2019 Lecture Discrete and continuous.pdf

    12/16

    Example

    If X is distributed normally with mean of 100and standard deviation of 50, the Z value for

    X = 200 is

    This says that X = 200 is two standard

    deviations (2 increments of 50 units) above

    the mean of 100.

    2.050

    100200

    XZ

    The Standardized Normal Table

    Z0 2.00

    .4772

    Example:

    P(Z < 2.00) = 0.5000+0.4772=.9772

    .5000

  • 7/29/2019 Lecture Discrete and continuous.pdf

    13/16

    The Standardized Normal Table

    Z0-2.00

    Example:

    P(Z < -2.00) = 1 0.9772

    = 0.0228

    Fornegative Z-values, use the fact that thedistribution is symmetric to find the needed

    probability:

    Z0 2.00

    .9772

    .0228

    .9772.0228

    (continued)

    Finding Normal Probabilities

    Suppose X is normal with mean 8.0 and

    standard deviation 5.0

    Find P(X < 8.6)

    X

    8.6

    8.0

  • 7/29/2019 Lecture Discrete and continuous.pdf

    14/16

    Suppose X is normal with mean 8.0 and

    standard deviation 5.0. Find P(X < 8.6)

    Z0.120X8.68

    = 8 = 10

    = 0 = 1

    (continued)

    Finding Normal Probabilities

    0.125.0

    8.08.6

    XZ

    P(X < 8.6) P(Z < 0.12)

    EXAMPLE 2

    The daily water usage per person inTetuan, Zamboanga City follows the a normaldistribution with a mean of 20 gallons and a

    standard deviation of 5 gallons. About 68percent of those living in Tetuan will use howmany gallons of water?

    About 68% of the daily water usage will liebetween 15 and 25 gallons.

  • 7/29/2019 Lecture Discrete and continuous.pdf

    15/16

    EXAMPLE 2

    What is the probability that a person

    from Tetuan selected at random will

    use at least 20 to less than 24 gallons

    per day?

    00.05

    2020

    Xz

    80.05

    2024

    Xz

    - 5

    0 . 4

    0 . 3

    0 . 2

    0 . 1

    . 0

    x

    f

    (

    x

    r a l i t r b u i o n : = 0 ,

    -4 -3 -2 -1 0 1 2 3 4

    P(0 z

  • 7/29/2019 Lecture Discrete and continuous.pdf

    16/16

    EXAMPLE 2 continued

    What percent of the population usewater at least 18 to less than 26 gallons

    per day?

    40.05

    2018

    Xz

    20.15

    2026

    Xz

    Example 2 continued

    The area associated with a z-value of0.40 is

    .1554.

    The area associated with a z-value of 1.20 is

    .3849.

    Adding these areas, the result is .5403.

    We conclude that 54.03 percent of the

    residents use at least 18 but less than 26

    gallons of water per day.