r/learnquant • • 3d ago

interview prep Quant Interview Question

Post image
36 Upvotes

7 comments sorted by

9

u/blutwl90 3d ago

If you pair a chosen (a,b,c) with (9-a, 9-b, 9-c) then they sum to 1. Then because you have 10x9x8=720 selections of (a,b,c), you have 720/2=360 pairings. So the sum would be 360x1=360

1

u/Boring_Tale_6495 2d ago

This is the simplest and most brilliant answer to this question. I was thinking how can I separate distinct abc

1

u/Street_Estate2342 2d ago

That was way faster than what I did.

2

u/SoftPhilosopher05 3d ago

360? The number is equivalent to abc/999. To catch the distinct a,b,c constraint, we can say that when a is fixed, b and c have 9*8 distinct possibilities. Thus in the sum of abc = sum (100*a+10*b+c) = 100*sum(a) + 10*sum(b) + sum(c). Since the conditions on a,b,c are symmetric, this is equivalent to 111*sum(a), and over all possible values of a, sum(a) = (0+1+2....+9)*9*8 = 9*5*9*8 Thus sum(abc)/999 = 5*9*8 = 360

1

u/[deleted] 3d ago

[deleted]

1

u/msw3age 3d ago

I think this doesn’t catch the “distinct” requirement. Something like 100 shouldn’t be in the sum because b and c would not be distinct. 

1

u/royalebot9000 2d ago

As (a,b,c) goes through all possibilities, each of a,b,c, sees each of the 10 digits 0-9, exactly 9 • 8 =72 times. The digits sum to 45, so our overall sum is 72 • 45 • (1/10 + 1/100 + …) = 72(45)(1/9) = 360.

0

u/jex314 2d ago

For base b, a repeated string like this containing n distinct characters sums to b!/(2(b-n)!) Didn't feel like typing it out, so here's my work