r/learnquant • • 3d ago

interview prep Quant Interview Question

Post image
24 Upvotes

5 comments sorted by

5

u/EventHorizon150 3d ago edited 3d ago

I will first show that the best alice can hope to do is force bob into a score of 16.

The sum of the values of all 2x2 squares is
S = k + 2e + 4c
where k is the sum of the values in the corners of the 3x3, e is the sum of the values on the edge squares, and c is the value in the middle of the 3x3. The average is then S/4 = k/4 + e/2 + c. If we imagine we just want to minimize this average, we set c = 1, e = 2+3+4+5, k = 6+7+8+9. Then S/4 = 15.5. Thus, the smallest average 2x2 we can get is 15.5, so we must have some square for bob to choose which is 16 or more in sum.

The 3x3 below forces bob into this minimal score

6 5 7
4 1 3
8 2 9

1

u/Andradessssss 3d ago

The middle you get for free, so Alice has to place 1 in the middle, then choosing the 2×2 randomly shows that you can always do at least 15.5, and so you can always do at least 16. Then the following arrangement shows that 16 is attainable:

856

214

937

1

u/Anonimithree 2d ago

This one’s actually pretty easy, since all you do is pot the big numbers in the corners, 1 in the center, and then the sms numbers to minimize the greatest possible score

1

u/A_BagerWhatsMore 2d ago

Okay so like the four 2x2 squares hit the middle 4 times and the mid edges twice so we have the sum of those 4 is at minimum 45+3+(2+3+4+5)=62 so by PHP Alice can’t beat 16. Let’s see if we can do that.

9 2 8

4 1 5

7 3 6

Yup it’s 16.

1

u/jaminfine 2d ago

It seems most reasonable to put 1 in the middle since part of Bob's square must include the middle.

After that, we should put 2, 3, 4 and 5 in the remaining non-corners. Bob must take at least two of these. We should put 4 across from 5 so Bob can't get both of the higher ones.

Finally, the highest numbers 6,7,8,9 should be placed such that the sums of the 2x2 squares are as close to equal as possible. So the 9 goes between 2 and 4, the 8 goes between 3 and 4, the 7 between 2 and 5, and the 6 between 3 and 5.

We now see that Bob can only get to 16 max.

1

u/aroach1995 3d ago

1 of course goes in the middle so each 2x2 is using the smallest number. 6,7,8,9 go in the corners.

So it looks like this:

6_7
_1_
8_9

Let 8 and 9 share the 2, since they are the biggest, keep them small. Let 7 and 9 share the 3, 6 and 8 share the 4, 6 and 7 share the 5.

So you have:

657
413
829

Bob will pick as high as he can here and get 16.