Question

In: Statistics and Probability

Two persons (A & B) play guess the number game. First person choses an integer in...

Two persons (A & B) play guess the number game. First person choses an integer in the
range [1,10] and second person has to guess it by asking questions that the first person can only
answer in yes or no.
a) Person B asks questions in the sequence, “is it x?” where x=1, 2, …, 10 e.g. first question would
be, is it number 1. If no, 2nd question would be, is it number 2, etc. Find the expected number
of questions person B asks to guess the number.
b) Person A asks questions such that to eliminate half of possibilities. For example, is the number
greater than 5, if no, 2nd question: is the number greater than 2 etc. Find the expected number
of questions person A asks to guess the number.

Solutions

Expert Solution

a) Probability that B gets it right first time is 1/10, and he asked 1 question

Probability that B gets it right second time with 9 numbers remaining is 1/9, and he asked 2 questions. But B should have failed in the first question, so we need to multiply by 9/10. Thus overall, probability that he needs to ask the second question is still 1/10. That is,

In short, the probability that B gets it right on each of the 10 questions is the same, 1/10.

Hence, expected no of questions asked,

Note that we do not add the 10th question, because B won't ask this question. In 9th question itself, he would know the answer

b) In terms of total questions asked, A has only two choices

First of all, note that the data (number of questions) is not symmetric w.r.t. the division of subparts into equal halves.

Note that in this strategy, A cannot get a definite answer in the first, and not even in the second question, because his strategy is to divide the range and not hit the number directly. For ex, say B responds "No" to first Q is it greater than 5? Then A knows numbers are 1 to 5. So he asks "Is to greater than 2" , and again B will either say Ye or No. In either case, A can never have the answer to what is the number, he only has possibilities.

Now we need to do some critical analysis. After A has asked the second question, note that there are two numbers on one side (ex. 1, 2, call this Group1) and 3 numbers on the other side (ex. 3, 4, 5, call this Group2). The probability that we land up to choose from Group1 is 2/5 (because there were 5 numbers in the lot initially) and the probability that we land up in Group2 is 3/5.

If we have Group1, then we only need to ask one more question: our third question, and we are done for sure. That is, A asks "Is it 1?" - answer could be yes: number is 1, or answer is No: number is 2.

If we have Group2, we may need to ask either 1 or 2 more questions, depending on our luck. Note that we are left with 3, 4, 5. A would ask "Is it greater than 4", if answer is Yes (for which the probability is 1/3) we are done after having asked 3 questions. But if answer is No (for which the probability is 2/3) we have both 3, 4 remaining and A shall ask the final 4th question.

So A will need to ask just 3 questions if either he was in Group1, or if he was in Group2 and the answer to the question was Yes

But A will need to ask 4 questions if he was in Group2, and answer to the question was No

Thus, the expected number of questions that A asks are


Related Solutions

Write a program with at least 2 functions that play the game of “guess the number”...
Write a program with at least 2 functions that play the game of “guess the number” as follows: Your program chooses the number to be guessed by selecting an integer at random in the range 1 to 1000. The program then displays the following: I have a number between 1 and 1000. Can you guess my number? Please type in your first guess. The player then types the first guess. The program then responds with one of the following: 1.      ...
PYTHON Exercise 5. Guess the number 1. Develop a “Guess the number” game. Write a program...
PYTHON Exercise 5. Guess the number 1. Develop a “Guess the number” game. Write a program that comes up with a random number and the player has to guess it. The program output can be like this: I am thinking of a number between 1 and 20. Take a guess. 10 Your guess is too low. Take a guess. 15 Your guess is too low. Take a guess. 17 Your guess is too high. Take a guess. 16 Good job!...
Number guessing Game (20 Marks) Write a C program that implements the “guess my number” game....
Number guessing Game Write a C program that implements the “guess my number” game. The computer chooses a random number using the following random generator function srand(time(NULL)); int r = rand() % 100 + 1; that creates a random number between 1 and 100 and puts it in the variable r. (Note that you have to include <time.h>) Then it asks the user to make a guess. Each time the user makes a guess, the program tells the user if...
In the game where A, B and C play together with dice. A rolls first., then...
In the game where A, B and C play together with dice. A rolls first., then B, then C and again A, B,... What is the probability that A is the first person that flips 6 first? A. 0.4727 B. 0.2379 C. 0.3956 D. 0.5
A and B play the following game: A writes down either number 1 or number 2,...
A and B play the following game: A writes down either number 1 or number 2, and B must guess which one. If the number that A has written down is i and B has guessed correctly, B receives i units from A. If B makes a wrong guess, B pays i unit to A. If B randomizes his decision by guessing 1 with probability p and 2 with probability 1 - p, determine his expected gain if (a) A...
Write a Java program that lets the user play a game where they must guess a...
Write a Java program that lets the user play a game where they must guess a number between zero and one hundred (0-100). The program should generate a random number between 0 and 100 and then the user will try to guess the number. The program should help the user guess the number (see details below). The program must allow the user five attempts to guess the number. Further Instruction: (a) Declare a variable diff and assign to it the...
Two players A and B play a game of dice . They roll a pair of...
Two players A and B play a game of dice . They roll a pair of dice alternately . The player who rolls 7 first wins . If A starts then find the probability of B winning the game ?
Develop a Java application that plays a "guess the number" game as described below. a) The...
Develop a Java application that plays a "guess the number" game as described below. a) The user interface is displayed and the user clicks the “Start Game” button to begin the game. b) Your application then gets a random number in the range 1-1000 inclusive (you might want to use Math.random or the Random class). c) The application then displays the following prompt (probably via a JLabel): I have a number between 1 and 1000 can you guess my number?...
Create a Guess the Number game. Python randomly chooses a secret four-digit number (with no repeating...
Create a Guess the Number game. Python randomly chooses a secret four-digit number (with no repeating digits) and asks the user to guess it. The user has up to ten attempts to guess the number. After each guess, Python gives the user two clues (until the user either guesses the number correctly or runs out of attempts): The number of digit(s) in the user’s guess that is (are) both correct and in the right position. The number of digit(s) in...
Two friends play a silly game where one person randomly strikes a key on a piano...
Two friends play a silly game where one person randomly strikes a key on a piano and the other person guesses the pitch of the note that was played. There are 12 different pitches represented on the piano, and since neither friend is that musical, their guesses of pitch are equally likely. Additionally, there are 5 black keys for every 7 white keys, and because the white keys are bigger they are more likely to be hit. a.)(8 points)Assume that...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT