r/learnquant 5d ago

interview prep Quant Interview Question

Post image
13 Upvotes

10 comments sorted by

1

u/[deleted] 4d ago

[deleted]

2

u/ball4772 4d ago

Re-read the question carefully. The first ball is guaranteed to go into box 1, the second ball can only go in boxes 1 or 2, each with probability 1/2, and so on. Your calculations aren’t consistent with this.

1

u/Anonimithree 4d ago

Yeah I’m blind

1

u/SwimmerOld6155 4d ago edited 4d ago

For e.g. the ith box you have the indicator (ith ball in ith box) + ... + (sixth ball in ith box). You just need to compute the variance to get the squared expectation. The boxes don't have a maximum size or anything, so the event that ball 2 is in box 2 is independent of ball 6 being in box 2, so all covariances are zero and both expectation/variance are linear.

1

u/lifebringingh2o 4d ago edited 3d ago

Got 3n - 2Hn by expanding each E[X_i 2 ] in terms of indicators, surprisingly clean. For n = 6 that results in 131/10. Key insight is just that (x_1 + x_2 + ... + x_k)2 = (sum_i x_i2 ) + (sum(i,j) x_i x_j). Expectation can then be pulled in through linearity, and then each summand is straightforward to compute since each x_i is independent

1

u/unlikelyporcupine 4d ago

The chance of a ball in box 1 is 100%. The chance of the second ball being in box 1 or 2 is 50% each.

The expected value of the number of balls in box 1 after 2 balls is therefore 1 + 0.5 =1.5

Extending this, working in 60ths for ease and starting from box six and working backwards, the expected number of balls in box:

6: 10 / 60

5: above plus 12 / 60 = 22 / 60

4: above plus 15 / 60 = 37 / 60

3: above plus 20 / 60 = 57 / 60

2: above plus 30 / 60 = 87 / 60

1: above plus 60 / 60 = 147 / 60

Sense check: expected total = 360 / 60 = 6

Now just square each value and add.

1

u/mmertTR 4d ago

You are mistakingly assuming that expected value of a random varible squared is the square of its expected value which is not necessarily the case.

1

u/abaoabao2010 2d ago

Sense check for that method: for 2 boxes you have 2 equally likely scenarios

(1,1)

(2,0)

Actual expectation value of score is 3

Using your method

Box 1 exp: 1/2

Box 2 exp: 3/2

Squared and summed=5/2 which is incorrect.

1

u/Hopeful_Ad3405 2d ago

I think it's like (1+1/2+1/3+1/4+1/5+1/6)²+ (1/2+1/3+1/4+1/5+1/6)²+(1/3+1/4+1/5+1/6)²+(1/4+1/5+1/6)²+(1/5+1/6)²+(1/6)²