MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnquant/comments/1y7vvhx/quant_interview_question/19tc7fm1lv0xu/
r/learnquant • u/Local_Ad135 • 7d ago
21 comments sorted by
View all comments
2
100 * 99 + 98 * 97 + ...
= Sum [n=1 to 50] {2n(2n-1)}
= 4 * Sum { n2 } - 2 * Sum { n }
= 4/6n(n+1)(2n+1) - n(n+1)
n=50:
= 4/6 * 50 * 51 * 101 - 50 * 51 = 169150
2 u/Competitive_Try_330 7d ago It's 100 * 99 + 99 * 98 + 98 * 97 + 97 * 96+... 1 u/notsaneatall_ 7d ago 99 X 100+98 X 100+98 X 97+... has a higher sum. I don't think what you wrote is the highest 2 u/Competitive_Try_330 6d ago Sorry, I made it a bit unclear. I did not try to provide an optimal solution. I just wanted to state that each number appears twice in the sum. Have not thought about the optimal solution too much yet 1 u/Icy-Landscape-4796 6d ago what you've written is much closer but not quite optimal. 1 u/notsaneatall_ 6d ago I never said what I wrote was optimal, I was pretty sure it wasn't.I suspect the optimal sequence is something like 2,4,6...100,99,97,95,93...1 or something like that 0 u/jsundqui 7d ago I know that's what I calculated 2 u/Icy-Landscape-4796 6d ago no? you've missed out that each number is in two products (except a1 and a100) 1 u/jsundqui 6d ago Oh, thanks my bad.
It's 100 * 99 + 99 * 98 + 98 * 97 + 97 * 96+...
1 u/notsaneatall_ 7d ago 99 X 100+98 X 100+98 X 97+... has a higher sum. I don't think what you wrote is the highest 2 u/Competitive_Try_330 6d ago Sorry, I made it a bit unclear. I did not try to provide an optimal solution. I just wanted to state that each number appears twice in the sum. Have not thought about the optimal solution too much yet 1 u/Icy-Landscape-4796 6d ago what you've written is much closer but not quite optimal. 1 u/notsaneatall_ 6d ago I never said what I wrote was optimal, I was pretty sure it wasn't.I suspect the optimal sequence is something like 2,4,6...100,99,97,95,93...1 or something like that 0 u/jsundqui 7d ago I know that's what I calculated 2 u/Icy-Landscape-4796 6d ago no? you've missed out that each number is in two products (except a1 and a100) 1 u/jsundqui 6d ago Oh, thanks my bad.
1
99 X 100+98 X 100+98 X 97+... has a higher sum. I don't think what you wrote is the highest
2 u/Competitive_Try_330 6d ago Sorry, I made it a bit unclear. I did not try to provide an optimal solution. I just wanted to state that each number appears twice in the sum. Have not thought about the optimal solution too much yet 1 u/Icy-Landscape-4796 6d ago what you've written is much closer but not quite optimal. 1 u/notsaneatall_ 6d ago I never said what I wrote was optimal, I was pretty sure it wasn't.I suspect the optimal sequence is something like 2,4,6...100,99,97,95,93...1 or something like that
Sorry, I made it a bit unclear. I did not try to provide an optimal solution. I just wanted to state that each number appears twice in the sum. Have not thought about the optimal solution too much yet
what you've written is much closer but not quite optimal.
1 u/notsaneatall_ 6d ago I never said what I wrote was optimal, I was pretty sure it wasn't.I suspect the optimal sequence is something like 2,4,6...100,99,97,95,93...1 or something like that
I never said what I wrote was optimal, I was pretty sure it wasn't.
I suspect the optimal sequence is something like 2,4,6...100,99,97,95,93...1 or something like that
0
I know that's what I calculated
2 u/Icy-Landscape-4796 6d ago no? you've missed out that each number is in two products (except a1 and a100) 1 u/jsundqui 6d ago Oh, thanks my bad.
no? you've missed out that each number is in two products (except a1 and a100)
1 u/jsundqui 6d ago Oh, thanks my bad.
Oh, thanks my bad.
View all comments
2
u/jsundqui 7d ago edited 7d ago
100 * 99 + 98 * 97 + ...
= Sum [n=1 to 50] {2n(2n-1)}
= 4 * Sum { n2 } - 2 * Sum { n }
= 4/6n(n+1)(2n+1) - n(n+1)
n=50:
= 4/6 * 50 * 51 * 101 - 50 * 51 = 169150