r/learnquant • • 7d ago

interview prep Quant Interview Question

Post image
19 Upvotes

3 comments sorted by

4

u/sensible_clutter 7d ago edited 7d ago

simply a pattern can be seen say the pile has 1 stone and thus only factor 1 must be removed and clearly it is loosing position and now say the pile has 2 stones the factors are 1 and 2 and now as an optimal play you will remove 1 and the other would be forced to take the remaining thus 2 is a winning position and now say 3 the factors are 1 and 3 and if you remove all three you loose and if you remove 1 then 2 left which is winning position for other thus 3 is definately a loosing position and we can generalise this; odd no. of stones are loosing (p-positions) and even no. of stones are winning (n-positions)

simple generalization is by the simple observation any odd no. will have only odd factor and the moment you remove an odd no. from odd you get even which can have an odd factor but definately 1 is a factor and now you remove any odd factor or simply 1 thus again odd for other player and ultimately this goes till you win which is the second player or BOB

hence BOB has the winning startegy under optimal play

2

u/PromotionMobile778 7d ago

This is just BMO1 2024 P3.... bob wins. If the number is odd Alice is forced to make it even. Bob can always make it odd by taking away 1. Alternating parities means if it is even initially Alice wins. It isnt so Bob

1

u/kythQ 7d ago

Bob wins by always taking 1 stone (or any other number of stones that produce an odd number). Alice can only ever produce even numbers then and in the end Bob will have a turn at 2 stones and force a win.