Quote:
Originally Posted by heehaww
The answer is about 58.7175
For a 2-letter word it's about 38.7451
So I have reached the same result for the 2-letter word with a different method.
My logic is as follows:
Our goal is to find E(max(L1,L2)), the expected value of the maximum of the number of tries it takes for monkey to find the first and the second letters, denoted by L1 and L2, respectively.
Let p be the probability of monkey guessing the correct letter within E tries, E being the expected number of guesses that monkey makes until it finds the correct letter.
In case of a 26 letter alphabet, p = 1 - (25/26)^26 = 63.9% and E = 26.
For a two letter word, the probability of monkey...
- guessing both letters correctly within E tries is p^2 = 40.9%,
- guessing both letters correctly after more than E tries is (1 - p)^2 = 13.0%,
- guessing one of the letters within E tries and the other after more than E tries is 1 - p^2 - (1 - p)^2 = 2p - 2p^2 = 46.1%.
Let Ea, Eb and Ec be the respective expected number of tries under the conditions stated above.
- Ea = 15.51, calculated by the function Σ Σ max(x,y) * P(x) * P(y) / p^2 where 1 ≤ x & y ≤ 26, so the summation of a total of 26 * 26 = 676 combinations.
- Eb = E + E(max(L1, L2)), as both letters are not found within E tries and the expected number of tries it takes to guess both correctly is independent of the past tries.
- Ec = 2E since we know one of the letters is found within E tries and the other one is not; the expected number of tries after E past tries is still E.
I will use max instead of E(max(L1, L2)) for the sake of brevity:
- max = Ea * p^2 + Eb * (1 - p)^2 + Ec * (2p - 2p^2)
- max = Ea * p^2 + (E + max) * (1 - p)^2 + 2E * (2p - 2p^2)
- max - max * (1 - p)^2 = Ea * p^2 + E * (1 - p)^2 + 2E * (2p - 2p^2)
- max = (Ea * p^2 + E * (1 - p)^2 + 2E * (2p - 2p^2)) / (1 - (1 - p)^2)
- max = (15.51 * 40.9% + 26 * 13.0% + 52 * 46.1%) / (1 - 13.0%) = 38.74