## 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

## Calculating the probability distributions of order statistics

This post presents exercises on finding the probability distributions of order statistics to complement a discussion of the same topic.

Consider a random sample $X_1,X_2,\cdots,X_n$ drawn from a continuous distribution with common distribution function $F(x)$. The order statistics $Y_1 are obtained by ranking the sample items in increasing order. In this post, we present some exercises to complement this previous post. The thought processes illustrated by these exercises will be helpful in non-parametric inference, specifically in the construction of confidence intervals for unknown population percentiles.

In the problems that follow, $Y_1 are the order statistics that arise from the random sample $X_1,X_2,\cdots,X_n$. There are two ways to work with the probability distribution of an order statistic $Y_j$. One is to find the distribution function $F_{Y_j}(y)=P(Y_j \le y)$. Once this is obtained, the density function $f_{Y_j}(y)$ is derived by taking derivative. Another way is to derive $f_{Y_j}(y)$ directly.

We assume that the random sample $X_1,X_2,\cdots,X_n$ is drawn from a probability distribution with distribution function $F(x)=P(X \le x)$ and with density function $f(x)$. To compute $F_{Y_j}(y)=P(Y_j \le y)$, note that for the event $Y_j \le y$ to occur, at least $j$ many sample items $X_i$ are less than $y$. So the random drawing of each sample item is a Bernoulli trial with probability of success $F(y)=P(X \le y)$. Thus $F_{Y_j}(y)=P(Y_j \le y)$ is the following probability computed from a binomial distribution.

$\displaystyle F_{Y_j}(y)=P(Y_j \le y)=\sum \limits_{k=j}^n \ \binom{n}{k} \ F(y)^k \ \biggl[1-F(y) \biggr]^{n-k} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (1)$

Once the distribution function $F_{Y_j}(y)$ is found, the density function $f_{Y_j}(y)$ can be derived by taking derivative on $F_{Y_j}(y)$. The density function $f_{Y_j}(y)$ can also be obtained directly by this thought process. Think of the density function $f_{Y_j}(y)$ as the probability that the $j$th order statistic $Y_j$ is right around $y$. So there must be $j-1$ sample items less than $y$ and $n-j$ sample items above $y$. One way this can happen is:

$\displaystyle F(y)^{j-1} \ f(y) \ \biggl[1-F(y) \biggr]^{n-j}$

The first term is the probability that $j-1$ sample terms are less than $y$. The second term is the probability that one sample item is right around $y$. The third term is the probability that $n-j$ sample items are above $y$. But this is only one way. To capture all possibilities, we multiply it by the multinomial coefficient.

$\displaystyle f(_{Y_j}(y)=\frac{n!}{(j-1)! \ 1! \ (n-j)!} \ F(y)^{j-1} \ f(y) \ \biggl[1-F(y) \biggr]^{n-j} \ \ \ \ \ \ \ \ \ \ (2)$

_____________________________________________________________________________________

Practice Problems

Practice Problems 1
Draw a random sample $X_1,X_2,\cdots,X_8$ of size 8 from the uniform distribution $U(0,4)$. Calculate the probability $P(Y_3>3)$ where $Y_3$ is the third order statistic.

$\text{ }$

Practice Problems 2
Draw a random sample $X_1,X_2,X_3,X_4,X_5$ of size 5 from a continuous distribution with density function $f(x)=\frac{x}{2}$ where $0. Find the probability that the sample median is less than 1.

$\text{ }$

Practice Problems 3
Draw a random sample $X_1,X_2,X_3,X_4,X_5$ of size 5 from the uniform distribution $U(0,4)$.

1. Calculate the distribution function $P(Y_4 \le y)$ for the fourth order statistic. Then differentiate it to obtain the density function $f_{Y_4}(y)$ of $Y_4$.
2. Use the thought process behind formula (2) above to directly write down the density function $f_{Y_4}(y)$ directly.

$\text{ }$

Practice Problems 4
Draw a random sample $X_1,X_2,\cdots,X_9$ of size 9 from an exponential distribution with mean $\frac{1}{\alpha}$.

1. Calculate the distribution function $P(Y_1 \le y)$ for the first order statistic (the minimum). Then differentiate it to obtain the density function $f_{Y_1}(y)$ of $Y_1$.
2. Use the thought process behind formula (2) above to directly write down the density function $f_{Y_1}(y)$ directly.

$\text{ }$

Practice Problems 5
Draw a random sample $X_1,X_2,\cdots,X_9$ of size 9 from an exponential distribution with mean $\frac{1}{\alpha}$.

1. Calculate the distribution function $P(Y_2 \le y)$ for the second order statistic. Then differentiate it to obtain the density function $f_{Y_2}(y)$ of $Y_2$.
2. Use the thought process behind formula (2) above to directly write down the density function $f_{Y_2}(y)$ directly.

$\text{ }$

Practice Problems 6
Draw a random sample $X_1,X_2,\cdots,X_8$ of size 8 from the uniform distribution $U(0,1)$. Find $E(Y_6)$, the expected value of the sixth order statistic.

$\text{ }$

Practice Problems 7
Draw a random sample $X_1,X_2,\cdots,X_{10}$ of size 10 from the uniform distribution $U(0,1)$. Find $Var(Y_9)$, the variance of the ninth order statistic.

$\text{ }$

Practice Problems 8
Draw a random sample $X_1,X_2,\cdots,X_{6}$ of size 6 from a population whose 25th percentile is 83. Find the probability the third order statistic $Y_3$ is less than 83.

$\text{ }$

Practice Problems 9
Draw a random sample $X_1,X_2,\cdots,X_{6}$ of size 6 from a population whose 75th percentile is 105. Find the probability the third order statistic $Y_3$ is less than 105.

$\text{ }$

Practice Problems 10
Draw a random sample $X_1,X_2,X_3,X_4$ of size 4 from an exponential distribution with mean 10. Calculate $P(Y_4>15 \ | \ Y_4 > 10)$.

$\text{ }$

Practice Problems 11
Draw a random sample $X_1,X_2,X_3,X_4,X_5$ of size 5 from a continuous distribution with density function $f(x)=\frac{x}{2}$ where $0. Find $E(Y_5)$, the expected value of the sample maximum.

$\text{ }$

Practice Problems 12
Draw a random sample of size 12 from an exponential distribution with mean 2. Calculate $P(Y_1>0.5 | Y_1 > 0.25)$.

$\text{ }$

_____________________________________________________________________________________

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$
_____________________________________________________________________________________

Practice Problems 1

• $\displaystyle P(Y_3>3)=\frac{277}{65536}$

$\text{ }$

Practice Problems 2

• $\displaystyle P(Y_3<1)=\frac{106}{1024}$

$\text{ }$

Practice Problems 3

• $\displaystyle f_{Y_4}(y)=20 \ \biggl( \frac{y}{4} \biggr)^3 \ \frac{1}{4} \ \biggl(1- \frac{y}{4} \biggr)$

$\text{ }$

Practice Problems 4

• $\displaystyle f_{Y_1}(y)=9 \alpha \ e^{-9 \alpha y}$

$\text{ }$

Practice Problems 5

• $\displaystyle f_{Y_2}(y)=72 \ \biggl(1-e^{-\alpha y} \biggr) \ \alpha e^{-\alpha y} \ \biggl( e^{-\alpha y} \biggr)^7$

$\text{ }$

Practice Problems 6

• $\displaystyle E(Y_6)=\frac{2}{3}$

$\text{ }$

Practice Problems 7

• $\displaystyle Var(Y_9)=\frac{3}{242}$

$\text{ }$

Practice Problems 8

• $\displaystyle P(Y_3<83)=\frac{694}{4096}$

$\text{ }$

Practice Problems 9

• $\displaystyle P(Y_3<105)=\frac{3942}{4096}$

$\text{ }$

Practice Problems 10

• $\displaystyle P(Y_4>15 \ | \ Y_4 > 10)$ = 0.756546693

$\text{ }$

Practice Problems 11

• $\displaystyle E(Y_5)=\frac{20}{11}$

$\text{ }$

Practice Problems 12

• $\displaystyle P(Y_1>0.5 | Y_1 > 0.25)=e^{-1.5}$

_____________________________________________________________________________________

$\copyright \ 2015 \text{ by 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

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
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}

To give some perspective to this example, for each $i=1,2,3,4,5,6$, let $A_i$ be the event that at least 4 of the dice show the value of $i$ when 7 dice are rolled. The calculation $(1)$ above calculates the probability of the event $A_i$. In this example, the event $A_i$ are mutually exclusive. This is the reason why we can multiply by 6 to obtained the answer in $(2)$.

If we roll more dice, the event $A_i$ may no longer be mutually exclusive. For example, roll 8 dice and let $A_i$ be the event that at least 4 of the dice show the face of $i$. Then the events $A_i$ are no longer mutually exclusive. To work this example, we need to use the multinomial theorem.

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

_________________________________________________________________

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

## An Example on Calculating Covariance

Probem 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 $Y \lvert X=x \sim \text{binom}(x,\frac{1}{4})$).

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$.

Probem 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 $Y \lvert X=x \sim \text{binom}(x,\frac{1}{2})$).

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.

_________________________________________________________
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$.

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

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

$\displaystyle (3) \ \ \ \ \ 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.

\displaystyle \begin{aligned}(4) \ \ \ \ \ 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:

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

$\displaystyle (6) \ \ \ \ \ 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)$.

\displaystyle \begin{aligned}(7) \ \ \ \ \ 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$.

\displaystyle \begin{aligned}(8) \ \ \ \ \ 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}

\displaystyle \begin{aligned}(9) \ \ \ \ \ 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}

\displaystyle \begin{aligned}(10) \ \ \ \ \ 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$:

$\displaystyle (11) \ \ \ \ \ 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:

$\displaystyle (12) \ \ \ \ \ 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:

$\displaystyle (13) \ \ \ \ \ 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.

$\displaystyle (14) \ \ \ \ \ \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

$\displaystyle (15) \ \ \ \ \ \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:

$\displaystyle (16) \ \ \ \ \ 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).

## An Example of a Joint Distribution

Probem 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 $Y \lvert X=x \sim \text{binom}(x,\frac{1}{4})$).

1. Discuss how the joint probability function $P[X=x,Y=y]$ is computed for $x=1,2,3,4,5,6$ and $y=0,1, \cdots, x$.
2. Compute the conditional binomial distributions $Y \lvert X=x$ where $x=1,2,3,4,5,6$.
3. Compute the marginal probability function of $Y$ and the mean and variance of $Y$.
4. Compute $P(X=x \lvert Y=y)$ for all applicable $x$ and $y$.

_____________________________________________________________
Discussion of Problem 1

Problem 2 is found at the end of the post.

Problem 1.1
This is an example of a joint distribution that is constructed from taking product of conditional distributions and a marginial distribution. The marginal distribution of $X$ is a uniform distribution on the set $\left\{1,2,3,4,5,6 \right\}$ (rolling a fiar die). Conditional of $X=x$, $Y$ has a binomial distribution $\text{binom}(x,\frac{1}{4})$. Think of the conditional variable of $Y \lvert X=x$ as tossing a coin $x$ times where the probability of a head is $p=\frac{1}{4}$. The following is the sample space of the joint distribution of $X$ and $Y$.

Figure 1

The joint probability function of $X$ and $Y$ may be written as:

$\displaystyle (1) \ \ \ \ \ P(X=x,Y=y)=P(Y=y \lvert X=x) \times P(X=x)$

Thus the probability at each point in Figure 1 is the product of $P(X=x)$, which is $\frac{1}{6}$, with the conditional probability $P(Y=y \lvert X=x)$, which is binomial. For example, the following diagram and equation demonstrate the calculation of $P(X=4,Y=3)$

Figure 2

\displaystyle \begin{aligned}(1a) \ \ \ \ \ P(X=4,Y=3)&=P(Y=3 \lvert X=4) \times P(X=4) \\&=\binom{4}{3} \biggl[\frac{1}{4}\biggr]^3 \biggl[\frac{3}{4}\biggr]^1 \times \frac{1}{6} \\&=\frac{12}{256} \end{aligned}

Problem 1.2
The following shows the calculation of the binomial distributions.

\displaystyle \begin{aligned} (2) \ \ \ Y \lvert X=1 \ \ \ \ \ &P(Y=0 \lvert X=1)=\frac{3}{4} \\&P(Y=1 \lvert X=1)=\frac{1}{4} \end{aligned}

\displaystyle \begin{aligned} (3) \ \ \ Y \lvert X=2 \ \ \ \ \ &P(Y=0 \lvert X=2)=\binom{2}{0} \biggl(\frac{1}{4}\biggr)^0 \biggl(\frac{3}{4}\biggr)^2=\frac{9}{16} \\&P(Y=1 \lvert X=2)=\binom{2}{1} \biggl(\frac{1}{4}\biggr)^1 \biggl(\frac{3}{4}\biggr)^1=\frac{6}{16} \\&P(Y=2 \lvert X=2)=\binom{2}{2} \biggl(\frac{1}{4}\biggr)^2 \biggl(\frac{3}{4}\biggr)^0=\frac{1}{16} \end{aligned}

\displaystyle \begin{aligned} (4) \ \ \ Y \lvert X=3 \ \ \ \ \ &P(Y=0 \lvert X=3)=\binom{3}{0} \biggl(\frac{1}{4}\biggr)^0 \biggl(\frac{3}{4}\biggr)^3=\frac{27}{64} \\&P(Y=1 \lvert X=3)=\binom{3}{1} \biggl(\frac{1}{4}\biggr)^1 \biggl(\frac{3}{4}\biggr)^2=\frac{27}{64} \\&P(Y=2 \lvert X=3)=\binom{3}{2} \biggl(\frac{1}{4}\biggr)^2 \biggl(\frac{3}{4}\biggr)^1=\frac{9}{64} \\&P(Y=3 \lvert X=3)=\binom{3}{3} \biggl(\frac{1}{4}\biggr)^3 \biggl(\frac{3}{4}\biggr)^0=\frac{1}{64} \end{aligned}

\displaystyle \begin{aligned} (5) \ \ \ Y \lvert X=4 \ \ \ \ \ &P(Y=0 \lvert X=4)=\binom{4}{0} \biggl(\frac{1}{4}\biggr)^0 \biggl(\frac{3}{4}\biggr)^4=\frac{81}{256} \\&P(Y=1 \lvert X=4)=\binom{4}{1} \biggl(\frac{1}{4}\biggr)^1 \biggl(\frac{3}{4}\biggr)^3=\frac{108}{256} \\&P(Y=2 \lvert X=4)=\binom{4}{2} \biggl(\frac{1}{4}\biggr)^2 \biggl(\frac{3}{4}\biggr)^2=\frac{54}{256} \\&P(Y=3 \lvert X=4)=\binom{4}{3} \biggl(\frac{1}{4}\biggr)^3 \biggl(\frac{3}{4}\biggr)^1=\frac{12}{256} \\&P(Y=4 \lvert X=4)=\binom{4}{4} \biggl(\frac{1}{4}\biggr)^4 \biggl(\frac{3}{4}\biggr)^0=\frac{1}{256} \end{aligned}

\displaystyle \begin{aligned} (6) \ \ \ Y \lvert X=5 \ \ \ \ \ &P(Y=0 \lvert X=5)=\binom{5}{0} \biggl(\frac{1}{4}\biggr)^0 \biggl(\frac{3}{4}\biggr)^5=\frac{243}{1024} \\&P(Y=1 \lvert X=5)=\binom{5}{1} \biggl(\frac{1}{4}\biggr)^1 \biggl(\frac{3}{4}\biggr)^4=\frac{405}{1024} \\&P(Y=2 \lvert X=5)=\binom{5}{2} \biggl(\frac{1}{4}\biggr)^2 \biggl(\frac{3}{4}\biggr)^3=\frac{270}{1024} \\&P(Y=3 \lvert X=5)=\binom{5}{3} \biggl(\frac{1}{4}\biggr)^3 \biggl(\frac{3}{4}\biggr)^2=\frac{90}{1024} \\&P(Y=4 \lvert X=5)=\binom{5}{4} \biggl(\frac{1}{4}\biggr)^4 \biggl(\frac{3}{4}\biggr)^1=\frac{15}{1024} \\&P(Y=5 \lvert X=5)=\binom{5}{5} \biggl(\frac{1}{4}\biggr)^5 \biggl(\frac{3}{4}\biggr)^0=\frac{1}{1024} \end{aligned}

\displaystyle \begin{aligned} (7) \ \ \ Y \lvert X=6 \ \ \ \ \ &P(Y=0 \lvert X=6)=\binom{6}{0} \biggl(\frac{1}{4}\biggr)^0 \biggl(\frac{3}{4}\biggr)^6=\frac{729}{4096} \\&P(Y=1 \lvert X=6)=\binom{6}{1} \biggl(\frac{1}{4}\biggr)^1 \biggl(\frac{3}{4}\biggr)^5=\frac{1458}{4096} \\&P(Y=2 \lvert X=6)=\binom{6}{2} \biggl(\frac{1}{4}\biggr)^2 \biggl(\frac{3}{4}\biggr)^4=\frac{1215}{4096} \\&P(Y=3 \lvert X=6)=\binom{6}{3} \biggl(\frac{1}{4}\biggr)^3 \biggl(\frac{3}{4}\biggr)^3=\frac{540}{4096} \\&P(Y=4 \lvert X=6)=\binom{6}{4} \biggl(\frac{1}{4}\biggr)^4 \biggl(\frac{3}{4}\biggr)^2=\frac{135}{4096} \\&P(Y=5 \lvert X=6)=\binom{6}{5} \biggl(\frac{1}{4}\biggr)^5 \biggl(\frac{3}{4}\biggr)^1=\frac{18}{4096} \\&P(Y=6 \lvert X=6)=\binom{6}{6} \biggl(\frac{1}{4}\biggr)^6 \biggl(\frac{3}{4}\biggr)^0=\frac{1}{4096} \end{aligned}

Problem 1.3
To find the marginal probability $P(Y=y)$, we need to sum $P(X=x,Y=y)$ over all $x$. For example, $P(Y=2)$ is the sum of $P(X=x,Y=2)$ for all $x=2,3,4,5,6$. See the following diagram

Figure 3

As indicated in $(1)$, each $P(X=x,Y=2)$ is the product of a conditional probability $P(Y=y \lvert X=x)$ and $P(X=x)=\frac{1}{6}$. Thus the probability indicated in Figure 3 can be translated as:

\displaystyle \begin{aligned}(8) \ \ \ \ \ P(Y=2)&=\sum \limits_{x=2}^6 P(Y=2 \lvert X=x) P(X=x) \end{aligned}

We now begin the calculation.

\displaystyle \begin{aligned}(9) \ \ \ \ \ P(Y=0)&=\sum \limits_{x=1}^6 P(Y=0 \lvert X=x) P(X=x) \\&=\frac{1}{6} \biggl[ \frac{3}{4}+\frac{9}{16}+\frac{27}{64} \\&+ \ \ \ \frac{81}{256}+\frac{243}{1024}+\frac{729}{4096} \biggr] \\&=\frac{10101}{24576} \end{aligned}

\displaystyle \begin{aligned}(10) \ \ \ \ \ P(Y=1)&=\sum \limits_{x=1}^6 P(Y=1 \lvert X=x) P(X=x) \\&=\frac{1}{6} \biggl[ \frac{1}{4}+\frac{6}{16}+\frac{27}{64} \\&+ \ \ \ \frac{108}{256}+\frac{405}{1024}+\frac{1458}{4096} \biggr] \\&=\frac{9094}{24576} \end{aligned}

\displaystyle \begin{aligned}(11) \ \ \ \ \ P(Y=2)&=\sum \limits_{x=2}^6 P(Y=2 \lvert X=x) P(X=x) \\&=\frac{1}{6} \biggl[ \frac{1}{16}+\frac{9}{64} \\&+ \ \ \ \frac{54}{256}+\frac{270}{1024}+\frac{1215}{4096} \biggr] \\&=\frac{3991}{24576} \end{aligned}

\displaystyle \begin{aligned}(12) \ \ \ \ \ P(Y=3)&=\sum \limits_{x=3}^6 P(Y=3 \lvert X=x) P(X=x) \\&=\frac{1}{6} \biggl[ \frac{1}{64} \\&+ \ \ \ \frac{12}{256}+\frac{90}{1024}+\frac{540}{4096} \biggr] \\&=\frac{1156}{24576} \end{aligned}

\displaystyle \begin{aligned}(13) \ \ \ \ \ P(Y=4)&=\sum \limits_{x=4}^6 P(Y=4 \lvert X=x) P(X=x) \\&=\frac{1}{6} \biggl[ \frac{1}{256}+\frac{15}{1024}+\frac{135}{4096} \biggr] \\&=\frac{211}{24576} \end{aligned}

\displaystyle \begin{aligned}(14) \ \ \ \ \ P(Y=5)&=\sum \limits_{x=5}^6 P(Y=5 \lvert X=x) P(X=x) \\&=\frac{1}{6} \biggl[ \frac{1}{1024}+\frac{18}{4096} \biggr] \\&=\frac{22}{24576} \end{aligned}

\displaystyle \begin{aligned}(15) \ \ \ \ \ P(Y=6)&=\sum \limits_{x=6}^6 P(Y=6 \lvert X=x) P(X=x) \\&=\frac{1}{6} \biggl[ \frac{1}{4096} \biggr] \\&=\frac{1}{24576} \end{aligned}

The following is the calculation of the mean and variance of $Y$.

\displaystyle \begin{aligned}(16) \ \ \ \ \ E(Y)&=\frac{10101}{24576} \times 0+\frac{9094}{24576} \times 1+\frac{3991}{24576} \times 2 \\&+ \ \ \ \ \frac{1156}{24576} \times 3+\frac{211}{24576} \times 4+\frac{22}{24576} \times 5 \\&+ \ \ \ \ \frac{1}{24576} \times 6 \\&=\frac{21504}{24576}\\&=0.875 \end{aligned}

\displaystyle \begin{aligned}(17) \ \ \ \ \ E(Y^2)&=\frac{10101}{24576} \times 0+\frac{9094}{24576} \times 1+\frac{3991}{24576} \times 2^2 \\&+ \ \ \ \ \frac{1156}{24576} \times 3^2+\frac{211}{24576} \times 4^2+\frac{22}{24576} \times 5^2 \\&+ \ \ \ \ \frac{1}{24576} \times 6^2 \\&=\frac{39424}{24576}\\&=\frac{77}{48} \end{aligned}

$\displaystyle (18) \ \ \ \ \ Var(Y)=\frac{77}{48}-0.875^2=\frac{161}{192}=0.8385$

Problem 1.4
The conditional probability $P(Y=y \lvert X=x)$ is easy to compute since it is a given that $Y$ is a binomial variable conditional on a value of $X$. Now we want to find the backward probability $P(X= x \lvert Y=y)$. Given the binomial observation is $Y=y$, what is the probability that the roll of the die is $X=x$? This is an application of the Bayes’ theorem. We can start by looking at Figure 3 once more.

Consider $P(X=x \lvert Y=2)$. In calculating this conditional probability, we only consider the 5 sample points encircled in Figure 3 and disregard all the other points. These 5 points become a new sample space if you will (this is the essence of conditional probability and conditional distribution). The sum of the joint probability $P(X=x,Y=y)$ for these 5 points is $P(Y=2)$, calculated in the previous step. The conditional probability $P(X=x \lvert Y=2)$ is simply the probability of one of these 5 points as a fraction of the total probability $P(Y=2)$. Thus we have:

\displaystyle \begin{aligned}(19) \ \ \ \ \ P(X=x \lvert Y=2)&=\frac{P(X=x,Y=2)}{P(Y=2)} \end{aligned}

We do not have to evaluate the components that go into $(19)$. As a practical matter, to find $P(X=x \lvert Y=2)$ is to take each of 5 probabilities shown in $(11)$ and evaluate it as a fraction of the total probability $P(Y=2)$. Thus we have:

Calculation of $\bold P \bold ( \bold X \bold = \bold x \bold \lvert \bold Y \bold = \bold 2 \bold )$
\displaystyle \begin{aligned}(20a) \ \ \ \ \ P(X=2 \lvert Y=2)&=\frac{\displaystyle \frac{1}{6} \times \frac{1}{16}}{\displaystyle \frac{3991}{24576}} =\frac{256}{3991} \end{aligned}

\displaystyle \begin{aligned}(20b) \ \ \ \ \ P(X=3 \lvert Y=2)&=\frac{\displaystyle \frac{1}{6} \times \frac{9}{64}}{\displaystyle \frac{3991}{24576}} =\frac{576}{3991} \end{aligned}

\displaystyle \begin{aligned}(20c) \ \ \ \ \ P(X=4 \lvert Y=2)&=\frac{\displaystyle \frac{1}{6} \times \frac{54}{256}}{\displaystyle \frac{3991}{24576}} =\frac{864}{3991} \end{aligned}

\displaystyle \begin{aligned}(20d) \ \ \ \ \ P(X=5 \lvert Y=2)&=\frac{\displaystyle \frac{1}{6} \times \frac{270}{1024}}{\displaystyle \frac{3991}{24576}} =\frac{1080}{3991} \end{aligned}

\displaystyle \begin{aligned}(20e) \ \ \ \ \ P(X=6 \lvert Y=2)&=\frac{\displaystyle \frac{1}{6} \times \frac{1215}{4096}}{\displaystyle \frac{3991}{24576}} =\frac{1215}{3991} \end{aligned}

Here’s the rest of the Bayes’ calculation:

Calculation of $\bold P \bold ( \bold X \bold = \bold x \bold \lvert \bold Y \bold = \bold 0 \bold )$
\displaystyle \begin{aligned}(21a) \ \ \ \ \ P(X=1 \lvert Y=0)&=\frac{\displaystyle \frac{1}{6} \times \frac{3}{4}}{\displaystyle \frac{10101}{24576}} =\frac{3072}{10101} \end{aligned}

\displaystyle \begin{aligned}(21b) \ \ \ \ \ P(X=2 \lvert Y=0)&=\frac{\displaystyle \frac{1}{6} \times \frac{9}{16}}{\displaystyle \frac{10101}{24576}} =\frac{2304}{10101} \end{aligned}

\displaystyle \begin{aligned}(21c) \ \ \ \ \ P(X=3 \lvert Y=0)&=\frac{\displaystyle \frac{1}{6} \times \frac{27}{64}}{\displaystyle \frac{10101}{24576}} =\frac{1728}{10101} \end{aligned}

\displaystyle \begin{aligned}(21d) \ \ \ \ \ P(X=4 \lvert Y=0)&=\frac{\displaystyle \frac{1}{6} \times \frac{81}{256}}{\displaystyle \frac{10101}{24576}} =\frac{1296}{10101} \end{aligned}

\displaystyle \begin{aligned}(21e) \ \ \ \ \ P(X=5 \lvert Y=0)&=\frac{\displaystyle \frac{1}{6} \times \frac{243}{1024}}{\displaystyle \frac{10101}{24576}} =\frac{972}{10101} \end{aligned}

\displaystyle \begin{aligned}(21f) \ \ \ \ \ P(X=6 \lvert Y=0)&=\frac{\displaystyle \frac{1}{6} \times \frac{729}{4096}}{\displaystyle \frac{10101}{24576}} =\frac{3729}{10101} \end{aligned}

Calculation of $\bold P \bold ( \bold X \bold = \bold x \bold \lvert \bold Y \bold = \bold 1 \bold )$
\displaystyle \begin{aligned}(22a) \ \ \ \ \ P(X=1 \lvert Y=1)&=\frac{\displaystyle \frac{1}{6} \times \frac{1}{4}}{\displaystyle \frac{9094}{24576}} =\frac{1024}{9094} \end{aligned}

\displaystyle \begin{aligned}(22b) \ \ \ \ \ P(X=2 \lvert Y=1)&=\frac{\displaystyle \frac{1}{6} \times \frac{6}{16}}{\displaystyle \frac{9094}{24576}} =\frac{1536}{9094} \end{aligned}

\displaystyle \begin{aligned}(22c) \ \ \ \ \ P(X=3 \lvert Y=1)&=\frac{\displaystyle \frac{1}{6} \times \frac{27}{64}}{\displaystyle \frac{9094}{24576}} =\frac{1728}{9094} \end{aligned}

\displaystyle \begin{aligned}(22d) \ \ \ \ \ P(X=4 \lvert Y=1)&=\frac{\displaystyle \frac{1}{6} \times \frac{108}{256}}{\displaystyle \frac{9094}{24576}} =\frac{1728}{9094} \end{aligned}

\displaystyle \begin{aligned}(22e) \ \ \ \ \ P(X=5 \lvert Y=1)&=\frac{\displaystyle \frac{1}{6} \times \frac{405}{1024}}{\displaystyle \frac{9094}{24576}} =\frac{1620}{9094} \end{aligned}

\displaystyle \begin{aligned}(22f) \ \ \ \ \ P(X=6 \lvert Y=1)&=\frac{\displaystyle \frac{1}{6} \times \frac{1458}{4096}}{\displaystyle \frac{9094}{24576}} =\frac{1458}{9094} \end{aligned}

Calculation of $\bold P \bold ( \bold X \bold = \bold x \bold \lvert \bold Y \bold = \bold 2 \bold )$ done earlier

Calculation of $\bold P \bold ( \bold X \bold = \bold x \bold \lvert \bold Y \bold = \bold 3 \bold )$
\displaystyle \begin{aligned}(23a) \ \ \ \ \ P(X=3 \lvert Y=3)&=\frac{\displaystyle \frac{1}{6} \times \frac{1}{64}}{\displaystyle \frac{1156}{24576}} =\frac{64}{1156} \end{aligned}

\displaystyle \begin{aligned}(23b) \ \ \ \ \ P(X=4 \lvert Y=3)&=\frac{\displaystyle \frac{1}{6} \times \frac{12}{256}}{\displaystyle \frac{1156}{24576}} =\frac{192}{1156} \end{aligned}

\displaystyle \begin{aligned}(23c) \ \ \ \ \ P(X=5 \lvert Y=3)&=\frac{\displaystyle \frac{1}{6} \times \frac{90}{1024}}{\displaystyle \frac{1156}{24576}} =\frac{360}{1156} \end{aligned}

\displaystyle \begin{aligned}(23d) \ \ \ \ \ P(X=6 \lvert Y=3)&=\frac{\displaystyle \frac{1}{6} \times \frac{540}{4096}}{\displaystyle \frac{1156}{24576}} =\frac{540}{1156} \end{aligned}

Calculation of $\bold P \bold ( \bold X \bold = \bold x \bold \lvert \bold Y \bold = \bold 4 \bold )$
\displaystyle \begin{aligned}(24a) \ \ \ \ \ P(X=4 \lvert Y=4)&=\frac{\displaystyle \frac{1}{6} \times \frac{1}{256}}{\displaystyle \frac{211}{24576}} =\frac{16}{211} \end{aligned}

\displaystyle \begin{aligned}(24b) \ \ \ \ \ P(X=5 \lvert Y=4)&=\frac{\displaystyle \frac{1}{6} \times \frac{15}{1024}}{\displaystyle \frac{211}{24576}} =\frac{60}{211} \end{aligned}

\displaystyle \begin{aligned}(24c) \ \ \ \ \ P(X=6 \lvert Y=4)&=\frac{\displaystyle \frac{1}{6} \times \frac{135}{4096}}{\displaystyle \frac{211}{24576}} =\frac{135}{211} \end{aligned}

Calculation of $\bold P \bold ( \bold X \bold = \bold x \bold \lvert \bold Y \bold = \bold 5 \bold )$
\displaystyle \begin{aligned}(25a) \ \ \ \ \ P(X=5 \lvert Y=5)&=\frac{\displaystyle \frac{1}{6} \times \frac{1}{1024}}{\displaystyle \frac{22}{24576}} =\frac{4}{22} \end{aligned}

\displaystyle \begin{aligned}(25b) \ \ \ \ \ P(X=6 \lvert Y=5)&=\frac{\displaystyle \frac{1}{6} \times \frac{18}{1024}}{\displaystyle \frac{22}{24576}} =\frac{18}{22} \end{aligned}

Calculation of $\bold P \bold ( \bold X \bold = \bold x \bold \lvert \bold Y \bold = \bold 6 \bold )$
\displaystyle \begin{aligned}(26) \ \ \ \ \ P(X=6 \lvert Y=6)&=\frac{\displaystyle \frac{1}{6} \times \frac{1}{4096}}{\displaystyle \frac{1}{24576}} =1 \end{aligned}

_____________________________________________________________
Probem 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 $Y \lvert X=x \sim \text{binom}(x,\frac{1}{2})$).

1. Discuss how the joint probability function $P[X=x,Y=y]$ is computed for $x=1,2,3,4,5,6$ and $y=0,1, \cdots, x$.
2. Compute the conditional binomial distributions $Y \lvert X=x$ where $x=1,2,3,4,5,6$.
3. Compute the marginal probability function of $Y$ and the mean and variance of $Y$.
4. Compute $P(X=x \lvert Y=y)$ for all applicable $x$ and $y$.

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

$\text{ }$

_____________________________________________________________

Problem 2.3

\displaystyle \begin{aligned} P(Y=y): \ \ \ \ &P(Y=0)=\frac{63}{384} \\&\text{ } \\&P(Y=1)=\frac{120}{384} \\&\text{ } \\&P(Y=2)=\frac{99}{384} \\&\text{ } \\&P(Y=3)=\frac{64}{384} \\&\text{ } \\&P(Y=4)=\frac{29}{384} \\&\text{ } \\&P(Y=5)=\frac{8}{384} \\&\text{ } \\&P(Y=6)=\frac{1}{384} \end{aligned}

$\displaystyle E(Y)=\frac{7}{4}=1.75$

$\displaystyle Var(Y)=\frac{77}{48}$

Problem 2.4

\displaystyle \begin{aligned} P(X=x \lvert Y=0): \ \ \ \ &P(X=1 \lvert Y=0)=\frac{32}{63} \\&\text{ } \\&P(X=2 \lvert Y=0)=\frac{16}{63} \\&\text{ } \\&P(X=3 \lvert Y=0)=\frac{8}{63} \\&\text{ } \\&P(X=4 \lvert Y=0)=\frac{4}{63} \\&\text{ } \\&P(X=5 \lvert Y=0)=\frac{2}{63} \\&\text{ } \\&P(X=6 \lvert Y=0)=\frac{1}{63} \end{aligned}

\displaystyle \begin{aligned} P(X=x \lvert Y=1): \ \ \ \ &P(X=1 \lvert Y=1)=\frac{32}{120} \\&\text{ } \\&P(X=2 \lvert Y=1)=\frac{32}{120} \\&\text{ } \\&P(X=3 \lvert Y=1)=\frac{24}{120} \\&\text{ } \\&P(X=4 \lvert Y=1)=\frac{16}{120} \\&\text{ } \\&P(X=5 \lvert Y=1)=\frac{10}{120} \\&\text{ } \\&P(X=6 \lvert Y=1)=\frac{6}{120} \end{aligned}

\displaystyle \begin{aligned} P(X=x \lvert Y=2): \ \ \ \ &P(X=2 \lvert Y=2)=\frac{16}{99} \\&\text{ } \\&P(X=3 \lvert Y=2)=\frac{24}{99} \\&\text{ } \\&P(X=4 \lvert Y=2)=\frac{24}{99} \\&\text{ } \\&P(X=5 \lvert Y=2)=\frac{20}{99} \\&\text{ } \\&P(X=6 \lvert Y=2)=\frac{15}{99} \end{aligned}

\displaystyle \begin{aligned} P(X=x \lvert Y=3): \ \ \ \ &P(X=3 \lvert Y=3)=\frac{8}{64} \\&\text{ } \\&P(X=4 \lvert Y=3)=\frac{16}{64} \\&\text{ } \\&P(X=5 \lvert Y=3)=\frac{20}{64} \\&\text{ } \\&P(X=6 \lvert Y=3)=\frac{20}{64} \end{aligned}

\displaystyle \begin{aligned} P(X=x \lvert Y=4): \ \ \ \ &P(X=4 \lvert Y=4)=\frac{4}{29} \\&\text{ } \\&P(X=5 \lvert Y=4)=\frac{10}{29} \\&\text{ } \\&P(X=6 \lvert Y=4)=\frac{15}{29} \end{aligned}

\displaystyle \begin{aligned} P(X=x \lvert Y=5): \ \ \ \ &P(X=5 \lvert Y=5)=\frac{2}{8} \\&\text{ } \\&P(X=6 \lvert Y=5)=\frac{6}{8} \end{aligned}

\displaystyle \begin{aligned} P(X=x \lvert Y=6): \ \ \ \ &P(X=6 \lvert Y=6)=1 \end{aligned}