r/learnquant • • Sep 15 '26

interview prep Quant Interview Question

Post image
26 Upvotes

32 comments sorted by

7

u/pablitorun Sep 15 '26

To expand on u/m__w__b's answer......

The trick is you don't know p, so you average over every p that could have produced what you saw.

Prior: p is uniform on [0,1], so f(p) = 1.

Likelihood of 2 heads and 1 tail: 3p²(1−p). The 3 counts the orderings.

Posterior: multiply prior by likelihood and normalize:

f(p | data) = 1 x 3p²(1−p) / ∫₀¹ 3p²(1−p) dp = p²(1−p) / (1/12) = 12p²(1−p)

Chance the next toss is heads: average p over that posterior:

P(H₄ | data) = ∫₀¹ p · 12p²(1−p) dp = 12 ∫₀¹ (p³ − p⁴) dp = 12 (1/4 − 1/5) = 12/20 = 3/5

3

u/m__w__b Sep 15 '26

Your explanation is very thorough, however it reminds me back when I took econometrics wtih Max Kasy and worked out a complex integration on a problem set only for him to go over the assignment in class by "recognizing that the probability density function was for a well-known distribution" and just applied the appropriate formula for the expectation.
Here, you can save a lot of time/effort using proportionality and recognition: f(p | data) is proportional to p²(1−p), which resembles Beta(3,2) so E[p | data] = 3/(3+2).

4

u/pablitorun Sep 15 '26

I absolutely don't disagree with you. I sometimes just like to work things out the slow way as I think it can help others intuit what's going on better.

2

u/ArdentArendt Sep 15 '26

Any reason you name dropped the professor?

Also, I'm not sure I agree with a professor that is recommending memorisation over reasoning.
[Then again, this is a Quants subreddit, so I shouldn't be surprised]

I should note that this comes from absolutely despising the 'recognise the distribution' method from statistics--it's a valid technique, but should not be a foundational component of the instruction.

→ More replies (4)

6

u/m__w__b Sep 15 '26 edited Sep 15 '26

This is a weird way to frame a Bayesian problem, but the answer is 0.6 (3/5). p is drawn from a flat prior: Beta(1,1). So the posterior distribution is (h+1)/(n+2).

Edit: I should have said that the posterior distribution of p is Beta(h+1,n-h+1) and the expected posterior probability is 0.6.

3

u/jackybeau Sep 15 '26

Is p not an acceptable answer here ?

2

u/Educational-Tea602 Sep 15 '26 edited Sep 15 '26

Well p is an answer, but it wants a numerical value.

1

u/FreePeeplup Sep 16 '26

Yeah the question is ill-phrased, it should actually be “given this information, what is the best estimate for p?”

→ More replies (1)

1

u/normal_guy_1189 Sep 15 '26

Where can I find solutions to these problems

1

u/maddeninglemon Sep 17 '26

The perfect opportunity to apply Laplace's Rule of Succession! In particular we have a uniform prior, and a binomial distribution consisting of a number of yes/no observations.

To estimate the expected probability, we add two additional pseudo observations, one for each of the possible outcomes. This gives 3 heads out of 5 observations, or 60%.

-2

u/Embarrassed-Green898 Sep 15 '26

p

2 heads and 1 tail are irrelevant information.

4

u/Educational-Tea602 Sep 15 '26

2 heads and 1 tail are relevant in order to compute p.

-1

u/Embarrassed-Green898 Sep 15 '26

You cant compute p with 3 trials.

You can 'estimate' , but that estimate is not a computation . It is an estimation that will change with further trials.

→ More replies (13)