last day (15 days later) » 

16:32
19
Q: Game Theory / Probability Interview question

beginnerGot this for an interview and didn't get it. How to solve? You and your opponent have a uniform random sampler from 0 to 1. We both sample from our own machines. Whoever has the higher number wins. The catch is when you see your number, you can resample. The opponent can re sample once but you ca...

Is it the case that player $X$ can sample from the $[0,1]$ machine up to three times, but is stuck with their last choice, or does player $X$ always sample three times and then chooses the largest? Same question for player $Y$.
@IanMcCall You are stuck with the last one
I was thinking each player comes up with a strategy. So for my second opponent, since the EV of the second number is .5, if the first number is below .5, then re-sample. Same idea for myself. And then we find the probability of who wins conditioned on the each of the possible last "rolls" for each person, of which there are 6
It might be helpful to think of several cases. I think the simplest nontrivial case is that where the first player has two samples and the second player has one sample. It might also be useful to think about what happens in the extreme case: the first player has 100 samples and the second player has one sample.
@IanMcCall Is my strategy idea a good idea?
I think it's a good start, but I don't think it generalizes. If player 1 has 100 samples, then they should definitely not settle for anything greater than $1/2$. I am still not sure what they should expect, but closer to $0.95$ or greater.
I think you're going to need to use some Bayesian reasoning. Because, the probability that either player samples depends on what samples they got before. The different samples are not independently distributed.
16:32
@IanMcCall indeed. One could compute what the expected highest roll from a budget of n total rolls should be. But just saying that I reroll until i get a value above that or close to that is arguably not the optimal strategy. As a silly example, if your first $k$ rolls are all $0$, one would need to redo the computations for a budget of $n-k$ rolls.
@AnCar Good point. If a player has $n$ total rolls, then there is a $50\%$ chance that the max of those rolls is in $[1 - 2^n,1]$. If this is true, it may provide a recursive way to answer the original question. A simple strategy (that is probably not optimal) would be to roll until you get a sample within $[1 - 2^n,1]$. If you don't achieve this within $n$ rolls, then you are simply left with your last choice.
One more thing. Suppose a player has $n$ rolls. On their first role, they either roll in the top $1/2^n$ or not. If they do, stop rolling. If not, on their second role, they either roll in the top $1/2^{n - 1}$ or not. If they do, stop rolling. If it is their $i$th role, they either roll in the top $1/2^{n - (i - 1)}$ or not. If they do, stop rolling. This gives a probability of $1/2^n$ that their final role is in $[0,1/2]$.
@IanMcCall Doesn't my idea take into account the 100 sample case? I wrote it out in detail above as an edit to my original post
Yes, but you write "if above 1/2, do not resample. and you do this for the first sample with a slightly higher threshold" which I agree with but what that "slightly higher threshold" is is precisely what makes this problem difficult.
First, maximize expected roll. With no re-sample, expectation is $\frac 12$. So, with one re-sample, hold on that. Then expectation is $\frac 12\times \frac 34+\frac 12\times \frac 12=\frac 58$. So with two re-samples, initially hold on that, making expectation $\frac 38\times \frac {13}{16} +\frac 58\times \frac 58=\frac {89}{128}$. That gives you a clear cut strategy to analyze.
The issue I see is that your opponent sees your expected strategy, so may be smarter to play a bit more aggressively. That is to say, on his own, that player should stand on an initial $\frac 12$ but as they see that you expect significantly more, they may be forced to raise their threshold. But the first thing to analyze is the "maximize the expected score" strategy.
To illustrate my point: suppose player $1$ had $1000$ re-sample options. In that case, player $2$ "knows" that player $1$ is going to end up with a score around $.99$ or better, so holding on $.51$ is a waste of time. Player $2$ is practically sure to lose no matter what, but they'd at least be better off praying for a lucky final toss.
Well, I guess my previous comments amounts to saying that andy 's answer is correct, and both AnCar and Ian McCall 's answers describe suboptimal strategies because their players are only attempting to maximise their own expectations, rather than maximising their probability of winning.
16:32
I'm finding the flip-flopping between first and second person in the problem statement to be confusing. "You and your opponent" but "We both sample" and then "you can resample twice" and "What’s the probability I win?" Are "you" and "I" the same person, or is one of those the opponent?
Maybe call them Alice and Bob throughout and ditch the pronouns.
This is just an intuition which I'm struggling to put into rigorous detail, but I suspect your "under 0.5 means reroll" approach is different when you know that you can reroll your potential reroll; i.e. when you first sample, your decision to resample a second time is different because you know that you can always reroll a bad second roll.
I suppose the hidden assumption is that both you and the opponent use the optimal strategies for resampling. Also, do you see the opponent number before the end of the game?

last day (15 days later) »