Escolar Documentos
Profissional Documentos
Cultura Documentos
Depending on what assumptions we make, we get different answers for the average
number of guesses
Instead of using the numbers 1 to 30, I will use the numbers 1 to 4 to make it
easier to understand.
***Scenario 1***
We ask a friend to randomly select a number from 1 to 4.
They roll a 4 sided die to pick the number, so each number is equally likely to be
be picked by our friend.
i.e. The probability that 1 is picked is 1/4, the probability that 2 is picked is
1/4,
the probability that 3 is picked is 1/4, and the probability that 4 is picked is
1/4
We guess each number from 1 to 4, in order, until we find the number our friend
picked.
If instead of the numbers 1 to 4 our friend randomly picks the numbers from 1 to n:
-each choice will have a probability of 1/n of being selected
- If our friend picks 1 it takes 1 guess
- If our friend picks 2 it takes 2 guess
- If our friend picks 3 it takes 3 guess
...
- If our friend picks n-2 it takes n-2 guess
- If our friend picks n-1 it takes n-1 guess
- However, if our friend picks n it takes only n-1 guesses since after n-1 guesses
we know the number is n
e.g. if n = 4 then
Average_Guesses = ((n+2) * (n-1))/ 2n
Average_Guesses = ((4+2) * (4-1))/(2 * 4)
Average_Guesses = 18/8 = 2.25
e.g. if n = 30 then
Average_Guesses = ((n+2) * (n-1))/ 2n
Average_Guesses = ((30+2) * (30-1))/(2 * 30)
Average_Guesses = 928/60 ~ 15.467
***Scenario 2***
The same as Scenario 1, but now our friend tries to trick us once in a while by not
picking a number
When they don't pick a number we will guess: 1 then 2 then 3,...., then n-1, then n
This will take n guesses
When they do pick a number we will guess: 1 then 2 then 3,.... until we find the
number
Unlike Scenario 1, after we guess n-1, if we haven't found the number, we can't
assume that it must be n, because our friend might be trying to trick us by not
picking a number i.e. if they pick n, then it will require n guesses.
e.g. if n = 4 then
Average_Guesses = (n+1)/2 = 5/2 = 2.5
e.g. if n = 30 then
Average_Guesses = (n+1)/2 = 31/2 = 15.5
In either scenario, if n is large enough, then n/2 is a good approximation for the
average number of guesses