Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please use binary numbers as a part of your answers to the following two problem

ID: 3196621 • Letter: P

Question

Please use binary numbers as a part of your answers to the following two problems. 4. Tweedledee and Tweedledum are playing a game. Tweedledee thinks of a number between 1 and 1000, and Tweedledum tries to guess the number. Tweedledum is allowed to ask a limited number of questions of the form "Is the number greater/less than so and so?" How many questions must he be allowed to ask in order for him to be sure of getting the right number on his first guess if he proceeds properly? How should he proceed?

Explanation / Answer

There would be a simple logic in it. We can ask questions like is it 1? 2? 3? .....1000?. Then the number of questions will be 1000. Absolutely this is not the best way.

We can try like this: Is it even? or is it odd? This is somewhat better than the previous method but it is not the optimum case.

So we should have some other way to guess the number. So there is a way that reduces the number of questions 100 times lesser than 1000.

That is bisecting the total 1-1000 numbers.

first, make two ranges like 1-500 and 501-1000

now ask whether the number chosen is in the first group or second.

Continue above process until you reach the number. This may seem difficult to imagine but we understand by an example.

Let's say there are A and B.

Now A chose a number 55.

now B asks the questions:

Q1)B: Is it above 500?

A: NO.

Q2)B: Is it above 250?

A: NO.

Q3)B: Is it above 125?

A: NO.

Q4)B: Is it above 62?

A: NO.

Q5)B: Is it above 31?

A: YES.

Q6)B: Is it above 46?

A: YES.

Q7)B: Is it above 54?

A: YES.

Q8)B: Is it above 58?

A: NO.

Q9)B: Is it above 56?

A: NO.

B: So the number is 55.

By asking 9 questions B guessed the number. We just have done the sections into two halves. It is an efficient method to guess the number.

You can try it by taking any number between 1-1000.