r/learnquant • • 2d ago

interview prep Quant Interview Question

Post image
16 Upvotes

8 comments sorted by

1

u/post_button_account 2d ago

80% is the straightforward answer.

I am guessing there is some trick here beyond that?

1

u/pmdboi 2d ago edited 2d ago

Yeah I get the same. To spell it out: Bob turns on the blue light if his number is between 1 and 5, and the red light if it's between 6 and 10. If Alice's number is in the opposite half then she knows the answer for certain; if it's in the same half and her number is in the bottom of that half (1-2 or 6-7) then she guesses that Bob's number is higher, otherwise (4-5 or 9-10) that Bob's number is lower. If Alice has 3 or 8, then she arbitrarily guesses lower.

This strategy fails only for the following 8 pairs:

    ALICE   BOB
    2       1
    3       4, 5
    4       5
    7       6
    8       5, 6
    9       10

So this strategy has a 72/90 = 4/5 = 80% probability of succeeding.

EDIT: I made an arithmetic error, 90 - 8 = 82 so this has an 82/90 ≈ 91% probability of succeeding.

1

u/pmdboi 2d ago

Possible sources of shenanigans:

  • Can Bob turn on both lights, or neither?
  • Can Alice time how long it takes Bob to switch the light on?

1

u/Bigkev8787 2d ago

Yeah surely there are 4 options

- no light

  • red light
  • blue light
  • both lights

1

u/55tumbl 2d ago

How do you get 72? 90-8?

1

u/pmdboi 2d ago

Ah you're right, I can't math, that actually yields 82/90 = 91%.

3

u/55tumbl 2d ago

"Bob can switch on either a red or a blue light" He can but doesn't have to, so there are 3 options.

Blue light: Bob has 1,2,3 => Alice guesses her number is larger unless she has 1 (incorrect if A2-B3)

No light: Bob has 4,5,6,7 => Alice guesses her number is smaller if she has 1-5, larger if 6-10 (incorrect if A5-B4 or A6-B7)

Red light: Bob has 8,9,10 => Alice guesses her number is smaller unless she has 10 (incorrect if A9-B8)

Probability of correct guess is 86/90 = 95.56%. Not sure why "maximum probability" is asked, since it's already under optimal play?? Or is it 100%?

1

u/Bigkev8787 2d ago

Just reread, saw that it says either red or blue, so lets assume it's not both. That gives 3 options for Bob to do, no light, red light or blue light. So divide the numbers into (1,2,3)(4,5,6,7)(8,9,10). Clearly it's only an issue for Alice if they have numbers in the same group, otherwise it's obvious what she has to do.

Within the 3 number groups, if Alice has any of the extremes (1,3,4,7,8,10) then she'll know what to do.

So then the only issue is if they're in the same group, and Alice has one of the middle numbers(2,5,6,9).

If Alice has either 2 or 9, she has a 1/2 chance of guessing correctly. To simplify, lets say she guesses low if she has the 2 (only wrong if Bob has the 1) and vice versa with the 9 (and 10).

Theres an obvious strategy if she has the 5 or 6, that would only be wrong if she has the 5 and Bob has the 4, and vice versa if she has the 6 and Bob has the 7.

Leaving us with only 4 outcomes out or 90 that lead to an error, or 95.56% accurate.