47
Lecture (7) Lecture (7) Random Variables Random Variables and and Distribution Functions Distribution Functions

Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Lecture (7)Lecture (7)

Random Variables Random Variables and and

Distribution FunctionsDistribution Functions

Page 2: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Random VariablesRandom Variables

�� Parameter that cannot be predicted with certaintyParameter that cannot be predicted with certainty

�� Outcome of a random or uncertain process Outcome of a random or uncertain process -- flipping flipping

a coin or picking out a card from decka coin or picking out a card from deck

�� Can be discrete or continuousCan be discrete or continuous

�� Data are usually discrete or quantizedData are usually discrete or quantized

�� Usually easier to apply continuous distribution to Usually easier to apply continuous distribution to

discrete data that has been organized into binsdiscrete data that has been organized into bins

Page 3: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

�� A random variable is discrete if it can A random variable is discrete if it can assume a countable number of values. assume a countable number of values.

�� A random variable is continuous if it can A random variable is continuous if it can assume an uncountable number of values.assume an uncountable number of values.

0 11/21/41/16

Continuous random variable

After the first value is defined

the second value, and any value

thereafter are known.

Therefore, the number of

values is countable

After the first value is defined,

any number can be the next one

Discrete random variable

Therefore, the number of

values is uncountable

0 1 2 3 ...

DiscreteDiscrete and Continuous Random Variablesand Continuous Random Variables

Page 4: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

A A probability distribution probability distribution of of XX provides the provides the

probability of each possible value of the probability of each possible value of the

random variable. If Prandom variable. If PXX((xx) is the probability ) is the probability

that that x x is the value of the random variable, is the value of the random variable,

we know that and that we know that and that

where the summation is over all values that where the summation is over all values that

XX takes on. This is because these values of takes on. This is because these values of

XX are mutually exclusive and one of them are mutually exclusive and one of them

must occur.must occur.

1)(P0 X ≤≤ x 1)(PX =∑ x

Probability distributionProbability distribution

Page 5: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

The sum of numbers showing on two true The sum of numbers showing on two true

dices.dices.

0

1

2

3

4

5

6

7

0 1 2 3 4 5 6 7

11PPXX((xx))

TotalTotal1212111110109988776655443322XX

36

1

36

1

36

2

36

2

36

3

36

3

36

4

36

4

36

5

36

5

36

6

7 8 9 10 11 12

6 7 8 9 10 11

5 6 7 8 9 10

4 5 6 7 8 9

3 4 5 6 7 8

2 3 4 5 6 7

Examples Probability distribution

0

1

2

3

4

5

6

7

0 1 2 3 4 5 6 7

1 2 3 4 5 6

5

4

3

2

1

2

3

4

5

6

7 8 9 10 11 12

Page 6: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

The probability distribution can be also The probability distribution can be also

presented by a graph. presented by a graph.

0

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

0.18

2 3 4 5 6 7 8 9 10 11 12

Sum of numbmers

Pro

bab

ilit

y

And by a mathematical function:36

76)(PX

xx

−−=

Page 7: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Example 2Example 2

��Probability distributionProbability distribution

��ValuesValues probability probability

�� 00 1/4 = .251/4 = .25

�� 11 2/4 = .502/4 = .50

�� 22 1/4 = .25 1/4 = .25

Event: Toss 2 Coins. Count # Tails.

T

T

T T

Page 8: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Graphical Representation of Graphical Representation of pdfpdf and and cdfcdf

Page 9: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Examples of Discrete Probability DistributionsExamples of Discrete Probability Distributions

Uniform Discrete Distribution

Bernoulli Distribution

Binomial Distribution

Poisson Distribution

Page 10: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Uniform Distribution (Discrete Case)Uniform Distribution (Discrete Case)

1, 1, 2,3,.....,

( )

0

k np k n

=

=

Example: throwing a die.

All 6 faces of a die:

111/61/61/61/61/61/61/61/61/1/

661/61/6PPXX((xx))

TotalTotal665544332211XX

Page 11: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Bernoulli DistributionBernoulli Distribution

The random variable X that takes the values 0 or 1 with probability 1-p and q respectively, i.e.

Pr( 0) (1 )

Pr( 1)

X q p

X p

= = = −

= =

is called a Bernoulli Variable.

Example: throwing the coin.

Page 12: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

The Binomial DistributionThe Binomial Distribution

�� The binomial experiment can result in only one of two The binomial experiment can result in only one of two possible outcomes.possible outcomes.

�� Typical cases where the binomial experiment applies:Typical cases where the binomial experiment applies:

�� A coin flipped results in heads or tailsA coin flipped results in heads or tails

�� An election candidate wins or losesAn election candidate wins or loses

�� An employee is male or femaleAn employee is male or female

Page 13: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Binomial Distribution: B(n,p) Binomial Distribution: B(n,p)

Consider a random sequence of n Bernoulli trials, each with: Probability of success = pProbability of failure = q= 1-pwe evaluate the number of r success in the n trials by the number of combinations. An outcome of the experiment like,

times times

... ...

There are of such combinations

each having a probaility

!Pr( ) , 0,1,...,

!( )!

r n r

r n r

r n r

r n r r n r

sss ss fff ff

p q

n

r

p q

n nX r p q p q r n

r r n r

− −

= = = =

67864748

Example: throwing the coin several times (n times).

Page 14: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

�� There are n trials (n is finite and fixed).There are n trials (n is finite and fixed).

�� Each trial can result in a success or a failure.Each trial can result in a success or a failure.

�� The probability p of success is the same for all The probability p of success is the same for all the trials.the trials.

�� All the trials of the experiment are All the trials of the experiment are independent.independent.

�� Binomial Random VariableBinomial Random Variable

�� The binomial random variable The binomial random variable countscounts the the number of successes in n trials of the binomial number of successes in n trials of the binomial experiment.experiment.

�� By definition, this is a discrete random variable.By definition, this is a discrete random variable.

Binomial ExperimentBinomial Experiment

Page 15: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

S1

S2

S2

F2

F1

F2

S3

S3

S3

S3

F3

F3

F3

F3

P(SSS)=p3

P(SSF)=p2(1-p)

P(SFS)=p(1-p)p

P(SFF)=p(1-p)2

P(FSS)=(1-p)p2

P(FSF)=(1-p)p(1-p)

P(FFS)=(1-p)2p

P(FFF)=(1-p)3

P(S1)=p

P(S2|S1

)

P(F1 )=1-p

P(F2 |S1)

P(S2|F1

)

P(F2 |F

1 )

P(S2)=p

P(F2)=1-p

P(S2)=p

P(F2 )=1-p

P(S3|S2

,S1)

P(F3|S2,S1)

P(S3|F2

,S1)

P(F3|F2,S1)

P(S3|S2

,F1)

P(S3|F2

,F1)

P(F3|F2,F1)

P(F3|S2,F1)

P(S3)=p

P(S3)=p

P(S3)=p

P(S3)=p

P(F3 )=1-p

P(F3)=1-p

P(F3 )=1-p

P(F3 )=1-p

Since the outcome of each trial is

independent of the previous outcomes,

we can replace the conditional probabilities

with the marginal probabilities.

Since the outcome of each trial is

independent of the previous outcomes,

we can replace the conditional probabilities

with the marginal probabilities.

P(S2|S1

Developing the Binomial Probability Distribution (n = Developing the Binomial Probability Distribution (n = 3)3)

Page 16: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

P(SSS)=p3

P(SSF)=p2(1-p)

P(SFS)=p(1-p)p

P(SFF)=p(1-p)2

P(FSS)=(1-p)p2

P(FSF)=(1-p)p(1-p)

P(FFS)=(1-p)2p

P(FFF)=(1-p)3

Let X be the number of successes

in three trials. Then,

X = 3

X =2

X = 1

X = 0

P(X = 3) = p3

P(X = 2) = 3p2(1-p)

P(X = 1) = 3p(1-p)2

P(X = 0) = (1- p)3

This multiplier is calculated in the following formula

SSS

SS

S S

SS

Developing the Binomial Probability Distribution (n = Developing the Binomial Probability Distribution (n = 3)3)

Page 17: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Calculating the Binomial ProbabilityCalculating the Binomial Probability

xnxn

x)p1(pC)x(p)xX(P −−===

In general, The binomial probability is calculated by:

)!xn(!x

!nCwhere n

x−

=

Page 18: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

�� ExampleExample�� A student is registered in a statistics course and A student is registered in a statistics course and intends to rely on luck to pass the next quiz.intends to rely on luck to pass the next quiz.

�� The quiz consists on 10 multiple choice questions The quiz consists on 10 multiple choice questions with 5 possible choices for each question, only one with 5 possible choices for each question, only one of which is the correct answer.of which is the correct answer.

�� The student will guess the answer to each The student will guess the answer to each questionquestion

�� Find the following probabilitiesFind the following probabilities�� The student gets no answer correctThe student gets no answer correct�� The student gets two answer correct?The student gets two answer correct?�� The student fails the quizThe student fails the quiz

Calculating the Binomial ProbabilityCalculating the Binomial Probability

Page 19: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

�� SolutionSolution

�� Checking the conditionsChecking the conditions

��An answer can be either correct or incorrect.An answer can be either correct or incorrect.

��There is a fixed finite number of trials (n=10)There is a fixed finite number of trials (n=10)

�� Each answer is independent of the others.Each answer is independent of the others.

��The probability p of a correct answer (.20) does The probability p of a correct answer (.20) does not change from question to question.not change from question to question.

Calculating the Binomial ProbabilityCalculating the Binomial Probability

Page 20: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

�� Solution Solution –– Continued Continued

�� Determining the binomial probabilities:Determining the binomial probabilities:

Let X = the number of correct answersLet X = the number of correct answers

Calculating the Binomial ProbabilityCalculating the Binomial Probability

1074.)80(.)20(.)!010(!0

!10)0( 0100 =

−== −

XP

3020.)80(.)20(.)!210(!2

!10)2( 2102 =

−== −

XP

Page 21: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

= p(0) + p(1) + p(2) + p(3) + p(4)

= .1074 + .2684 + .3020 + .2013 + .0881

=.9672

�� Solution Solution –– Continued Continued

�� Determining the binomial probabilities:Determining the binomial probabilities:

the student fails the test if the number of correct the student fails the test if the number of correct answers is less than 5, which means less than or answers is less than 5, which means less than or equal to 4.equal to 4.

Calculating the Binomial ProbabilityCalculating the Binomial Probability

This is called cumulative probability

P(X≤4)

Page 22: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

E(X) = E(X) = µµµµµµµµ = = npnp

V(X) = V(X) = σσσσσσσσ22 = np(1= np(1--p)p)

�� ExampleExample�� If all the students in class intend to guess the If all the students in class intend to guess the answers to the quiz, what is the mean and the answers to the quiz, what is the mean and the standard deviation of the quiz mark?standard deviation of the quiz mark?

�� SolutionSolution�� m = m = npnp = 10(.2) = 2.= 10(.2) = 2.

�� s = [np(1s = [np(1--p)]p)]1/21/2 = [10(.2)(.8)]= [10(.2)(.8)]1/21/2 = 1.26.= 1.26.

Mean and Variance of Binomial VariableMean and Variance of Binomial Variable

Page 23: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Binomial Distribution Binomial Distribution B(n,pB(n,p))

Page 24: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Binomial distribution for n=4 and p=0.9

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

1 2 3 4

Values of X

Pro

bability

Binomial distribution for n=10 and p=0.9

0

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

0.45

1 2 3 4 5 6 7 8 9 10

Values of X

Pro

bability

Chart 1

Chart 2

xnxn

x)p1(pC)x(p)xX(P −−===

Page 25: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Binomial distribution for n=20 and p=0.9

0

0.05

0.1

0.15

0.2

0.25

0.3

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Values of X

Pro

bability

Binomial distribution for n=40 and p=0.9

0

0.05

0.1

0.15

0.2

0.25

1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39

Values of X

Pro

bability

Chart 3

Chart 4

xnxn

x)p1(pC)x(p)xX(P −−===

Page 26: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Binomial distribution for n=80 and p=0.9

0

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77

Values of X

Pro

bability

Binomial distribution for n=160 and p=0.9

0

0.02

0.04

0.06

0.08

0.1

0.12

1 11 21 31 41 51 61 71 81 91 101 111 121 131 141 151

Values of X

Pro

bability

Chart 5

Chart 6

xnxn

x)p1(pC)x(p)xX(P −−===

Page 27: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Binomial distribution for n=160 and p=0.7

0

0.01

0.02

0.03

0.04

0.05

0.06

0.07

0.08

1 11 21 31 41 51 61 71 81 91 101 111 121 131 141 151

Values of X

Pro

bability

Binomial distribution for n=160 and p=0.5

0

0.01

0.02

0.03

0.04

0.05

0.06

0.07

1 11 21 31 41 51 61 71 81 91 101 111 121 131 141 151

Values of X

Pro

bability

Chart 7

Chart 8

xnxn

x)p1(pC)x(p)xX(P −−===

Page 28: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Binomial distribution for n=160 and p=0.25

0

0.01

0.02

0.03

0.04

0.05

0.06

0.07

0.08

1 11 21 31 41 51 61 71 81 91 101 111 121 131 141 151

Values of X

Pro

bability

Chart 9

xnxn

x)p1(pC)x(p)xX(P −−===

Page 29: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

�� The Poisson experiment typically fits cases of The Poisson experiment typically fits cases of rare events that occur over a fixed amount of rare events that occur over a fixed amount of time or within a specified regiontime or within a specified region

�� Typical casesTypical cases�� The number of errors a typist makes per pageThe number of errors a typist makes per page�� The number of customers entering a service The number of customers entering a service station per hourstation per hour

�� The number of telephone calls received by a The number of telephone calls received by a switchboard per hour.switchboard per hour.

�� The number of Rainy days in Jeddah within a The number of Rainy days in Jeddah within a year.year.

Poisson DistributionPoisson Distribution

Page 30: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

�� The number of successes (events) that occur in a The number of successes (events) that occur in a certain time interval is independent of the number of certain time interval is independent of the number of successes that occur in another time interval.successes that occur in another time interval.

�� The probability of a success in a certain time interval The probability of a success in a certain time interval is: the same for all time intervals of the same size, is: the same for all time intervals of the same size, proportional to the length of the interval.proportional to the length of the interval.

�� The probability that two or more successes will occur The probability that two or more successes will occur in an interval approaches zero as the interval becomes in an interval approaches zero as the interval becomes smaller.smaller.

Properties of the Poisson ExperimentProperties of the Poisson Experiment

Page 31: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

�� The Poisson Random VariableThe Poisson Random Variable�� The Poisson variable indicates the number of The Poisson variable indicates the number of successes that occur during a given time successes that occur during a given time interval or in a specific region in a Poisson interval or in a specific region in a Poisson experimentexperiment

�� Probability Distribution of the Poisson Random Probability Distribution of the Poisson Random Variable.Variable.

µ==

===µ−

)X(V)X(E

...2,1,0x!x

e)x(p)xX(P

x

The Poisson Variable and DistributionThe Poisson Variable and Distribution

Page 32: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Poisson Distributions (Graphs)Poisson Distributions (Graphs)

0

0.1

0.2

0.3

0.4

1 2 3 4 5 6 7 8 9 10 11

3678.e!0

1e)0(p)0X(P 1

01

===== −−

3678.e!1

1e)1(p)1X(P 1

11

===== −−

1839.2

e

!2

1e)2(p)2X(P

121

=====−−

0613.6

e

!3

1e)3(p)3X(P

131

=====−−

0 1 2 3 4 5

Page 33: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Poisson Distributions (Graphs)Poisson Distributions (Graphs)

0

0.05

0.1

0.15

0.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

0

0.05

0.1

0.15

0.2

1 2 3 4 5 6 7 8 9 10 11

0

0.05

0.1

0.15

0.2

0.25

0.3

1 2 3 4 5 6 7 8 9 10 11

Poisson probability

distribution with µ =2

Poisson probability

distribution with µ =5

Poisson probability

distribution with µ =7

0 1 2 3 4 5 6

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Page 34: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Poisson Distribution (Example 1)Poisson Distribution (Example 1)

�� ExampleExample

�� The number of Typographical errors in new The number of Typographical errors in new editions of textbooks is Poisson distributed with a editions of textbooks is Poisson distributed with a mean of 1.5 per 100 pages. mean of 1.5 per 100 pages.

�� 100 pages of a new book are randomly selected.100 pages of a new book are randomly selected.

�� What is the probability that there are no typos?What is the probability that there are no typos?

�� SolutionSolution

�� P(X=0)=P(X=0)=

e-µµx

x!

e-1.51.50

0!.2231= =

Page 35: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Poisson Distribution (Example 2)Poisson Distribution (Example 2)

�� ExampleExample

�� For a 400 page book calculate the following For a 400 page book calculate the following probabilitiesprobabilities

�� TThere are no typoshere are no typos

��There are five or fewer typosThere are five or fewer typos

�� SolutionSolution�� P(X=0)=P(X=0)=

�� P(XP(X≤≤5)=<use the formula to find p(0), 5)=<use the formula to find p(0), p(1),p(1),……,p(5), then calculate ,p(5), then calculate p(0)+p(1)+p(0)+p(1)+……+p(5) = .4457+p(5) = .4457

e-µµx

x!

e-660

0!.002479= =

Important!

A mean of 1.5 typos

per100 pages, is

equivalent to 6 typos

per 400 pages.

Page 36: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

The difference between Binomial and Poisson The difference between Binomial and Poisson distributions.distributions.

The parameter p and n in the Poisson distribution are dependent.

The Binomial distribution is bounded by X=0, X=n with p(X=0)=(1-p)^n and p(X=n)=p^n

The Poisson distribution is bounded by X=0 for p(X=0)=e^-λ

The Poisson distribution only the occurrence of an event can be counted; the number of its non-occurrences cannot.

Page 37: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

�� The The bivariatebivariate (or joint) distribution (or joint) distribution is used when is used when the relationship between two random variables is the relationship between two random variables is studied.studied.

�� The probability that X assumes the value x, and Y The probability that X assumes the value x, and Y assumes the value y is denotedassumes the value y is denoted

p(x,y) = P(X=x and Y = y)p(x,y) = P(X=x and Y = y)

Discrete Discrete BivariateBivariate DistributionsDistributions

Page 38: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

BivariateBivariate DistributionsDistributions

1y)p(x, 2.

1y)p(x,0 1.

:conditionsfollowingthesatisfies

function y probabilitjoint The

y all

=

≤≤

∑∑xall

Page 39: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

�� ExampleExample

�� X and Y are two variables. Let X and Y denote X and Y are two variables. Let X and Y denote the runoff and the the runoff and the raifallraifall, respectively., respectively.

�� The The bivariatebivariate probability distribution is probability distribution is presented next.presented next.

BivariateBivariate DistributionsDistributions

Page 40: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

p(x,y)

BivariateBivariate DistributionsDistributions

X

Y

X=0 X=2X=1

y=1

y=2

y=0

0.42

0.12

0.21

0.07

0.06

0.02

0.06

0.03

0.01

Example continued X

Y 0 1 2

0 .12 .42 .06

1 .21 .06 .03

2 .07 .02 .01

Page 41: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Marginal ProbabilitiesMarginal Probabilities

�� ExampleExample-- continuedcontinued

�� Sum across rows and down columnsSum across rows and down columns

X

Y 0 1 2 p(y)

0 .12 .42 .06 .60

1 .21 .06 .03 .30

2 .07 .02 .01 .10

p(x) .40 .50 .10 1.00

p(0,0)

p(0,1)p(0,2)

The marginal probability P(X=0)

P(Y=1), the

marginal

probability.

Page 42: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

)yY(P

)yYandxX(P)yY|xX(P

=

=====

1.30.

03.

)1Y(P

)1Yand2X(P)1Y|2X(P

2.30.

06.

)1Y(P

)1Yand1X(P)1Y|1X(P

7.30.

21.

)1Y(P

)1Yand0X(P)1Y|0X(P

===

=====

===

=====

===

=====

Example - continued

The sum is

equal to 1.0

X

Y 0 1 2 p(y)

0 .12 .42 .06 .60

1 .21 .06 .03 .30

2 .07 .02 .01 .10

p(x) .40 .50 .10 1.00

Conditional ProbabilityConditional Probability

Page 43: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Excel ApplicationExcel Application

�� See Excel See Excel

Page 44: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Probability Calculation Probability Calculation

�� Probability: Numerical measure of the likelihood that Probability: Numerical measure of the likelihood that an event will occuran event will occur

�� Some probabilities that can be calculated using Excel:Some probabilities that can be calculated using Excel:

�� Binomial ProbabilitiesBinomial Probabilities

�� Poisson ProbabilitiesPoisson Probabilities

�� Hypergeometric ProbabilitiesHypergeometric Probabilities

�� Normal ProbabilitiesNormal Probabilities

�� Exponential ProbabilitiesExponential Probabilities

Page 45: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Binomial ProbabilitiesBinomial Probabilities

�� Use BINOMDIST to compute binomial distribution Use BINOMDIST to compute binomial distribution probabilities and cumulative binomial probabilitiesprobabilities and cumulative binomial probabilities

Cell =Cell =BINOMDIST(number_sBINOMDIST(number_s, trials, , trials, probability_sprobability_s, , cumulative)cumulative)

�� Calculates the probability that a sequence of Calculates the probability that a sequence of independent trials with two possible outcomes will independent trials with two possible outcomes will have a given number of successes have a given number of successes

�� Cumulative is either TRUE or FALSECumulative is either TRUE or FALSE

Page 46: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Poisson ProbabilitiesPoisson Probabilities

�� Use POISSON to compute Poisson ProbabilitiesUse POISSON to compute Poisson Probabilities

Cell = POISSON (x, mean, cumulative)Cell = POISSON (x, mean, cumulative)

�� Shows the probability of x occurrences of an event Shows the probability of x occurrences of an event over a specified interval of time or spaceover a specified interval of time or space

Page 47: Random Variables and Distribution Functions HWR 352.pdf · Lecture (7) Random Variables and Distribution Functions. Random Variables ... Can be discrete or continuous Data are usually

Hypergeometric ProbabilitiesHypergeometric Probabilities

�� Use HYPGEOMDIST to compute hypergeometric Use HYPGEOMDIST to compute hypergeometric probabilitiesprobabilities

Cell =Cell =HYPGEOMDIST(sample_sHYPGEOMDIST(sample_s, , number_samplenumber_sample, , population_spopulation_s, , number_popnumber_pop))

�� Computes the probability of x successes Computes the probability of x successes ((sample_ssample_s) in n trials () in n trials (number_samplenumber_sample) when the ) when the trials are dependenttrials are dependent

�� Similar to Binomial except trials are not Similar to Binomial except trials are not independent independent –– probability of success changes from probability of success changes from trial to trialtrial to trial

�� Does not compute cumulative probabilitiesDoes not compute cumulative probabilities