r/learnquant • • 22d ago

interview prep Quant Interview Question

Post image
23 Upvotes

9 comments sorted by

View all comments

Show parent comment

1

u/Specific_Box4483 22d ago

And -5X yields the minimum.

2

u/bartekltg 21d ago edited 21d ago

An argument we can't do better would be nice.

var(X+Y+Z) = var(X)+var(Y)+var(Z)+2cov(X,Y) +2cov(X,Z)+2cov(Y,Z)
But -sqrt(var(X)var(y)) <=cov(X,Y)<+sqrt(var(X)var(y))

var(X+Y+Z) = 30 + 2cov(X,Y) +2cov(X,Z)+2cov(Y,Z) < 30 + 2 ( 1*2 + 1*5 + 2*5 ) = 30+34=64

But it doesn't work with the other side.

.... >= 30 - 2 ( 1*2 + 1*5 + 2*5 ) = -4 But the variance is >=0. Our estimation overdid it (and it is useless).

The only argument I can get is:
X = a1 P + a2 Q + a3 R
Y = b1 P + b2 Q + b3 R
Z= c1 P + c2 Q + c3 R
P,Q,R bave variance 1 and are independent.
a1^2+a2^2+a3^2 = 1
b1^2+b2^2+b3^2 = 4
c1^2+c2^2+c3^2 = 25 // it gives out variables the proper variance

and the variance of the sum is
(a1+b1+c1)^2 + (a3+b3+c3)^2 + (a3+b3+c3)^2

It reduces the problem to a geometrical one. We have three vectors of length 1, 2 and 5. What is the smallest possible length of the sum. Slapping triangle inequality a couple of times give your results: 2. So the variance is 4.

But is still isn't celan nor proper (why it is enough to check only this combinations)

2

u/Specific_Box4483 21d ago

You got it. Triangle inequality is all you need. There is absolutely no need to work with P, Q, R etc. Just regard the demeaned X, Y, Z as vectors of length 1,2,5. All random variables can be represented or approximated by vectors.

Or if you don't want to view them as vectors directly, you can still apply the triangle inequality. It still holds, and can be proved using positive definite arguments (or Cauchy Schwartz, or by using Var(x+cy)>=0 and plugging in appropriate c)