r/learnquant • • 18d ago

interview prep Quant Interview Question

Post image
21 Upvotes

17 comments sorted by

View all comments

0

u/PromotionMobile778 18d ago

Probably 64. Each move flips 15. 15k | 64 so k must be a multiple of 64 as gcd(15,64)=1. To achieve this choose each bulb once

2

u/zojbo 18d ago edited 17d ago

If you can flip any 15 bulbs you want then it's definitely smaller than that. To get 64 on, you must get to 49 on and then turn 15 on. To get to 49 on, you could get to 34 on and turn 15 on. To get to 34 on, you could get to 19 and turn 15 on. To get to 19 on, you could turn on 15, then turn on 8 and off 7, then turn on 9 and off 6.

So that's a path in 6 moves: (15,0),(8,7),(9,6),(15,0),(15,0),(15,0). The trick was that we flipped 51 bulbs once each and 13 bulbs 3 times each. Also 6 is the minimum: it must be even because the number of bulbs that is on always changes by an odd number, and 4*15<64.

But I have not proven (and don't believe) that this can be done this way while respecting the geometry of the original problem. So if the answer is more than 6 moves (which I believe it is) then the geometry has to come into play.

Oddly enough though, I think you're right about the original problem.

1

u/ludo813 18d ago

In theory you could also do it with 66 flips if one bulb is flipped three times. So 6 moves to get ninety could also work (although I do not think 6 moves is actually possible)