# Cambridge Admissions Exam Statistics 1999 My work:

Since $$f$$ is the pdf we must have $$\int_{0}^{1} Ax\,\mathrm dx=1 \implies A=2$$. Let $$Y$$ be the number of currants in my portion. We have $$Y\sim B(4,x)$$. For the expectation $$E(Y)=4x,$$ however I don't know how to continue. I had a thought of using the expectation for $$x$$ in this, however, I can't statistically justify it.

For the second part, we require $$P\left(X\geq\frac{1}{2}\mid Y=4\right)=\frac{P\left(X\geq\frac{1}{2},Y=4\right)}{P(Y=4)}.$$

I am completely stuck on how to approach this. I checked the student room for solutions but they seem to disagree with themselves and with other solutions on other websites. If anybody could help me in understanding this problem, and the technique required for it I would be really thankful.

## 4 Answers

I do not agree with the previous solution.

The conditional probability is a binomial

$$(Y|X=x)\sim B(4;x)$$

with $$E(Y|X=x)=4x$$ thus the expectation of Y is

$$E(Y)=E(E(Y|X))=E(4X)=4E(X)=4\cdot\frac{2}{3}=\frac{8}{3}$$

With standard reasoning the joint distribution of $$(X,Y)$$ is

$$f_{XY}(x,y)=f_X(x)f_{Y|X}(y|x)=2\binom{4}{y}x^{y+1}(1-x)^{4-y}$$

Integrating (easy, using Beta distribution) you get the marginal Y

$$f_Y(y)=\int_0^1 f(x,y)dx=\frac{y+1}{15}$$

where $$y=0,1,2,3,4,$$

you can check that $$E(Y)=\frac{8}{3}$$ as calculated before in a different way.

Now having $$f(x,y)$$ and $$f(y)$$ you can calculate the conditional probability they request. It results to me

$$P(X\geq 0.5|Y=4)=\frac{\int_{1/2}^{1}2x^5dx}{\frac{5}{15}}=\frac{63}{64}$$

• Hi, thank you for your answer. Could you elaborate on why $Y=E(Y|X)$? – Maths Wizzard Mar 1 at 20:24
• @MathsWizzard sorry, elaborate what? – tommik Mar 1 at 20:25
• in your answer you have $E(Y)=E(E(Y|X))$ suggesting $Y=E(Y|X)$. My question is where do you get this from? – Maths Wizzard Mar 1 at 20:28
• @MathsWizzard $E(Y)=E(E(Y|X))$ is a standard property of expectation that is well known and easy to prove. Look here en.wikipedia.org/wiki/Law_of_total_expectation – tommik Mar 1 at 20:30

I agree with @tommik.

Since $$E(X)=\int_0^12x^2dx=\tfrac23$$, the answer to (i) is $$\tfrac234=\tfrac83$$.

For (ii) let $$Y$$ denote the number of currants in the portion so $$Y|X=x\sim B(4,\,x)$$, and $$P(Y=4|X=x)=x^4$$. Since $$P(X\le\tfrac12)=\int_0^{1/2}2xdx=\tfrac14$$, the restriction $$X>\tfrac12$$ has PDF $$\tfrac83x$$. Hence$$P(X>\tfrac12|Y=4)=\frac{P(Y=4|X>\tfrac12)P(X>\tfrac12)}{P(Y=4)}=\frac{\int_{1/2}^1\tfrac34x^4\tfrac83xdx}{\int_0^12x^5dx}=\frac{[x^6]_{1/2}^1}{[x^6]_0^1}=\frac{63}{64}.$$This slow code agrees to within experimental error, finding $$632$$ of $$640$$ random cases with $$Y=4$$ satisfy $$X>\tfrac12$$.

• Hi, thank you for your answer. Could you elaborate on why you plugged in the expected value for $x$ in $4x$? Moreover, why would it be wrong to do $\int 4x dx$ as is this not the OR rule? – Maths Wizzard Mar 1 at 20:26
• @MathsWizard If I've understood your question, you ask why $Y|X=x\sim B(4,\,x)$ implies $E[Y]=4E[X]$. This follows from $E[Y|X=x]=4x$. Since $X$ has PDF $2x$, $\int_0^14xdx=E=2$ isn't salient. – J.G. Mar 1 at 20:29
• I think I understand now, we are taking a "weighted approach" when dealing with $x$ as the probability for one value is greater than for another; rather than multiplying by 1, you multiplied by $2x$ as that is its probability. Could you please further explain where the $\frac{3}{4}$ came from in the top integral? – Maths Wizzard Mar 1 at 21:07
• Also, why does $\int_{\frac{1}{2}}^{1}2x$ need equal $1$ as shouldn't the pdf for $x>\frac{1}{2}$ be just the portion for $x>\frac{1}{2}$ in $1>x>0$? Sorry for asking too many questions but I really want to make sure I am understanding this. – Maths Wizzard Mar 1 at 21:14
• @MathsWizard $\tfrac34$ is just the $P(X>\tfrac12)$ factor, absorbed into the numerator's integral. Conditional probabilities rescale to the allowed portion of $X$'s distribution, obtaining a newly normalized PF on the surviving support, in this case$[1/2,\,1]$. – J.G. Mar 1 at 21:54

Simulated version for ten million cakes, agreeing with Answers of @tommik (+1) and @J.G. (+1). This simulation should be adequate for three decimal places of accuracy.

The original proportion $$p \sim \mathsf{Beta}(2,1).$$ Notice that its mean is $$2/3.$$

set.seed(2021)
p = rbeta(10^7, 2, 1)
summary(p)
Min.   1st Qu.    Median      Mean   3rd Qu.      Max.
0.0000918 0.4999540 0.7072202 0.6667052 0.8659839 0.9999999


Then the number of currents in my portion is $$Y \sim \mathsf{Binom}(4, p),$$ averaging $$8/3.$$

 y = rbinom(10^7, 4, p)
mean(y)
 2.666702  # aprx 8/3
8/3
 2.666667


Finally, conditional on getting all four currents, the probability that my portion was more than half is consistent with $$63/64:$$

p.4 = p[y == 4]
mean(p.4 > .5)
 0.9843074  # aprx 63/64
63/64
 0.984375


The probability that a currant is in proportion x is x. Probability all 4 are in that portion is x^4. Integral of this is x^5/5.

So the integral with limits 0.5 to 1 is the probability of getting all 4 if the proportion is greater than 0.5 which is 1/5 - 1/160 = 31/160. The probability of getting all 4 no matter what proportion was taken is the same integral from 0 to 1 = 1/5. It's a conditional probability question (not using the Ax distribution). The answer is then 31/160 divided by 1/5 = 31/32.

• Thank you for your answer. Would you mind explaining the statistical reason because of which you intigrated $x^4$? Is it done because of the continiuity form of the OR rule where instead of summing the different values of $x$ we instead ingirate since $x$ is continious? – Maths Wizzard Mar 1 at 19:10
• Yes, if it were discrete in steps of 0.1 the chance of getting all 4, if the proportion was 0.6, would be a value, but the chance of getting all 4 if the proportion was 0.7 would be a bit higher and we would have to add them all, but it's replaced with an integral. It's a bit like doing the mean in a table where there's a sum of fx column, then divided by sum of f. To be honest, not completely sure if the Ax should be included before the integration, but on balance decided that it should be left out. Perhaps you can see what others think, but the answer is likely to be along those lines. – John Hunter Mar 1 at 19:19
• ...imagine a spinner giving numbers 0.1-0.9 spun at random for the proportion x. What's the prob of getting all 4 currants? Answer 0.1^4/9 +0.2^4/9... that's replaced with integral x^4 dx and the dx is like the 1/9. Still not sure whether it should include the Ax first so integrating 2x^5?? – John Hunter Mar 1 at 19:46
• I don't follow most of this. To start, why would your spinner give numbers 0.1-0.9? – BruceET Mar 1 at 21:37
• It's a way for MW to see why to integrate, starting with a discrete version. Then if smaller and smaller steps were used it can become an integral. Tommik and others are probably right, if we include the 2x weighting, we should integrate x^4*2x = 2x^5, between 0.5 and 1, divided by the same integral between 0 and 1. – John Hunter Mar 1 at 22:24