## A multinomial example

The multinomial theorem is a useful way to count. The counting problems discussed here are generalization to counting problems that are solved by using binomial techniques (see this previous post for an example).

The best way to start is the example discussed in the previous post:

Seven dice are rolled. Find the probability that at least 4 of the dice show the same face.

The solution in the previous post uses the binomial distribution. Binomial solution is possible because in rolling 7 dice, one and only one face can appear 4 or more times. So in this example, there are just two categories to keep track of in rolling a die – is it the value x or a value other than x. Use the binomial distribution to count these possibilities. Then multiply by 6 to get the answer.

If we roll 8 dice instead of 7 dice, this method cannot be used. There can be more than two categories to keep track of. For example, in rolling 8 dice, it is possible that two faces can show up 4 times (e.g. face 1 showing up 4 times and face 2 showing up 4 times). So this is a multinomial counting problem instead of a binomial counting problem. We demonstrate how multinomial theorem is used to do the counting.

Before we do so, we observe that the more dice are rolled, the higher the probability of having at least 4 of the dice showing the same face. As an extreme example, if we roll 100 dice, it is certain that at least 4 of the dice will show the same face. In fact, in rolling 100 dice there is a 100% chance that at least 34 of the dice show the same face.

Working Toward a Multinomial Solution

Here’s the problem. Eight fair dice are rolled. Find the probability that at least 4 of the dice show the same face.

Let’s focus on one specific outcome in rolling 8 dice.

(4, 2, 2, 0, 0, 0)

The above outcome means that 4 dice show the value of 1, 2 dice show the value of 2 and 2 dice shows the value of 3. The number of ways this can happen is a multinomial coefficient.

(1)……$\displaystyle \frac{8!}{4! \ 2! \ 2!}=420$

The outcome (4, 2, 2, 0, 0, 0) is one example of 4 dice showing 1 value, 2 dice showing another value and 2 dice showing another value. The above multinomial coefficient says that there are 420 ways the outcome (4, 2, 2, 0, 0, 0) can happen when 8 dice are rolled. In fact, the outcome (0, 0, 0, 2, 2, 4) – 4 dice shows the value of 6, 2 dice show the value of 5 and 2 dice shows the value of 4 – also associates with 420, that there are 420 ways this outcome can happen.

The two outcomes (4, 2, 2, 0, 0, 0) and (0, 0, 0, 2, 2, 4) share something in common. That is, 1 of the value of the die appearing one time, 2 values of the die appearing two times, and the remaining 3 values of the die not appearing at all. How many ways can the 6 values of the die permute in this way? The answer is another multinomial coefficient.

(2)……$\displaystyle \frac{6!}{1! \ 1! \ 3!}=60$

Multiplying the two multinomial coefficients together gives the number of ways, in rolling 8 dice, the result “4 dice shows one value, 2 dice show another value and 2 dice shows another value” can happen.

(3)……$\displaystyle \frac{8!}{4! \ 2! \ 2!} \times \frac{6!}{1! \ 1! \ 3!}=420 \times 60=25200$

Let’s summarize what we have done so far. We start with the outcome (4, 2, 2, 0, 0, 0), which is short hand for 4 of the dice showing the value of 1, 2 of the dice showing the value of 2 and 2 of the dice showing the value of 3. The number of ways this can happen is 420, which is the multinomial coefficient calculated in (1). The multinomial coefficient calculated in (2) is the number of the 6 positions (6 values of the die) can permute according to the criterion: 1 of the values appearing one time, two of the values appearing two times each and three of the values do not appear at all. The product of (1) and (2) is the number of ways 4 dice show one value, 2 dice show another value and 2 dice show another value when rolling 8 dice.

The multinomial counting process discussed here is a double application of multinomial coefficients, with the first one on the rolls of the dice and the second on on the 6 values of the die.

A Multinomial Solution

The key in solving the full problem is to list out all the different outcomes in addition to (4, 2, 2, 0, 0, 0). The following is the listing of all the possibilities.

Outcome
A (4, 3, 1, 0, 0, 0)
B (4, 2, 2, 0, 0, 0)
C (4, 2, 1, 1, 0, 0)
D (4, 1, 1, 1, 1, 0)
E (5, 3, 0, 0, 0, 0)
F (5, 2, 1, 0, 0, 0)
G (5, 1, 1, 1, 0, 0)
H (6, 2, 0, 0, 0, 0)
I (6, 1, 1, 0, 0, 0)
J (7, 1, 0, 0, 0, 0)
K (8, 0, 0, 0, 0, 0)
L (4, 4, 0, 0, 0, 0)

The table shows 12 possible outcomes. Note that the outcome (4, 2, 2, 0, 0, 0) discussed in the preceding section is outcome B in the table. The first 11 items in the table are outcomes that have only one face showing 4 or more times. The last item is the outcome that has two faces showing 4 times each. As shown in the preceding section, we calculate two multinomal coefficients and multiply them together. The first multinomial coefficient, as demonstrated in (1), is the number of ways the particular outcome can happen. The second multinomial coefficient, as demonstrated in (2), is the number of ways the 6 values of the die can permute similar to that specific outcome. The following table gives the calculated results.

Outcome Count
A (4, 3, 1, 0, 0, 0) 33600
B (4, 2, 2, 0, 0, 0) 25200
C (4, 2, 1, 1, 0, 0) 151200
D (4, 1, 1, 1, 1, 0) 50400
E (5, 3, 0, 0, 0, 0) 1680
F (5, 2, 1, 0, 0, 0) 20160
G (5, 1, 1, 1, 0, 0) 20160
H (6, 2, 0, 0, 0, 0) 840
I (6, 1, 1, 0, 0, 0) 3360
J (7, 1, 0, 0, 0, 0) 240
K (8, 0, 0, 0, 0, 0) 6
L (4, 4, 0, 0, 0, 0) 1050
Total 307896

In rolling 8 dice, how many possible outcomes are there? The answer is $6^8=1679616$. This is due to the fact that each roll of a die has 6 outcomes. According to the multiplication principal, rolling 8 dice would have in total $6^8$ outcomes. Out of 1,679,616 outcomes, 307,896 of them are such that at least 4 of the dice show the same face. Thus in rolling 8 fair dice, the probability that at least 4 of the dice show the same face is:

$\displaystyle \frac{307896}{1679616}=\frac{12829}{69984}=0.1833$

When rolling a 8 fair dice, there is roughly an 18.33% chance that at least 4 of the dice showing the same face.

Practice Problem

To reinforce the concept of using a double application of multinomial coefficients, it is a good idea to work a practice problem. Naturally, we can just up the dice count by one. Here’s the problem: Nine fair dice are rolled. Find the probability that at least 4 of the dice show the same face.

.

.

.

.

.

.

.

.

.

.

.

.

The desired probability is:

$\displaystyle \frac{2136336}{6^9}=\frac{2136336}{10077696}=\frac{44507}{209952}=0.212$

The answer is based on a total of 16 outcomes.

Outcome
A (4, 3, 2, 0, 0, 0)
B (4, 2, 2, 1, 0, 0)
C (4, 2, 1, 1, 1, 0)
D (4, 1, 1, 1, 1, 1)
E (5, 3, 1, 0, 0, 0)
F (5, 2, 2, 0, 0, 0)
G (5, 1, 1, 1, 1, 0)
H (6, 3, 0, 0, 0, 0)
I (6, 2, 1, 0, 0, 0)
J (6, 1, 1, 1, 0, 0)
K (7, 2, 0, 0, 0, 0)
L (7, 1, 1, 0, 0, 0)
M (8, 1, 0, 0, 0, 0)
N (9, 0, 0, 0, 0, 0)
O (5, 4, 0, 0, 0, 0)
P (4, 4, 1, 0, 0, 0)

Dan Ma statistical

Daniel Ma statistical

Dan Ma practice problems

Daniel Ma practice problems

Daniel Ma mathematics

Dan Ma math

Daniel Ma probability

Dan Ma probability

Daniel Ma statistics

Dan Ma statistics

Dan Ma mathematical

Daniel Ma mathematical

$\copyright$ 2019 – Dan Ma

## Practice Problem Set 7 – a discrete joint distribution

The practice problems presented here deal with a discrete joint distribution that is defined by multiplying a marginal distribution and a conditional distribution – similar to the joint distribution found here and here. Thus this post provides additional practice opportunities.

Practice Problems

Let $X$ be the value of a roll of a fair die. For $X=x$, suppose that $Y \lvert X=x$ has a binomial distribution with $n=4$ and $p=x / 10$.

Practice Problem 7-A
Compute the conditional binomial distributions $Y \lvert X=x$ where $x=1,2,3,4,5,6$.

Practice Problem 7-B
Calculate the joint probability function $P[X=x,Y=y]$ for $x=1,2,3,4,5,6$ and $y=0,1,2,3,4$.

Practice Problem 7-C
Determine the probability function for the marginal distribution of $Y$. Calculate the mean and variance of $Y$.

Practice Problem 7-D
Calculate the backward conditional probabilities $P[X=x \lvert Y=y]$ for all applicable $x$ and $y$.

Problems 7-A to 7-D are similar to the ones in this previous post.

Practice Problem 7-E
Calculate the mean and variance of $X$.

Practice Problem 7-F
Calculate the mean and variance of $Y$ (use the methods discussed here).

Practice Problem 7-G
Calculate the covariance $\text{Cov}(X,Y)$ and the correlation coefficient $\rho$.

Problems 7-E to 7-G are similar to the ones in this previous post.

.

.

.

.

.

.

.

.

Practice Problem 7-A

\displaystyle \begin{aligned} &P[Y=0 \lvert X=1]=0.6561 \\&P[Y=1 \lvert X=1]=0.2916 \\&P[Y=2 \lvert X=1]=0.0486 \\&P[Y=3 \lvert X=1]=0.0036 \\&P[Y=4 \lvert X=1]=0.0001 \end{aligned}

\displaystyle \begin{aligned} &P[Y=0 \lvert X=2]=0.4096 \\&P[Y=1 \lvert X=2]=0.4096 \\&P[Y=2 \lvert X=2]=0.1536 \\&P[Y=3 \lvert X=2]=0.0256 \\&P[Y=4 \lvert X=2]=0.0016 \end{aligned}

\displaystyle \begin{aligned} &P[Y=0 \lvert X=3]=0.2401 \\&P[Y=1 \lvert X=3]=0.4116 \\&P[Y=2 \lvert X=3]=0.2646 \\&P[Y=3 \lvert X=3]=0.0756 \\&P[Y=4 \lvert X=3]=0.0081 \end{aligned}

\displaystyle \begin{aligned} &P[Y=0 \lvert X=4]=0.1296 \\&P[Y=1 \lvert X=4]=0.3456 \\&P[Y=2 \lvert X=4]=0.3456 \\&P[Y=3 \lvert X=4]=0.1536 \\&P[Y=4 \lvert X=4]=0.0256 \end{aligned}

\displaystyle \begin{aligned} &P[Y=0 \lvert X=5]=0.0625 \\&P[Y=1 \lvert X=5]=0.25 \\&P[Y=2 \lvert X=5]=0.375 \\&P[Y=3 \lvert X=5]=0.25 \\&P[Y=4 \lvert X=5]=0.0625 \end{aligned}

\displaystyle \begin{aligned} &P[Y=0 \lvert X=6]=0.0256 \\&P[Y=1 \lvert X=6]=0.1536 \\&P[Y=2 \lvert X=6]=0.3456 \\&P[Y=3 \lvert X=6]=0.3456 \\&P[Y=4 \lvert X=6]=0.1296 \end{aligned}

Practice Problem 7-B

\displaystyle \begin{aligned} &P[Y=4,X=1]=\frac{0.0001}{6} \\&P[Y=4,X=2]=\frac{0.0016}{6} \\&P[Y=4,X=3]=\frac{0.0081}{6} \\&P[Y=4,X=4]=\frac{0.0256}{6} \\&P[Y=4,X=5]=\frac{0.0625}{6} \\&P[Y=4,X=6]=\frac{0.1296}{6} \end{aligned}

\displaystyle \begin{aligned} &P[Y=3,X=1]=\frac{0.0036}{6} \\&P[Y=3,X=2]=\frac{0.0256}{6} \\&P[Y=3,X=3]=\frac{0.0756}{6} \\&P[Y=3,X=4]=\frac{0.1536}{6} \\&P[Y=3,X=5]=\frac{0.25}{6} \\&P[Y=3,X=6]=\frac{0.3456}{6} \end{aligned}

\displaystyle \begin{aligned} &P[Y=2,X=1]=\frac{0.0486}{6} \\&P[Y=2,X=2]=\frac{0.1536}{6} \\&P[Y=2,X=3]=\frac{0.2646}{6} \\&P[Y=2,X=4]=\frac{0.3456}{6} \\&P[Y=2,X=5]=\frac{0.375}{6} \\&P[Y=2,X=6]=\frac{0.3456}{6} \end{aligned}

\displaystyle \begin{aligned} &P[Y=1,X=1]=\frac{0.2916}{6} \\&P[Y=1,X=2]=\frac{0.4096}{6} \\&P[Y=1,X=3]=\frac{0.4116}{6} \\&P[Y=1,X=4]=\frac{0.3456}{6} \\&P[Y=1,X=5]=\frac{0.25}{6} \\&P[Y=1,X=6]=\frac{0.1536}{6} \end{aligned}

\displaystyle \begin{aligned} &P[Y=0,X=1]=\frac{0.6561}{6} \\&P[Y=0,X=2]=\frac{0.4096}{6} \\&P[Y=0,X=3]=\frac{0.2401}{6} \\&P[Y=0,X=4]=\frac{0.1296}{6} \\&P[Y=0,X=5]=\frac{0.0625}{6} \\&P[Y=0,X=6]=\frac{0.0256}{6} \end{aligned}

Practice Problem 7-C

\displaystyle \begin{aligned} &P[Y=4]=\frac{0.2275}{6} \\&P[Y=3]=\frac{0.854}{6} \\&P[Y=2]=\frac{1.533}{6} \\&P[Y=1]=\frac{1.862}{6} \\&P[Y=0]=\frac{1.5235}{6} \end{aligned}

$\displaystyle E[Y]=1.4$

$\displaystyle E[Y^2]=3.22$

$\displaystyle Var[Y]=1.26$

Practice Problem 7-D

\displaystyle \begin{aligned} &P[X=1 \lvert Y=0]=\frac{0.6561}{1.5235}=0.4307 \\&P[X=2 \lvert Y=0]=\frac{0.4096}{1.5235}=0.2689 \\&P[X=3 \lvert Y=0]=\frac{0.2401}{1.5235}=0.1576 \\&P[X=4 \lvert Y=0]=\frac{0.1296}{1.5235}=0.0851 \\&P[X=5 \lvert Y=0]=\frac{0.0625}{1.5235}=0.0410 \\&P[X=6 \lvert Y=0]=\frac{0.0256}{1.5235}=0.0168 \end{aligned}

\displaystyle \begin{aligned} &P[X=1 \lvert Y=1]=\frac{0.2916}{1.862}=0.1566 \\&P[X=2 \lvert Y=1]=\frac{0.4096}{1.862}=0.2200 \\&P[X=3 \lvert Y=1]=\frac{0.4116}{1.862}=0.2211 \\&P[X=4 \lvert Y=1]=\frac{0.3456}{1.862}=0.1856 \\&P[X=5 \lvert Y=1]=\frac{0.25}{1.862}=0.1343 \\&P[X=6 \lvert Y=1]=\frac{0.1536}{1.862}=0.0825 \end{aligned}

\displaystyle \begin{aligned} &P[X=1 \lvert Y=2]=\frac{0.0486}{1.533}=0.0317 \\&P[X=2 \lvert Y=2]=\frac{0.1536}{1.533}=0.1002 \\&P[X=3 \lvert Y=2]=\frac{0.2646}{1.533}=0.1726 \\&P[X=4 \lvert Y=2]=\frac{0.3456}{1.533}=0.2254 \\&P[X=5 \lvert Y=2]=\frac{0.375}{1.533}=0.2446 \\&P[X=6 \lvert Y=2]=\frac{0.3456}{1.533}=0.2254 \end{aligned}

\displaystyle \begin{aligned} &P[X=1 \lvert Y=3]=\frac{0.0036}{0.854}=0.0042 \\&P[X=2 \lvert Y=3]=\frac{0.0256}{0.854}=0.0300 \\&P[X=3 \lvert Y=3]=\frac{0.0756}{0.854}=0.0885 \\&P[X=4 \lvert Y=3]=\frac{0.1536}{0.854}=0.1799 \\&P[X=5 \lvert Y=3]=\frac{0.25}{0.854}=0.2927 \\&P[X=6 \lvert Y=3]=\frac{0.3456}{0.854}=0.4047 \end{aligned}

\displaystyle \begin{aligned} &P[X=1 \lvert Y=4]=\frac{0.0001}{0.2275}=0.0004 \\&P[X=2 \lvert Y=4]=\frac{0.0016}{0.2275}=0.0070 \\&P[X=3 \lvert Y=4]=\frac{0.0081}{0.2275}=0.0356 \\&P[X=4 \lvert Y=4]=\frac{0.0256}{0.2275}=0.1125 \\&P[X=5 \lvert Y=4]=\frac{0.0625}{0.2275}=0.2747 \\&P[X=6 \lvert Y=4]=\frac{0.1296}{0.2275}=0.5697 \end{aligned}

Practice Problem 7-E

$\displaystyle E[X]=\frac{7}{2}=3.5$

$\displaystyle E[X^2]=\frac{91}{6}$

$\displaystyle Var[X]=\frac{35}{12}$

Practice Problem 7-F

$\displaystyle E[Y]=1.4$

$\displaystyle E[Y^2]=3.22$

$\displaystyle Var[Y]=1.26$

Practice Problem 7-G

$\displaystyle \text{Cov}(X,Y)=\frac{7}{6}$

$\displaystyle \rho=\frac{7}{6 \sqrt{3.675}}=0.60858$

Dan Ma statistical

Daniel Ma statistical

Dan Ma practice problems

Daniel Ma practice problems

Daniel Ma mathematics

Dan Ma math

Daniel Ma probability

Dan Ma probability

Daniel Ma statistics

Dan Ma statistics

Dan Ma mathematical

Daniel Ma mathematical

$\copyright$ 2019 – Dan Ma

## Practice Problem Set 3 – The Big 3 Discrete Distributions

This post presents exercises on the big 3 discrete distributions – binomial, Poisson and negative binomial, reinforcing the concepts discussed in several blog posts (here and here).

A previous problem set on Poisson and gamma is found here.

A previous problem set on Poisson distribution is found here.

$\text{ }$

 Practice Problem 3-A The amount of damage from an auto collision accident is modeled by an exponential distribution with mean 5. Ten unrelated auto collision claims are examined by an insurance adjuster. What is the probability that five of the claims will have damages exceeding the mean damage amount? What is the probability that at most two of the claims will have damages exceeding the mean damage amount? What is the expected number of claims with damages exceeding the mean?

$\text{ }$

 Practice Problem 3-B The jackpot of the Powerball lottery can sometimes be in the hundreds of millions dollars. The odds of winning the jackpot are one in 292 million. However, there are prizes other than the jackpot (some of the lesser prizes are $100 and$7). The odds of winning a prize in Powerball are one in 24.87. A Powerball player buys one ticket every month for a year. What is the probability of winning at least one prize? What is the probability of winning at least two prizes? What is the probability of winning at least three prizes? What is the probability of winning at least four prizes? See here for the calculation of Powerball winning odds.

$\text{ }$

 Practice Problem 3-C According to a poll conducted by AAA, 94% of teen drivers acknowledge the dangers of texting and driving but 35% admitted to doing it anyway. In a random sample of 20 teen drivers, what is the probability that exactly five of the teen drivers do texting while driving? what is the probability that more than five of the teen drivers do texting while driving?

$\text{ }$

 Practice Problem 3-D According to aviation statistics in the commercial airline industry, approximately one in 225 bags or luggage that are checked is lost. A business executive will be flying frequently next year and will be checking 100 bags or luggage during that one year. Determine the probability that the business executive will not lose any bags or luggage during his travel. Determine the probability that the business executive will lose one or two bags or luggage during his travel.

$\text{ }$

 Practice Problem 3-E A large group of insured drivers are classified as high risk and low risk. About 10% of the drivers in this group are considered high risk while the remaining 90% are considered low risk drivers. The number of auto accidents in a year for a high risk driver in this group is modeled by a binomial distribution with mean 0.8 and variance 0.64. The number of auto accidents in a year for a low risk driver is modeled by a binomial distribution with mean 0.4 and variance 0.36. Suppose that an insured driver is randomly selected from this group. What is the probability that the randomly selected insured driver will have no auto accident in the next policy year? What is the probability that the randomly selected insured driver will have more than 1 auto accident in the next policy year? What is the variance of the number of auto accidents for the randomly selected insured drivers in the next policy year?

$\text{ }$

 Practice Problem 3-F The number of TV sets of a particular brand sold in a given week at an electronic store has a Poisson distribution with mean 4. Determine the probability that the store will sell more than 4 TV sets next week. Determine the minimum number of TV sets that the manager should order for the next week so that the probability of having more sales than available TV sets is less than 0.10.

$\text{ }$

 Practice Problem 3-G The number of vacant rooms in a given night in a certain hotel follows a Poisson distribution with mean 1.75. Three travelers without reservation walk into the hotel one night. Assume that they do not know each other. Determine the probability that rooms are available for all three travelers. Given that rooms are available for all three travelers, determine the probability that the hotel will still be able to accommodate three more travelers without reservation who also do not know each other.

$\text{ }$

 Practice Problem 3-H Cars running the red light arrive at a busy intersection according to a Poisson process with the rate of 0.5 per hour. What is the probability that there will be at most 4 cars running the red light in a 5-hour period? After a period of having no activities in running red light, what is the probability that it will take more than 90 minutes to see another car running the red light? After a period of having no activities in running red light, what is the probability that it will take more than 90 minutes to see two cars running the red light?

$\text{ }$

 Practice Problem 3-I Consider a roulette wheel consisting of 38 numbers – 1 through 36, and 0 and 00. A player always makes bets on one of the numbers 1 through 12. Determine the probability that the player will lose his first 5 bets. Determine the probability that the first win of the player will occur on the 5th bet. Determine the probability that the first win of the player will occur no later than the 5th bet.

$\text{ }$

 Practice Problem 3-J Suppose that roughly 10% of the adult population have type II diabetes. A researcher wishes to find 3 adult patients who are diabetic. Suppose that the researcher evaluate one patient at a time until finding three diabetic patients. What is the probability that the third diabetic patient is found after evaluating 10 or 11 patients?

$\text{ }$

 Practice Problem 3-K For any high risk insured driver, the number of auto accidents in a year has a negative binomial distribution with mean 1.6 and variance 2.88. One such insured driver is selected at random and observed for one year. What is the probability that the insured driver will have more than one accident?

$\text{ }$

 Practice Problem 3-L A discrete probability distribution has the following probability function. $\displaystyle P(X=k)=\frac{(k+1) (k+2)}{2} \ \biggl(\frac{4}{9} \biggr)^3 \ \biggl(\frac{5}{9} \biggr)^k \ \ \ \ \ k=0,1,2,3,\cdots$ Determine the mean and variance of $X$.

$\text{ }$

 Practice Problem 3-M A large pool of insureds is made up of two subgroups – low risk (75% of the pool) and high risk (25% of the pool). The number of claims in a year for each insured can be any non-negative integer 0, 1, 2, 3, … The number of claims in a year for each insured in the low risk group has a negative binomial distribution with mean 0.5 and variance 0.625. The number of claims in a year for each insured in the high risk group has a negative binomial distribution with mean 0.75 and variance 0.9375. If a randomly selected insured from the pool is observed to have one claim in a given year, what is the probability that the insured is a high risk insured?

$\text{ }$

 Practice Problem 3-N An American roulette wheel has 38 areas – numbers 1 through 36 and 0 and 00. A player bets on odd numbers (1, 3, 5, 7, …, 35). He leaves the game when he wins 5 bets. What is the expected number of bets the player will lose before winning 5 bets? What is the probability that the player will lose 5 bets before leaving the game?

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

3-A
• 0.171367
• 0.2247123
• $10 e^{-1}=3.67879$
3-B
• 0.388889698
• 0.081670443
• 0.010882596
• 0.000997406
3-C
• 0.127199186
• 0.754604255
3-D
• 0.640545556
• 0.348149413
3-E
• 0.43425
• 0.16795
• 0.6264
3-F
• $\displaystyle 1-\frac{103}{3} e^{-4}=0.371163065$
• min is 7 since $P(X>6)=0.11$ and $P(X>7)=0.0511$
3-G
• $\displaystyle 1-4.28125 e^{-1.75}=0.256030305$
• 0.035673762
3-H
• 0.891178019
• $\displaystyle e^{-0.75}=0.472366553$
• $\displaystyle 1.75 e^{-0.75}=0.826641467$
3-I
• $\displaystyle (13/19)^5=0.1499507895$
• $\displaystyle (6/19) (13/19)^4=0.0692$
• $\displaystyle 1-(13/19)^5=0.85$
3-J
• 0.036589713
3-K
• $\displaystyle \frac{304}{729}=0.417$
3-L
• 3.75
• 8.4375
3-M
• $\displaystyle \frac{0.0768}{0.2688}=0.2857$
3-M
• $\displaystyle \frac{50}{9}=5.56$
• 0.1213520403

Daniel Ma mathematics

Dan Ma math

Daniel Ma probability

Dan Ma probability

Daniel Ma statistics

Dan Ma statistics

$\copyright$ 2018 – Dan Ma

## Practice Problems for Conditional Distributions, Part 1

The following are practice problems on conditional distributions. The thought process of how to work with these practice problems can be found in the blog post Conditionals Distribution, Part 1.

_____________________________________________________________________________________

Description of Problems

Suppose $X$ and $Y$ are independent binomial distributions with the following parameters.

For $X$, number of trials $n=5$, success probability $\displaystyle p=\frac{1}{2}$

For $Y$, number of trials $n=5$, success probability $\displaystyle p=\frac{3}{4}$

We can think of these random variables as the results of two students taking a multiple choice test with 5 questions. For example, let $X$ be the number of correct answers for one student and $Y$ be the number of correct answers for the other student. For the practice problems below, passing the test means having 3 or more correct answers.

Suppose we have some new information about the results of the test. The problems below are to derive the conditional distributions of $X$ or $Y$ based on the new information and to compare the conditional distributions with the unconditional distributions.

Practice Problem 1

• New information: $X.
• Derive the conditional distribution for $X \lvert X.
• Derive the conditional distribution for $Y \lvert X.
• Compare these conditional distributions with the unconditional ones with respect to mean and probability of passing.
• What is the effect of the new information on the test performance of each of the students?
• Explain why the new information has the effect on the test performance?

Practice Problem 2

• New information: $X>Y$.
• Derive the conditional distribution for $X \lvert X>Y$.
• Derive the conditional distribution for $Y \lvert X>Y$.
• Compare these conditional distributions with the unconditional ones with respect to mean and probability of passing.
• What is the effect of the new information on the test performance of each of the students?
• Explain why the new information has the effect on the test performance?

Practice Problem 3

• New information: $Y=X+1$.
• Derive the conditional distribution for $X \lvert Y=X+1$.
• Derive the conditional distribution for $Y \lvert Y=X+1$.
• Compare these conditional distributions with the unconditional ones with respect to mean and probability of passing.
• What is the effect of the new information on the test performance of each of the students?
• Explain why the new information has the effect on the test performance?

_____________________________________________________________________________________

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$
_____________________________________________________________________________________

To let you know that you are on the right track, the conditional distributions are given below.

The thought process of how to work with these practice problems can be found in the blog post Conditional Distributions, Part 1.

Practice Problem 1

$\displaystyle P(X=0 \lvert X

$\displaystyle P(X=1 \lvert X

$\displaystyle P(X=2 \lvert X

$\displaystyle P(X=3 \lvert X

$\displaystyle P(X=4 \lvert X

____________________

$\displaystyle P(Y=1 \lvert X

$\displaystyle P(Y=2 \lvert X

$\displaystyle P(Y=3 \lvert X

$\displaystyle P(Y=4 \lvert X

$\displaystyle P(Y=5 \lvert X

Practice Problem 2

$\displaystyle P(X=1 \lvert X>Y)=\frac{5}{3386}=0.0013$

$\displaystyle P(X=2 \lvert X>Y)=\frac{160}{3386}=0.04$

$\displaystyle P(X=3 \lvert X>Y)=\frac{1060}{3386}=0.2728$

$\displaystyle P(X=4 \lvert X>Y)=\frac{1880}{3386}=0.4838$

$\displaystyle P(X=5 \lvert X>Y)=\frac{781}{3386}=0.2$

____________________

$\displaystyle P(Y=0 \lvert X>Y)=\frac{31}{3386}=0.008$

$\displaystyle P(Y=1 \lvert X>Y)=\frac{390}{3386}=0.1$

$\displaystyle P(Y=2 \lvert X>Y)=\frac{1440}{3386}=0.37$

$\displaystyle P(Y=3 \lvert X>Y)=\frac{1620}{3386}=0.417$

$\displaystyle P(Y=4 \lvert X>Y)=\frac{405}{3386}=0.104$

Practice Problem 3

$\displaystyle P(X=0 \lvert Y=X+1)=\frac{15}{8430}=0.002$

$\displaystyle P(X=1 \lvert Y=X+1)=\frac{450}{8430}=0.053$

$\displaystyle P(X=2 \lvert Y=X+1)=\frac{2700}{8430}=0.32$

$\displaystyle P(X=3 \lvert Y=X+1)=\frac{4050}{8430}=0.48$

$\displaystyle P(X=4 \lvert Y=X+1)=\frac{1215}{8430}=0.144$

____________________

$\displaystyle P(Y=1 \lvert Y=X+1)=\frac{15}{8430}=0.002$

$\displaystyle P(Y=2 \lvert Y=X+1)=\frac{450}{8430}=0.053$

$\displaystyle P(Y=3 \lvert Y=X+1)=\frac{2700}{8430}=0.32$

$\displaystyle P(Y=4 \lvert Y=X+1)=\frac{4050}{8430}=0.48$

$\displaystyle P(Y=5 \lvert Y=X+1)=\frac{1215}{8430}=0.144$

_____________________________________________________________________________________

$\copyright \ 2013 \text{ by Dan Ma}$

## Mixing Bowls of Balls

We present problems involving mixture distributions in the context of choosing bowls of balls, as well as related problems involving Bayes’ formula. Problem 1a and Problem 1b are discussed. Problem 2a and Problem 2b are left as exercises.

____________________________________________________________

Problem 1a
There are two identical looking bowls. Let’s call them Bowl 1 and Bowl 2. In Bowl 1, there are 1 red ball and 4 white balls. In Bowl 2, there are 4 red balls and 1 white ball. One bowl is selected at random and its identify is kept from you. From the chosen bowl, you randomly select 5 balls (one at a time, putting it back before picking another one). What is the expected number of red balls in the 5 selected balls? What the variance of the number of red balls?

Problem 1b
Use the same information in Problem 1a. Suppose there are 3 red balls in the 5 selected balls. What is the probability that the unknown chosen bowl is Bowl 1? What is the probability that the unknown chosen bowl is Bowl 2?

____________________________________________________________

Problem 2a
There are three identical looking bowls. Let’s call them Bowl 1, Bowl 2 and Bowl 3. Bowl 1 has 1 red ball and 9 white balls. Bowl 2 has 4 red balls and 6 white balls. Bowl 3 has 6 red balls and 4 white balls. A bowl is chosen according to the following probabilities:

\displaystyle \begin{aligned}\text{Probabilities:} \ \ \ \ \ &P(\text{Bowl 1})=0.6 \\&P(\text{Bowl 2})=0.3 \\&P(\text{Bowl 3})=0.1 \end{aligned}

The bowl is chosen so that its identity is kept from you. From the chosen bowl, 5 balls are selected sequentially with replacement. What is the expected number of red balls in the 5 selected balls? What is the variance of the number of red balls?

Problem 2b
Use the same information in Problem 2a. Given that there are 4 red balls in the 5 selected balls, what is the probability that the chosen bowl is Bowl i, where $i = 1,2,3$?

____________________________________________________________
Solution – Problem 1a

Problem 1a is a mixture of two binomial distributions and is similar to Problem 1 in the previous post Mixing Binomial Distributions. Let $X$ be the number of red balls in the 5 balls chosen from the unknown bowl. The following is the probability function:

$\displaystyle P(X=x)=0.5 \binom{5}{x} \biggl[\frac{1}{5}\biggr]^x \biggl[\frac{4}{5}\biggr]^{4-x}+0.5 \binom{5}{x} \biggl[\frac{4}{5}\biggr]^x \biggl[\frac{1}{5}\biggr]^{4-x}$

where $X=0,1,2,3,4,5$.

The above probability function is the weighted average of two conditional binomial distributions (with equal weights). Thus the mean (first moment) and the second moment of $X$ would be the weighted averages of the two same items of the conditional distributions. We have:

$\displaystyle E(X)=0.5 \biggl[ 5 \times \frac{1}{5} \biggr] + 0.5 \biggl[ 5 \times \frac{4}{5} \biggr] =\frac{5}{2}$
$\displaystyle E(X^2)=0.5 \biggl[ 5 \times \frac{1}{5} \times \frac{4}{5} +\biggl( 5 \times \frac{1}{5} \biggr)^2 \biggr]$

$\displaystyle + 0.5 \biggl[ 5 \times \frac{4}{5} \times \frac{1}{5} +\biggl( 5 \times \frac{4}{5} \biggr)^2 \biggr]=\frac{93}{10}$
$\displaystyle Var(X)=\frac{93}{10} - \biggl( \frac{5}{2} \biggr)^2=\frac{61}{20}=3.05$

See Mixing Binomial Distributions for a more detailed explanation of the calculation.

____________________________________________________________

Solution – Problem 1b
As above, let $X$ be the number of red balls in the 5 selected balls. The probability $P(X=3)$ must account for the two bowls. Thus it is obtained by mixing two binomial probabilities:

$\displaystyle P(X=3)=\frac{1}{2} \binom{5}{3} \biggl(\frac{1}{5}\biggr)^3 \biggl(\frac{4}{5}\biggr)^2+\frac{1}{2} \binom{5}{3} \biggl(\frac{4}{5}\biggr)^3 \biggl(\frac{1}{5}\biggr)^2$

The following is the conditional probability $P(\text{Bowl 1} \lvert X=3)$:

\displaystyle \begin{aligned} P(\text{Bowl 1} \lvert X=3)&=\frac{\displaystyle \frac{1}{2} \binom{5}{3} \biggl(\frac{1}{5}\biggr)^3 \biggl(\frac{4}{5}\biggr)^2}{P(X=3)} \\&=\frac{16}{16+64} \\&=\frac{1}{5} \end{aligned}

Thus $\displaystyle P(\text{Bowl 1} \lvert X=3)=\frac{4}{5}$

____________________________________________________________

Problem 2a
Let $X$ be the number of red balls in the 5 balls chosen random from the unknown bowl.

$E(X)=1.2$
$Var(X)=1.56$

Problem 2b

$\displaystyle P(\text{Bowl 1} \lvert X=4)=\frac{27}{4923}=0.0055$

$\displaystyle P(\text{Bowl 2} \lvert X=4)=\frac{2304}{4923}=0.4680$

$\displaystyle P(\text{Bowl 3} \lvert X=4)=\frac{2592}{4923}=0.5265$

## A Binomial Example

This post discusses the limited version of a counting problem that can be solved by using the binomial distribution. The more general problem is also discussed.

Example 1
Suppose 7 dice are rolled. What is the probability that at least 4 of the dice show the same face?

Example 2
Suppose that 6 job assignments are randomly assigned to 5 workers. What is the probability that at least 4 of the job assignments go to the same worker?

Example 2 is left as exercise.

Discussion of Example 1

First, we discuss how to solve using the binomial distribution. Fix a face (say 1). Finding the probability of that at least 4 of the dice show the face 1 is a binomial problem. Then multiplying this answer by 6 will give the desired answer.

Consider obtaining a 1 as a success. Let $X$ be the number of successes when 7 dice are thrown. Then $X$ is $\text{binom}(7,\frac{1}{6})$. We have the following calculation:

\displaystyle \begin{aligned}(1) \ \ \ \ \ P(X \ge 4)&=1-P(X \le 3) \\&=1-P(X=0)-P(X=1) \\&- \ \ \ P(X=2)-P(X=3) \\&=1-\binom{7}{0} \biggl[\frac{1}{6} \biggr]^0 \biggr[\frac{5}{6} \biggr]^7 - \binom{7}{1} \biggl[\frac{1}{6} \biggr]^1 \biggr[\frac{5}{6} \biggr]^6 \\&- \ \ \ \binom{7}{2} \biggl[\frac{1}{6} \biggr]^2 \biggr[\frac{5}{6} \biggr]^5 - \binom{7}{3} \biggl[\frac{1}{6} \biggr]^3 \biggr[\frac{5}{6} \biggr]^4 \\&=\frac{4936}{279936} \end{aligned}

Multiplying $(1)$ by 6 produces the desired answer.

\displaystyle \begin{aligned}(2) \ \ \ \ \ 6 \times P(X \ge 4)&=6 \times \frac{4936}{279936} \\&=\frac{29616}{279936} \\&=0.105796 \end{aligned}

Note that in rolling 7 dice, only one face can appear 4 or more times. The binomial distribution $\text{binom}(7,\frac{1}{6})$ counts the number of ways one particular face (say 1) can appear 4 or more times. There are six such binomial distributions (one for each face). These six binomial distributions do not overlap. So we can obtain the answer by multiplying the binomial result by 6.

If more dice are rolled, the different binomial distributions will overlap. In fact, in rolling 8 dice, it is possible that 2 faces can appear 4 times (e.g. the face 1 appears 4 times and the face 2 appears 4 times). If we multiple the binomial calculated result by 6, the result would not be correct. To work the problem of rolling 8 or more dice, we need to use the multinomial theorem. See this post a discussion of using multinomial theorem.

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\displaystyle \frac{1325}{15625}=0.0848$

Dan Ma statistical

Daniel Ma statistical

Dan Ma practice problems

Daniel Ma practice problems

Daniel Ma mathematics

Dan Ma math

Daniel Ma probability

Dan Ma probability

Daniel Ma statistics

Dan Ma statistics

Dan Ma mathematical

Daniel Ma mathematical

$\copyright$ 2012 – 2019 – Dan Ma

## An Example on Calculating Covariance

The practice problems presented here are continuation of the problems in this previous post.

Problem 1

Let $X$ be the value of one roll of a fair die. If the value of the die is $x$, we are given that $Y \lvert X=x$ has a binomial distribution with $n=x$ and $p=\frac{1}{4}$ (we use the notation $\text{binom}(x,\frac{1}{4})$ to denote this binomial distribution).

1. Compute the mean and variance of $X$.
2. Compute the mean and variance of $Y$.
3. Compute the covariance $Cov(X,Y)$ and the correlation coefficient $\rho$.

Problem 2

Let $X$ be the value of one roll of a fair die. If the value of the die is $x$, we are given that $Y \lvert X=x$ has a binomial distribution with $n=x$ and $p=\frac{1}{2}$ (we use the notation $\text{binom}(x,\frac{1}{2})$ to denote this binomial distribution).

1. Compute the mean and variance of $X$.
2. Compute the mean and variance of $Y$.
3. Compute the covariance $Cov(X,Y)$ and the correlation coefficient $\rho$.

Problem 2 is left as exercise. A similar problem is also found in this post.

Discussion of Problem 1

The joint variables $X$ and $Y$ are identical to the ones in this previous post. However, we do not plan on following the approach in the previous, which is to first find the probability functions for the joint distribution and then the marginal distribution of $Y$. The calculation of covariance in Problem 1.3 can be very tedious by taking this approach.

Problem 1.1
We start with the easiest part, which is the random variable $X$ (the roll of the die). The variance is computed by $Var(X)=E(X^2)-E(X)^2$.

(1)……$\displaystyle E(X)=\frac{1}{6} \biggl[1+2+3+4+5+6 \biggr]=\frac{21}{6}=3.5$

(2)……$\displaystyle E(X^2)=\frac{1}{6} \biggl[1^2+2^2+3^2+4^2+5^2+6^2 \biggr]=\frac{91}{6}$

(3)……$\displaystyle Var(X)=\frac{91}{6}-\biggl[\frac{21}{6}\biggr]^2=\frac{105}{36}=\frac{35}{12}$

Problem 1.2

We now compute the mean and variance of $Y$. The calculation of finding the joint distribution and then finding the marginal distribution of $Y$ is tedious and has been done in this previous post. We do not take this approach here. Instead, we find the unconditional mean $E(Y)$ by weighting the conditional mean $E(Y \lvert X=x)$. The weights are the probabilities $P(X=x)$. The following is the idea.

(4)……\displaystyle \begin{aligned} E(Y)&=E_X[E(Y \lvert X=x)] \\&= E(Y \lvert X=1) \times P(X=1) \\&+ E(Y \lvert X=2) \times P(X=2)\\&+ E(Y \lvert X=3) \times P(X=3) \\&+ E(Y \lvert X=4) \times P(X=4) \\&+E(Y \lvert X=5) \times P(X=5) \\&+E(Y \lvert X=6) \times P(X=6) \end{aligned}

We have $P(X=x)=\frac{1}{6}$ for each $x$. Before we do the weighting, we need to have some items about the conditional distribution $Y \lvert X=x$. Since $Y \lvert X=x$ has a binomial distribution, we have:

(5)……$\displaystyle E(Y \lvert X=x)=\frac{1}{4} \ x$

(6)……$\displaystyle Var(Y \lvert X=x)=\frac{1}{4} \ \frac{3}{4} \ x=\frac{3}{16} \ x$

For any random variable $W$, $Var(W)=E(W^2)-E(W)^2$ and $E(W^2)=Var(W)+E(W)^2$. The following is the second moment of $Y \lvert X=x$, which is needed in calculating the unconditional variance $Var(Y)$.

(7)……\displaystyle \begin{aligned} E(Y^2 \lvert X=x)&=\frac{3}{16} \ x+\biggl[\frac{1}{4} \ x \biggr]^2 \\&=\frac{3x}{16}+\frac{x^2}{16} \\&=\frac{3x+x^2}{16} \end{aligned}

We can now do the weighting to get the items of the variable $Y$.

(8)……\displaystyle \begin{aligned} E(Y)&=\frac{1}{6} \biggl[\frac{1}{4} +\frac{2}{4}+\frac{3}{4}+ \frac{4}{4}+\frac{5}{4}+\frac{6}{4}\biggr] \\&=\frac{7}{8} \\&=0.875 \end{aligned}

(9)……\displaystyle \begin{aligned} E(Y^2)&=\frac{1}{6} \biggl[\frac{3(1)+1^2}{16} +\frac{3(2)+2^2}{16}+\frac{3(3)+3^2}{16} \\&+ \frac{3(4)+4^2}{16}+\frac{3(5)+5^2}{16}+\frac{3(6)+6^2}{16}\biggr] \\&=\frac{154}{96} \\&=\frac{77}{48} \end{aligned}

(10)……\displaystyle \begin{aligned} Var(Y)&=E(Y^2)-E(Y)^2 \\&=\frac{77}{48}-\biggl[\frac{7}{8}\biggr]^2 \\&=\frac{161}{192} \\&=0.8385 \end{aligned}

Problem 1.3

The following is the definition of covariance of $X$ and $Y$:

(11)……$\displaystyle Cov(X,Y)=E[(X-\mu_X)(Y-\mu_Y)]$

where $\mu_X=E(X)$ and $\mu_Y=E(Y)$.

The definition (11) can be simplified as:

(12)……$\displaystyle Cov(X,Y)=E[XY]-E[X] E[Y]$

To compute $E[XY]$, we can use the joint probability function of $X$ and $Y$ to compute this expectation. But this is tedious. Anyone who wants to try can go to this previous post to obtain the joint distribution.

Note that the conditional mean $E(Y \lvert X=x)=\frac{x}{4}$ is a linear function of $x$. It is a well known result in probability and statistics that whenever a conditional mean $E(Y \lvert X=x)$ is a linear function of $x$, the conditional mean can be written as:

(13)……$\displaystyle E(Y \lvert X=x)=\mu_Y+\rho \ \frac{\sigma_Y}{\sigma_X} \ (x-\mu_X)$

where $\mu$ is the mean of the respective variable, $\sigma$ is the standard deviation of the respective variable and $\rho$ is the correlation coefficient. The following relates the correlation coefficient with the covariance.

(14)……$\displaystyle \rho=\frac{Cov(X,Y)}{\sigma_X \ \sigma_Y}$

Comparing (5) and (13), we have $\displaystyle \rho \frac{\sigma_Y}{\sigma_X}=\frac{1}{4}$ and

(15)……$\displaystyle \rho = \frac{\sigma_X}{4 \ \sigma_Y}$

Equating (14) and (15), we have $Cov(X,Y)=\frac{\sigma_X^2}{4}$. Thus we deduce that $Cov(X,Y)$ is one-fourth of the variance of $X$. Using $(3)$, we have:

(16)……$\displaystyle Cov(X,Y) = \frac{1}{4} \times \frac{35}{12}=\frac{35}{48}=0.72917$

Plug in all the items of (3), (10), and (16) into (14), we obtained $\rho=0.46625$. Both $\rho$ and $Cov(X,Y)$ are positive, an indication that both variables move together. When one increases, the other variable also increases. Thus makes sense based on the definition of the variables. For example, when the value of the die is large, the number of trials of $Y$ is greater (hence a larger mean).

A similar problem is also found in this post.

.

.

.

.

.

.

.

.

$\displaystyle E[X]=\frac{7}{2}$

$\displaystyle Var[X]=\frac{35}{12}$

$\displaystyle E[Y]=\frac{7}{4}$

$\displaystyle Var[Y]=\frac{77}{48}$

$\displaystyle \text{Cov}(X,Y)=\frac{35}{24}$

$\displaystyle \rho=\sqrt{\frac{5}{11}}=0.67419986$

Dan Ma statistical

Daniel Ma statistical

Dan Ma practice problems

Daniel Ma practice problems

Daniel Ma mathematics

Dan Ma math

Daniel Ma probability

Dan Ma probability

Daniel Ma statistics

Dan Ma statistics

Dan Ma mathematical

Daniel Ma mathematical

$\copyright$ 2012-2019 – Dan Ma