Expectation of the intersection of several guessing games

185 Views Asked by At

Say you have some unknown combination of $K$ different (independent) numbers you have to guess. Your goal is to guess this entire combination in order. Say K=16, you have to guess $k_1, ..., k_{16}$. Each number $k$ is limited to $N$ possible numbers (the cardinality of the set from which each number is chosen). Assume $N$ is the same for every $k$, i.e. all numbers are picked from identical sets. To be clear, since each of the sixteen numbers is picked independently, some of the secret numbers may be identical.

To guess each number $k$, if you assume all values are equally likely, you start with a list of the $N$ possible numbers, one of which is the correct number. You test and eliminate each at a time. For each of these $k \in K$, you already know the expectation of the number of guesses to be $E[p_k,\star] = \frac{N+1}{2}$ from the result in "Expected number of draws until the first good element is chosen". (the notation $p_k$ means that this is the position in list which you reach when guessing the correct number, denoted by $\star$).

Note that, a priori, you cannot verify that any of the $k$ numbers is correct, until you have the entire combination. However you may know the expectation of finding the correct value for each of $k$ numbers, since they are independent problems.

Now, if one expects to have to guess $\frac{N+1}{2}$ times for each $k$, the combinations of all these expected guesses for the total combination yields $E[p,\star] = {(\frac{N+1}{2})}^{16}$.

However, the same reasoning could also be applied to the combination of the independent numbers. So now, let's apply this formula to the entire combination, which is an equivalent problem.

If each independent number $k$ has $N$ possibilities, there are a total of $M = N^{16}$ possible combinations. If one has a list of all the possible $M$ combinations, one can expect to guess the correct combination of 16 numbers after $E[p,\star] = {(\frac{M+1}{2})}$.

However, trivially, ${(\frac{N+1}{2})}^{16} \neq {(\frac{N^{16}+1}{2})}$, and the error can grow quite big for bigger N.

Now say that the expectation for each $k$ is not $\frac{N+1}{2}$, it is instead some value that I approximated experimentally - perhaps I have some algorithm that makes it so I do not need $\frac{N+1}{2}$ guesses, but actually less because the process isn't as random as it claimed. This algorithm may have different expectations for each $k$, since it may not perform as well guessing some of the numbers.

How could I derive, generally, the expectation of the whole combination from the expectation of the parts, when only the whole combination can be verified?

Update: I realized I could not possibly define the expected position of the complete combination without defining a strategy. So, say that the strategy is: start by testing the combination of the best guess for each $k$, then if that is unsuccessful, test all the guesses for the $k$ with the highest expectation $E[p_k,\star]$, since that is the one with most uncertainty, and then proceed by testing all the remaining $k$ in decreasing order of expectation.

2

There are 2 best solutions below

10
On BEST ANSWER

I don't think that it is possible to derive the expectation of the whole only from the parts. The expectations of the parts don't contain enough information about the probability distribution. Here is a counter-example:

Suppose you have to guess 2 numbers, each picked from the set $\{1, 2, 3\}$. The first one is picked with probabilities $(0.4, 0.4, 0.2)$, while the second one is picked with probabilities $(0.6, 0.2, 0.2)$. Independently, the expectations will be $1.8$ for the first and $1.6$ for the second. If you write out all the probabilities for the 9 possible combinations, and guess them in decreasing order (which is the best strategy), you'll get an expectation of $3.52$.

Now change the distribution on the second number to $(0.5, 0.4, 0.1)$. Independently, the expectation for that is the same as before, $1.6$. But as a combination with the first number (with the same strategy as before), I now get an expectation of $3.48$.

So the overall expectation is not a function of only the expectations of the parts.

Of course, my example uses a different strategy from the one you prescribed in the update to your question. When I thought more about it, I found that your strategy does give a way to "combine" the expectations (but as a strategy, it is sub-optimal). The formula I got is (assuming the expectations are ordered from highest to lowest) $$E[p, \star] = 1 + \sum_{i = 1}^{K}N^{i-1}(E[p_i,\star] - 1)$$ I think the easiest way to prove it is by induction on $K$. With my examples above, it gives $3.6$, which is not much worse than what the optimal strategies produce.

3
On

The expected number of guesses with the first method is by far lower than the one you got. This is because you have to sum - not multiply - the expected values of the number of guessings for the individual numbers. Then from linearity of expectations we have $$E[p, \: \star] = \sum_{k = 1}^{16} E[p_k, \: \star] = 16\left(\frac{N + 1}{2}\right) = 8(N + 1)$$

For the second method the expectation you found is correct.

So the two expectations do differ, and the first one is actually much much less than the second one (the former grows linearly with $N$, the latter is a polynomial of degree $16$).

Why? Because guessing one number at a time gradually gives you some information about the combination (e.g. after having guessed the first number you know for sure that the combination isn't among the ones that don't start with a different number, so that you won't even try to guess those ones), which doesn't happen when you blindly try to guess the whole sequence.