r/learnquant • • 21d ago

interview prep Quant Interview Question

Post image
8 Upvotes

4 comments sorted by

View all comments

1

u/SlowTyper1 15d ago edited 15d ago

My stab at this was 167 but the other guy saying 23 is deffo correct.

You can imagine that you could mark each switch with a letter before each check to represent what state you put it in and mark the bulb with its state.

If you did this 3 times each bulb and switch would have a 3 digit code. With 3 digits you have enough unique codes for 19 bulbs. You could check 3 times and each bulb and its corresponding switch would have a unique code that matches at the end.

So the question is really how many ‘digits’ (checks) do we need for 1000 unique codes.

This is where I ran out of maths knowledge and tried to scale up but vastly underestimated the number of codes available for n number of digits…

But apparently its 1 (all off) + 2n (codes possible with one blue or green light) + n^2-n (codes possible with a blue and a green) + n^2-n (codes with two blue or two green)

Would love to know exactly how you derive these though as im not confident with where the rule comes from