lecture 6: random variable - unbddu/2623/lecture_notes/lecture6_student.pdf · 2018. 10. 16. ·...

50
Lecture 6: Random Variable Donglei Du ([email protected]) Faculty of Business Administration, University of New Brunswick, NB Canada Fredericton E3B 9Y2 Donglei Du (UNB) ADM 2623: Business Statistics 1 / 54

Upload: others

Post on 09-Mar-2021

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Lecture 6: Random Variable

Donglei Du([email protected])

Faculty of Business Administration, University of New Brunswick, NB Canada FrederictonE3B 9Y2

Donglei Du (UNB) ADM 2623: Business Statistics 1 / 54

Page 2: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Table of contents

1 Probability TheoryWhat is Random Variable?Probability mass functionFunction of random variables

2 Measures of Random VariableExpectation of Random VariableRule of ExpectationVariance of Random VariableRule of Variance

3 Joint Probability of Two Random VariablesIndependent Random VariablesCovariance of two Random Variables

4 Some common discrete random variablesBernoulli Random VariableBinomial Random Variable

Donglei Du (UNB) ADM 2623: Business Statistics 2 / 54

Page 3: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

What is Random Variable?

Given an random experiment, a random variable is a function (ormap) from sample space to numbers.

For any discrete random variable, we define its probabilitydistribution as the listing of all possible outcomes of an experimentand the corresponding probability.

There are three forms to represent a probability distribution of arandom variable

TabularGraphicalFormula

Donglei Du (UNB) ADM 2623: Business Statistics 4 / 54

Page 4: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Example

Toss one fair coin in each trial: Let X be the random variable that isdefined to be 1 if head comes up and 0 otherwise.

The probability distribution of X is (in its tabular form)

X P (X)

1 0.50 0.5

Donglei Du (UNB) ADM 2623: Business Statistics 5 / 54

Page 5: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Example

Toss three fair coins in each trial: This is an random experiment: LetX be the random variable that is defined to be the number of headsin these three tossing.

The probability distribution of X is (in its tabular form)

X P (X)

0 18

1 38

2 38

3 18

Donglei Du (UNB) ADM 2623: Business Statistics 6 / 54

Page 6: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Example

We roll a pair of six-faced dice in each trial: This is an randomexperiment: Let X be the random variable that is defined to be sumof the two dice.The probability distribution of X is (in its tabular form)

X P (X)

2 1/363 2/364 3/365 4/366 5/367 6/368 5/369 4/36

10 3/3611 2/3612 1/36

Donglei Du (UNB) ADM 2623: Business Statistics 7 / 54

Page 7: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

graphical form for the two-dice example

The probability distribution of X is (in its graphical form)

6

P(X)(1/36)

5

4

3

2

1

2013/9/18 Donglei Du: Lecture 1 1

2 4 6 8 10 12 X

Donglei Du (UNB) ADM 2623: Business Statistics 8 / 54

Page 8: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Probability mass function for discrete random variable

The probability distribution of any discrete random variable X in itsformula form is called the probability mass function (pmf).

The probability mass function (pmf) for any random variable X is anypositive function p from the sample space S = {a1, . . . , } to [0, 1]such that

(i)p(ai) = P (X = ai)

(ii)0 ≤ p(ai) ≤ 1, i = 1, . . .

(iii)∞∑i=1

p(ai) = 1

Donglei Du (UNB) ADM 2623: Business Statistics 9 / 54

Page 9: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Probability mass function for the two-dice example

The probability mass function for X in the two-dice example is

P (X = i) =

{i−136 , if 2 ≤ i ≤ 713−i36 , if 8 ≤ i ≤ 12.

Donglei Du (UNB) ADM 2623: Business Statistics 10 / 54

Page 10: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Function of random variables

A function of random variables is again a random variable

Linear function: A x + bExponential function: X5Logarithm function: log X. . .

Donglei Du (UNB) ADM 2623: Business Statistics 11 / 54

Page 11: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

How to calculate the probability distribution of a functionof random variables?

Example: Given a r.v. X with the following probability distribution.

X P(X)

-2 0.11 0.43 0.5

Problem: Calculate the probability distribution of Y = X3

Solution:Y P(Y)

(−2)3 = −8 0.113 = 1 0.433 = 27 0.5

Donglei Du (UNB) ADM 2623: Business Statistics 12 / 54

Page 12: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Measures of Random Variable

Expectation

Variance/Standard Deviation

Donglei Du (UNB) ADM 2623: Business Statistics 14 / 54

Page 13: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Expectation of Random Variable

µ = E(X) =

∞∑i=1

xip(xi)

The expectation of a random variable is the average value of therandom variable that we expect in the long run

Donglei Du (UNB) ADM 2623: Business Statistics 15 / 54

Page 14: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Example

Toss one fair coin in each trial: Let X be the number of heads. ThenE[X] = 1(0.5) + 0(0.5) = 0.5

Toss three fair coins in each trial: Let X be the number of heads.Then E[X] = 1.5 as calculated below in the table.

X P (X) XP (X)

0 1/8 01 3/8 3/82 3/8 6/83 1/8 3/8

12/8=1.5

Donglei Du (UNB) ADM 2623: Business Statistics 16 / 54

Page 15: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Example

Roll a pair of six-faced dice in each trial: This is an randomexperiment: Let X be the random variable that is defined to be sumof the two dice. Then [X] = 7.

X P (X) XP (X)

2 1/36 2/363 2/36 6/364 3/36 12/365 4/36 20/366 5/36 30/367 6/36 42/368 5/36 40/369 4/36 36/36

10 3/36 30/3611 2/36 22/3612 1/36 12/36

7

Donglei Du (UNB) ADM 2623: Business Statistics 17 / 54

Page 16: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Rule of Expectation

Given a set of random variables X1, . . . , Xn and set of constantsa0, a1, . . . , an, we have

E[a0 + a1X1 + . . .+ anXn] = a0 + a1E[X1] + . . .+ anE[Xn]

Donglei Du (UNB) ADM 2623: Business Statistics 18 / 54

Page 17: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Example: an easier way to calculate the expectation forthe dice example via the rule of expectation

Let X be the sum of the two dice. Let Xi be the face value of the ithdie. Then X = X1 +X2.

Since X1 and X2 have the same distribution, we have E[X1] = E[X2].

X1 P (X1) X1P (X1)

1 1/6 1/62 1/6 2/63 1/6 3/64 1/6 4/65 1/6 5/66 1/6 6/6

7/2

Therefore, by the rule of expectation, we have

E[X] = E[X1] + E[X2] = 2(7/2) = 7.

Donglei Du (UNB) ADM 2623: Business Statistics 19 / 54

Page 18: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Variance of Random Variable

σ2 = V(X) =

∞∑i=1

(xi − µ)2p(xi), Conceptual Formula

∞∑i=1

x2i p(xi)−( ∞∑

i=1xip(xi)

)2

, Computational Formula

The variance of a random variable measures the amount of spread(variation) of a distribution

Donglei Du (UNB) ADM 2623: Business Statistics 20 / 54

Page 19: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Example

Toss three fair coins in each trial: Let X be the number of heads.Then V(X) = 3− 1.52 = 0.75 via the computational formula ascalculated below in the table.

X P (X) XP (X) X2P (X)

0 1/8 0 01 3/8 3/8 3/82 3/8 6/8 12/83 1/8 3/8 9/8

1.5 3

Donglei Du (UNB) ADM 2623: Business Statistics 21 / 54

Page 20: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Rule of Variance

Given a set of independent random variables X1, . . . , Xn and set ofconstants a0, a1, . . . , an, we have

V[a0 + a1X1 + . . .+ anXn] = a21V[X1] + . . .+ a2nV[Xn]

Donglei Du (UNB) ADM 2623: Business Statistics 22 / 54

Page 21: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Variance for the dice example

Let X be the sum of the two dice. Let Xi be the face value of the ithdie. Then X = X1 +X2.Since X1 and X2 have the same distribution, we have V[X1] = V[X2].

X1 P (X1) X1P (X1) X21P (X1)

1 1/6 1/6 1/62 1/6 2/6 4/63 1/6 3/6 9/64 1/6 4/6 16/65 1/6 5/6 25/66 1/6 6/6 36/6

7/2 15

So V[X1] = 15− 3.52 = 2.75 via the computational formula.Therefore, by the rule of vaiance due to the independence of X1 andX2, we have

V[X] = V[X1] + V[X2] = 2(2.75) = 5.5.

Donglei Du (UNB) ADM 2623: Business Statistics 23 / 54

Page 22: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Joint Probability of Two Random Variables

Given two discrete random variables X and Y , the joint probabilitymass function is defined as:

p(x, y) = P ({X = x, Y = y})

The marginal probability mass function for X and Y can be obtainedrespectively as

p(x) =∑y

p(x, y)

p(y) =∑x

p(x, y)

Donglei Du (UNB) ADM 2623: Business Statistics 25 / 54

Page 23: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

The dice example

Let Xi be the face value of the ith die. Then the joint probability ofX1 and X2, along with the two marginal probabilities, are

(X1, X2) 1 2 3 4 5 6 X1

1 1/36 1/36 1/36 1/36 1/36 1/36 1/62 1/36 1/36 1/36 1/36 1/36 1/36 1/63 1/36 1/36 1/36 1/36 1/36 1/36 1/64 1/36 1/36 1/36 1/36 1/36 1/36 1/65 1/36 1/36 1/36 1/36 1/36 1/36 1/66 1/36 1/36 1/36 1/36 1/36 1/36 1/6

X2 1/6 1/6 1/6 1/6 1/6 1/6

Donglei Du (UNB) ADM 2623: Business Statistics 26 / 54

Page 24: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Independent Random Variables

Two discrete random variables X and Y are independent if

p(x, y) = p(x)p(y)

If two random variables are independent then

E[XY ] = E[X]E[Y ]

Example: X1 and X2 are independent in the dice sum example.

Donglei Du (UNB) ADM 2623: Business Statistics 27 / 54

Page 25: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

A dependent example

Example: We are given the following joint probability of X1 and X2:

(X1, X2) -5 4 6 X1

-1 0.05 0.15 0.00 0.22 0.05 0.35 0.10 0.53 0.10 0.10 0.10 0.3

X2 0.2 0.6 0.2

Problem: Whether X1 and X2 are independent or not?

Solution: They are not independent because the joint probability isnot equal to the product of the two marginal probabilities:

P (X1 = −1, X2 = −5) = 0.05

6= P (X1 = −1) ∗ P (X2 = −5)= 0.2(0.2) = 0.04.

Donglei Du (UNB) ADM 2623: Business Statistics 28 / 54

Page 26: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Covariance of two Random Variables

Given two discrete random variables X and Y , the covariance of Xand Y is defined as

Cov(X,Y ) = E[(X − E[x]) (Y − E[Y ])] = E[XY ]− E[X]E[Y ].

Variance is a special case of the covariance when the two variables areidentical:

V[X] = Cov(X,X)

Covariance is a measure of how much two random variables changetogether.

A positive value of covariance indicates the Y tends to increase as Xdoes.A negative value of covariance indicates the Y tends to decrease as Xincreases.

Donglei Du (UNB) ADM 2623: Business Statistics 29 / 54

Page 27: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Uncorrelatedness vs independence

If X and Y are independent, then their covariance is zero.

The converse, however, is not generally true.

Two random variables are uncorrelated iff their covariance is zero.

Uncorrelatedness and independence are equivalent only when they arejointly normally distributed.

Donglei Du (UNB) ADM 2623: Business Statistics 30 / 54

Page 28: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Example

Example: We are given the following joint probability of X1 and X2:

(X1, X2) -5 4 6 X1

-1 0.05 0.15 0.00 0.22 0.05 0.35 0.10 0.53 0.10 0.10 0.10 0.3

X2 0.2 0.6 0.2

Problem: Calculate the covariance of X1 and X2?

Donglei Du (UNB) ADM 2623: Business Statistics 31 / 54

Page 29: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Example

Solution: First calculate the expectation of X1 and X2:

E[X1] = (−1)0.2 + (2)0.5 + (3)0.3 = 1.7

E[X2] = (−5)0.2 + (4)0.6 + (6)0.2 = 2.6

Then calculate the expectation of X1X2:

E[X1X2] = (−1)(−5)0.05 + (−1)(4)0.15 + (−1)(6)0.00+ (2)(−5)0.05 + (2)(4)0.35 + (2)(6)0.10

+ (3)(−5)0.10 + (3)(4)0.10 + (3)(6)0.10

= 4.65.

So the covariance of X1 and X2 is given as

Cov(X1, X2) = E[X1X2]− E[X1]E[X2] = 4.65− 1.7(2.6) = 0.23.

Donglei Du (UNB) ADM 2623: Business Statistics 32 / 54

Page 30: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

covariance for the dice example

Solution: First recall the expectation of X1 and X2:

E[X1] = E[X2] =7

2.

Then calculate the expectation of X1X2:

E[X1X2] =(1 + . . .+ 6)2

36=

(7

2

)2

So the covariance of X1 and X2 is given as

Cov(X1, X2) = E[X1X2]− E[X1]E[X2] =

(7

2

)2

−(7

2

)2

= 0.

Donglei Du (UNB) ADM 2623: Business Statistics 33 / 54

Page 31: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Some common discrete random variables

Bernoulli Random Variable

Binomial Random Variable

Donglei Du (UNB) ADM 2623: Business Statistics 35 / 54

Page 32: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Bernoulli Random Variable

Bernoulli Random Experiment: A Bernoulli experiment only hastwo possible outcomes, ’success’ and ’failure’, and the probabilities of’success’ and ’failure’ are p, and 1− p, respectively. Or equivalentlythe size of the sample space for any Bernoulli experiment is twoBernoulli Random Variable: A Bernoulli random variable Xassociated with a particular Bernoulli experiment with successprobability p, and failure probability of 1− p is defined as follows:

X P (X)

1 p0 1-p

The probability mass function f of this distribution is

f(k; p) =

p if k = 1,

1− p if k = 0.

Or equivalently

f(k; p) = pk(1− p)1−k for k ∈ {0, 1}.Donglei Du (UNB) ADM 2623: Business Statistics 36 / 54

Page 33: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Probability mass function

The probability mass function f of this distribution is

f(k; p) =

p if k = 1,

1− p if k = 0.

Or equivalently

f(k; p) = pk(1− p)1−k for k ∈ {0, 1}.

Donglei Du (UNB) ADM 2623: Business Statistics 37 / 54

Page 34: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Expectation and variance of Bernoulli random variable

X P (X) XP (X) X2P (X)

1 p p p0 1-p 0 0

p p

The expected value of a Bernoulli random variable X

E (X) = p

The variance a Bernoulli random variable X is

Var (X) = p (1− p) .

Donglei Du (UNB) ADM 2623: Business Statistics 38 / 54

Page 35: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Example

Example: Tossing a fair coin: is a Bernoulli experiment if weassociate head with “success”, and tail with “failure”, each of thecorresponding probabilities is 0.5.

Let X be the number of heads you get . Then X is a Bernoullirandom variable:

X P(X)

1 0.50 0.5

Example: Randomly select an email from your account: is aBernoulli experiment if we associate spam with “success” withprobability 0.6, and non-spam with “failure” with probability 0.4.

Let X be the number of spams you get . Then X is a Bernoullirandom variable:

X P(X)

1 0.60 0.4

Donglei Du (UNB) ADM 2623: Business Statistics 39 / 54

Page 36: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Binomial Random Variable

A Binomial experiment is a sequence of n independent and identicalBernoulli experiments.

A Binomial random variable X associated with a particular Binomialexperiment is defined to be the total number of successes whoseprobability mass function is:

f(k;n, p) = Pr(X = k) =

(n

k

)pk(1− p)n−k, for k = 0, 1, 2, ..., n.

We use X ∼ B(n, p) to represent a Binomial random variable.

Donglei Du (UNB) ADM 2623: Business Statistics 40 / 54

Page 37: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Binomial Random Variable: plot

n <- 20

p <- 0.6

x <- dbinom(0:n,size=n,prob=p)

barplot(x,names.arg=0:n)

0 1 2 3 4 5 6 7 8 9 11 13 15 17 19

0.00

0.05

0.10

0.15

Donglei Du (UNB) ADM 2623: Business Statistics 41 / 54

Page 38: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Binomial Random Variable

The binomial distribution is frequently used to model the number ofsuccesses in a sample of size n drawn with replacement from apopulation of size N

If the sampling is carried out without replacement, the draws are notindependent and so the resulting distribution is a hypergeometricdistribution, not a binomial one.

However, for N much larger than n, the binomial distribution is agood approximation, and widely used.

Donglei Du (UNB) ADM 2623: Business Statistics 42 / 54

Page 39: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Example I

Example: Tossing three fair coins in each trial: if we associate headwith “success”, and tail with “failure”, each of the correspondingprobabilities is 0.5.

Let X be the number of heads you get. Then X is a Binominalrandom variable:

X P(X)

0 1/81 3/82 3/83 1/8

You can check whether our previous formula is correct or not? Forexample

f(1; 3, 0.5) =

(3

1

)0.51(1− 0.5)3−1 =

3

8= 0.375.

Donglei Du (UNB) ADM 2623: Business Statistics 43 / 54

Page 40: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Example II

R code

dbinom(1,3,0.5)

## [1] 0.375

Donglei Du (UNB) ADM 2623: Business Statistics 44 / 54

Page 41: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Relationship Between Bernoulli Random Variables andBinomial Variable

A Binomial random variable X can be written as the sum of nBernoulli random variables, X1, . . . , Xn, i.e.,

X = X1 + . . .+Xn.

Donglei Du (UNB) ADM 2623: Business Statistics 45 / 54

Page 42: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Expectation and variance of Binomial random variable

The expected value of a Binomial random variable X

E (X) = np

The variance a Binomial random variable X is

Var (X) = np (1− p) .

Donglei Du (UNB) ADM 2623: Business Statistics 46 / 54

Page 43: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Calculate the probabilities of an Binomial random variablefrom the Binomial Table832 Appendix A

APPENDIX AJ

Binowtial Pr ob ability Distribution (continued)

n = 1 0Probabilin

0.05 0.10 0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 0.9s

012

4

5678v

10

0.599 0.349 0.7070.315 0.387 0.2680.075 0.794 0.3020.010 0.057 0.201.0.001 0.011 0.088

0.000 0.001 0.0260.000 0.000 0.0060.000 0.000 0.0010.000 0.000 0.0000.000 0.000 0.000

0.000 0.000 0.000

0.10

0.028 0.0060.1.27 0.0400.233 0.t210.267 0.21.50.200 0.2s7

0.103 0.2070.037 0 .1110.009 0.0420.001 0.0110.00.0 0.002

0.000 0.000

0.000 0.0000.002 0.0000.011 0.0010.042 0.0090.111 0 .037

0.201 0.1030.251 0.2000.21.5 0.2670.727 0.2330.040 0.727

0.006 0.028

0.60

0.0000.0000.0000.0010.006

0.0260.0880.2070.3020.268

0.107

0.000 0.0000.000 0.0000.001 0.0000.004 0.0000.017 0.002

0.057 0.0100.732 0.0390.220 0 .1110.257 0.2270.200 0.295

0.093 0.2360.020 0.086

0.000 0.0000.000 0.0000.000 0.0000.001 0.0000.008 0.001

0.029 0.0030.079 0.0160.158 0.0530.237 0.1330.240 0.236

0.168 0.2830.071 0.2060.014 0.069

0.000 0.0000.000 0.0000.000 0.0000.000 0.0000.000 0.000

0.001 0.0000.011 0.0010.057 0.0100.1.94 0.0750.387 0.315

0.349 0.599

0.000 0.0000.000 0.0000.000 0.0000.000 0.0000.000 0.000

0.000 0.0000.002 0.0000.016 0.0010.071 0.0140.273 0.087

0.384 0.3290.374 0.569

0.000 0.0000.000 0.0000.000 0.0000.000 0.0000.000 0.000

0.000 0.0000.000 0.0000.004 0.0000.021 0.0020.085 0.017

0.230 0.0990.377 0.341"0.282 0.540

0.0010.0100.0440.1,1,70.205

0.2460.2050.7770.0440.010

0.001

n = L 7 ,Probability

0.569 0.314 0.0860.329 0.384 0.2360.087 0.273 0.2950.074 0.071 0.2270.001 0 .016 0 .111

0.000 0.002 0.0390.000 0.000 0.0100.000 0.000 0.0020.000 0.000 0.0000.000 0.000 0.000

0.000 0.000 0.0000.000 0.000 0.000

0.0s 0.10

0.20 0.30

0.069 0.0740.206 0.0710.283 0 .1680.236 0.2400.133 0.231.

0.053 0.1580.016 0.0790.003 0.0290.001 0.0080.000 0.001

0.000 0.0000.000 0.0000.000 0.000

0.020 0.0040.093 0.0270.200 0.0890.257 0.1.770.220 0.236

0.132 0.221.0.057 0.7470.077 0.0700.004 0.0230.001 0.005

0.000 0.0010.000 0.000

0.000 0.0000.005 0.0010.0?7 0.0050.08x 0.0230.161 0.070

0.226 0.7470.226 0.2270.161 0.2360.081 0.7770.027 0.089

0.005 0.0270.000 0.004

0.0000.0000.0020.0120.042

0.1010.7770.2270.21,30.742

0.0640.0170.002

0.70 0.80 0.90 0.9s

01,z5

4

56789

0I

25

4

56-f

89

10t 1

1071.1.2

n = L 2Probabiliqt

0.20 0.30 0.40 0.s0 0.60 0.70 0.80 0.90 0.95

0.540 0.2820.347 0.3770.099 0.2300.017 0.0850.002 0.021,

0.000 0.0040.000 0.0000.000 0.0000.000 0.0000.000 0.000

0.000 0.0000.000 0.0000.000 0.000

0.002 0.0000.017 0.0030.064 0.0160.1.42 0.0540.213 0.721

0.227 0 .1930.777 0 .2260.101 0.1930.042 0.1,210.01.2 0.054

0.002 0.0160.000 0.0030.000 0.000

Donglei Du (UNB) ADM 2623: Business Statistics 47 / 54

Page 44: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Example I

Example: It is estimated that 40 percent of investors invested inhigh-tech stocks, let us choose 10 investors.

Problem: The probability that 4 of them have invested in high-techstocks?

Solution: Let X be the number of investors invested in high-techstocks in these randomly chosen 10 investors. Then X ∼ B(10, 0.4).So from the Binomial Table, we have

P (X = 4) = 0.251

Problem: The probability that no more than 7 of them have investedin high-tech stocks?

Donglei Du (UNB) ADM 2623: Business Statistics 48 / 54

Page 45: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Example II

Solution: From the Binomial Table, we have

P (X ≤ 7) = P (X = 0) + . . .+ P (X = 7)

= 0.006 + 0.04 + 0.121 + 0.215 + 0.251

+0.201 + 0.111 + 0.042 = 0.987

R code

pbinom(7,10,0.4)

## [1] 0.9877054

Donglei Du (UNB) ADM 2623: Business Statistics 49 / 54

Page 46: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Example I

Solution: For the last question, we can also use the complement tosimplify the calculation:

P (X ≤ 7) = 1− P (X ≥ 8)

= 1− P (X = 8)− P (X = 9)− P (X = 10)

= 1− 0.011− 0.002− 0.000 = 0.987

R code

1-pbinom(7,10,0.4,lower.tail=FALSE)

## [1] 0.9877054

Problem: How many of the selected investors could we expect tohave invested in high-tech stocks?

Solution:E[X] = np = 10(0.4) = 4.

Donglei Du (UNB) ADM 2623: Business Statistics 50 / 54

Page 47: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Example II

Problem: What is the variance of the investors who would haveinvested in high-tech stocks?

Solution:

V[X] = np(1− p) = 10(0.4)(1− 0.4) = 2.4.

Donglei Du (UNB) ADM 2623: Business Statistics 51 / 54

Page 48: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Calculate the probabilities of an Binomial random variablefrom the Binomial Table

834 Appendix A

,A.PPENDIX ABinomial Pr ob ability Distribution (continued)

n = 1 5ProbabiliE

0.05 0 .10 0.30 0.40 0.50 0.70 0.80 0.90 0.9s0T234

56789

1.01 1L 2I J

L +

1 5

0.463 0.2060.366 0.3430 .135 0 .2670.031 0.1,290.005 0.043

0.001 0.0100.000 0.0020.000 0.0000.000 0.0000.000 0.000

0.000 0.0000.000 0.0000.000 0.0000.000 0.0000.000 0.000

0.000 0.000

0.035 0.0050.1,32 0.0310.231, 0.0920.250 0.1700.188 0.219

0.103 0.2060.043 0.1470.014 0.0810.003 0.0350.001 0.01,2

0.000 0.0030.000 0.0010.000 0.0000.000 0.0000.000 0.000

0.000 0.000

0.012 0.0010.058 0.0070.L31 0.0280.205 0.0720.21.8 0.130

0.775 0.1790.109 0.7920.055 0.1640.022 0.1140.007 0.065

0.002 0.0310.000 0.0720.000 0.0040.000 0.001.0.000 0.000

0.000 0.0000.000 0.0000.000 0.0000.000 0.0000.000 0.000

0.000 0.000

0.000 0.0000.005 0.0000.022 0.0030.063 0.0140 .L27 0 .042

0.186 0.0920.207 0.1530 .177 0 .1960 .118 0 .1960 .061 0 .153

0.024 0.0920.007 0.0420.002 0.0140.000 0.0030.000 0.000

0.000 0.000

0.0000.0000.0000.0020.007

0.0240.0610.1180 .7770.207

0 .1860.1,270.0630.0220.005

0.000

0.000 0.0000.000 0.0000.000 0.0000.001 0.0000.005 0.000

0.0L5 0.0010.037 0.0050.074 0.0150.120 0.0350.160 0.071

0.17 6 0,11,70 .160 0 ,1600.1,20 0.1800.074 0.7660.037 0.1,24

0.015 0.0750.005 0.0350.001 0.0L20.000 0.0030.000 0.000

0.000 0.000

0.000 0.0000.000 0.0000.000 0.0000.000 0.0000.001 0.000

0.003 0.0000.01,2 0.0010.035 0.0030.081 0.01.40.747 0,043

0.206 0.1030.279 0.1880.170 0.2500.092 0.23L0.031 0.L32

0.005 0.035

0.000 0.0000.000 0.0000.000 0.0000.000 0.0000.000 0.0000.000 0.0000.000 0.0000.000 0.0000.000 0.0000.002 0.000

0.010 0.0010.043 0.0050.729 0.0310.267 0.1350.343 0.366

0.206 0.463

n = 2 0h'obability

0.05 0.10 0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 0.95

01234

56789

101 17 21314

1 5l o

1,71 81,9

2 0

0.358 0.1220.371 0.2700.189 0.2850.060 0.1900.013 0.090

0.002 0.0320.000 0.0090.000 0.0020.000 0.0000.000 0.000

0.000 0.0000.000 0.0000.000 0.0000.000 0.0000.000 0.000

0.000 0.0000.000 0.0000.000 0.0000.000 0.0000.000 0.000

0.000 0.000

0.0000.0000.0030.01.20.035

0.0750 .1240 .1660.1800 .160

0.1,770.0710.03 50 .0150.005

0.0010.0000.0000.0000.000

0.000

0.000 0.0000.000 0.0000.000 0.0000.000 0.0000.000 0.000

0.000 0.0000.000 0.0000.001 0.0000.004 0.0000.072 0.000

0.031 0.0020.065 0.0070.774 0.0220.1,64 0.0550.192 0.109

0.779 0.1750.130 0.21.80.072 0.2050.028 0.L370.007 0.058

0.001 0.012

0.000 0.0000.000 0.0000.000 0.0000.000 0.0000.000 0.000

0.000 0.0000.000 0.0000.000 0.0000.000 0.0000.000 0.000

0.000 0.0000.000 0.0000.000 0.0000.002 0.0000.009 0.000

0.032 0.0020.090 0.0130.190 0.0600.285 0.1890 .210 0 .377

0.722 0.358

Donglei Du (UNB) ADM 2623: Business Statistics 52 / 54

Page 49: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Example I

Example: Leakage from underground petrol tanks at service stationscan damage the environment. It is estimated that 25% of these tanksleak. 15 tanks are chosen at random, independently of each other,and examined.

Problem: What is the probability that fewer than three leaks?

Solution: Let X be the number of leaked tanks in these randomlychosen 15 investors. Then X ∼ B(15, 0.25). So from the BinomialTable, we have

P (X < 3) = P (X ≤ 2) = P (X = 0) + P (X = 1) + P (X = 2)

=0.035 + 0.005

2+

0.132 + 0.031

2+

0.231 + 0.092

2= 0.3445

Donglei Du (UNB) ADM 2623: Business Statistics 53 / 54

Page 50: Lecture 6: Random Variable - UNBddu/2623/Lecture_notes/Lecture6_student.pdf · 2018. 10. 16. · For any discrete random variable, we de ne its probability distribution as the listing

Example II

R code

pbinom(2,15,0.25)

## [1] 0.2360878

Donglei Du (UNB) ADM 2623: Business Statistics 54 / 54