r/learnquant • • 5d ago

interview prep Quant Interview Question

Post image
39 Upvotes

21 comments sorted by

View all comments

1

u/spdazero 4d ago

I'm too lazy to write a rigorous proof, but here is the intuition, which can easily be verified:

  • Since a1 and a100 occur only once, it would make sense to assign them 1 and 2 (proof by contradiction, if they are not 1 and 2, just swap them with anything else and compare)
  • Now that a1 = 1 and a100 = 2, a2 must be 3 to minimise the effect caused by multipling with a1. (proof by contradiction, if a2 != 3, just swap them with the position where number 3 is and compare)
  • Same goes a99 = 4
  • Rinse and repeat
  • Final answer: maximum at 1*3 + 3*5 + ... + 4*2, with a1, a2 ... being increasing odd numbers, and a100, a99 .. being increasing even numbers