28
Binomial random variables

Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

Embed Size (px)

Citation preview

Page 1: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

Binomial random variables

Page 2: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

Coin Toss Example

If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance of X.

There are different ways to solve this problem.From the three tosses, we have a total of 8

outcomes.{HHH, HHT, HTH, THH, HTT, THT, TTH, TTT}Each of the above 8 outcomes has a

probability of 1/8.

Page 3: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

Coin Toss Example

One way of finding the mean is to count the number of heads in each outcome and take the average. {3, 2, 2, 2, 1, 1, 1, 0}The mean is therefore 12/8=1.5Then we can find the variance of the 8 numbers,

which is: [(3-1.5)^2+3*(2-1.5)^2+3*(1-1.5)^2+(0-1.5)^2]/

8=0.75

Page 4: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

Coin Toss Example

Another way is to find the pmf.

E(X)=0*(1/8)+1*(3/8)+2*(3/8)+3*(1/8)=1.5 Var(X)=(0-1.5)^2*(1/8)+(1-1.5)^2*(3/8)+(2-

1.5)^2*(3/8)+(3-1.5)^2*(1/8)=0.75

X 0 1 2 3

P(X) 1/8 3/8 3/8 1/8

Page 5: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

Coin Toss Example

Yet another way. Here, we want to introduce some new concepts,

Bernoulli and Binomial trials, which are repetitions of exactly the same experiments with two possible outcomes.

In this case, we repeat the experiment of tossing a fair coin 3 times, each time with 50% chance of getting head and 50% chance of getting tail.

Page 6: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

Bernoulli and Binomial Trials

Bernoulli Trials:An experiment who has only two outcomes,

and. E.g., tossing a fair coin (head 50%, tail 50%); tossing a biased coin (head 70%, tail 30%); rolling a fair die and getting a 3 or more (yes 4/6, no 2/6)

Page 7: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

Bernoulli and Binomial Trials

Binomial Trials:Repeating Bernoulli trials for a number of

times, each repetition has the same possible outcomes

The probability of each outcome is consistent for all trials.

Page 8: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

Coin Toss Example

That is a Binomial experiment, or we say the (discrete) random variable X follows a Binomial distribution.

For Binomial distribution, the outcomes can be summarized with a pdf that does not have to look like a table, but like a function instead.

Use our knowledge:

Page 9: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

Binomial Experiment

An experiment is said to be a binomial experiment ifThe experiment consists of a sequence of n

identical trialsTwo outcomes (success/failure) are possible on

each trial.The probability of a success, p, does not change

from trial to trial.The trials are independent.

Page 10: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

Binomial random variable

Binomial random variable is a random variable that describes the outcomes of a binomial experiment.

Example: 1. Tossing a fair coin 100 times. 2. Tossing a biased coin 100 times. 3. Rolling a fair die 100 times and record the

numbers. 4. Rolling a fair die 100 times and record whether the

outcome is even or odd. 5. Rolling a snow ball on a ground covered with snow

and record whether it could pass a given distance.

Page 11: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

Binomial random variable

If a random variable describes the outcome of a binomial experiment, we can also say, this random variable follows a binomial distribution, or this random variable is binomially distributed.

Page 12: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

A few words on probability distribution A probability distribution is an approximation to real

life phenomenon. It usually provides a functional relationship

between the possible values in the sample space and their probabilities.

A probability distribution is always characterized by parameters.

Therefore, knowing a probability distribution means knowing its functional form and its parameters.

Page 13: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

Back to binomial distribution

The functional form:

The parameters: n and p.

Page 14: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

Coin Toss Example

There are easier ways to find the expected value and variance of a Binomial random variable.

If X~BIN(n,p)E(X)=npVar(X)=np(1-p) In this case, n=3, p=0.5, so E(X)=np=3*0.5=1.5

and Var(X)=3*0.5*0.5=0.75

Page 15: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

More questions on coin tossing

What is the probability that we see at least 2 heads?

That means the probability of seeing either 2 heads or 3 heads.

P(X=2)+P(X=3)

Page 16: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

Another example

A player is shooting at a target 200 meters away. There is 80% chance that he can hit the target each time. He took 15 shots within 10 minutes.

A. How many times do you expect him to hit the target? Also, find the standard deviation of the number of times he hits the target.

Page 17: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

Shooting example

B. What is the chance that he missed three times?

C. What is the chance that he missed more than 5 times?

Page 18: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

Shooting example

If the player pays $25 to play the game gets a reward of $10 for each hit, what is the expected amount of money he gets for playing the game?

Page 19: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

A more difficult example

Two players, A and B are playing a game. A will roll a fair die and he wins if the number is greater than 4. They repeat the game 10 times.

A. Let X be the number of games won by B, find E(X) and Var(X).

Page 20: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

Card Game example

B. What is the probability that B won at least 4 games?

What is the probability that A won more than 7 games?

Page 21: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

Card Game Example

If A pays B $3 if B wins and B pays A $4 if A wins, is this a fair game? (a fair game means the expected payout from the game should be zero).

Page 22: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

More on E(X) and Var(X)

We mentioned before that the expected values have the following property:E(X+c)=E(X)+cE(aX)=aE(X)E(aX+c)=aE(X)+cE(aX+bY)=aE(X)+bE(Y)

Page 23: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

More on E(X) and Var(X)

Also, variances have similar properties: Var(X+b)=Var(X) Var(aX)=(a^2)Var(X) Var(X+Y)=Var(X)+Var(Y)+2Cov(X,Y). If X and Y are

independent, Var(X+Y)=Var(X)+Var(Y). Var(aX+bY)=(a^2)Var(X)+(b^2)Var(Y)+2abCov(X,Y). If X and Y are independent, Var(aX+bY)=(a^2)Var(X)

+(b^2)Var(Y).

Page 24: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

More on E(X) and Var(X)

*** The above properties are only for linear transformations.

If we have, for example, y=2*sqrt(X), the above properties can not be used.

Page 25: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

An example on E(X) and Var(X)

A biologist is conducting a research on the temperature needed for chickens to be hatched. His lab results are summarized as the following,

Temperature (C)

42 45 48 51 54

P(Hatching) 10% 15% 25% 35% 15%

Page 26: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

An example on E(X) and Var(X)

What is the mean and variance for the temperature of hataching?

Page 27: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

An example on E(X) and Var(X)

The researcher’s lab assistant just found out that the thermometer was malfunctioning when the measures were taken. All the temperatures on record are 5 degrees lower than they should be. Shall the researcher re-do the experiment or do something else to make it up?

Page 28: Binomial random variables. Coin Toss Example If you toss a fair coin three time and let X= the number of heads observed. Find the expected value and variance

An example on E(X) and Var(X)

The researcher wants to submit his results to apply for some grants. But the grant committee requires that the temperature should be recorded in terms of Fahrenheit instead of Celsius. What should the researcher do to update his data and results.