enter image description here

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.


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


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


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

  • $\begingroup$ Hi, thank you for your answer. Could you elaborate on why $Y=E(Y|X)$? $\endgroup$ – Maths Wizzard Mar 1 at 20:24
  • $\begingroup$ @MathsWizzard sorry, elaborate what? $\endgroup$ – tommik Mar 1 at 20:25
  • $\begingroup$ 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? $\endgroup$ – Maths Wizzard Mar 1 at 20:28
  • 1
    $\begingroup$ @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 $\endgroup$ – 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$.

  • $\begingroup$ 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? $\endgroup$ – Maths Wizzard Mar 1 at 20:26
  • $\begingroup$ @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]=2$ isn't salient. $\endgroup$ – J.G. Mar 1 at 20:29
  • $\begingroup$ 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? $\endgroup$ – Maths Wizzard Mar 1 at 21:07
  • $\begingroup$ 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. $\endgroup$ – Maths Wizzard Mar 1 at 21:14
  • $\begingroup$ @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]$. $\endgroup$ – 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.$

p = rbeta(10^7, 2, 1)
     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)
[1] 2.666702  # aprx 8/3
[1] 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)
[1] 0.9843074  # aprx 63/64
[1] 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.

  • $\begingroup$ 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? $\endgroup$ – Maths Wizzard Mar 1 at 19:10
  • $\begingroup$ 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. $\endgroup$ – John Hunter Mar 1 at 19:19
  • $\begingroup$ ...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?? $\endgroup$ – John Hunter Mar 1 at 19:46
  • $\begingroup$ I don't follow most of this. To start, why would your spinner give numbers 0.1-0.9? $\endgroup$ – BruceET Mar 1 at 21:37
  • $\begingroup$ 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. $\endgroup$ – John Hunter Mar 1 at 22:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.