Question

In: Advanced Math

Combinatorics: 6. A mathematician picks and integer i from the set {1,2,3,...,15} and a computer scientist...

Combinatorics:

6. A mathematician picks and integer i from the set {1,2,3,...,15} and a computer scientist tries to find the number by asking questions of the form: Is i<x, i>x, or i=x? Show that the number can always be found using three questions

Solutions

Expert Solution

Suppose the integer picked is denoted by i

Here follows the 3 questions :

Question 1. Is, i < 8 or i > 8 or i = 8

Now, if i = 8, we find the number as 8 only in the first question.

If i > 8, proceed as follows :

Question 2. Is, i < 12 or i > 12 or i = 12

If, i = 12, we find the number as 12 only in the second question.

Subcase 1 : if i > 12

Question 3. Is, i > 14 or i < 14 or i = 14

If i < 14 & already i > 12, so, i = 13

If, i = 14 then we find i.

If, i > 14, then i = 15

So, we find i in 3 questions.

Subcase 2 : if i < 12

Question 3. Is, i > 10 or i = 10 or i < 10

If, i > 10 & also, i < 12, so, i = 11

If, i = 10, then we find i

If, i < 10 & also, i > 8 then we find i as 9

So, we find i in 3 questions.

Now, we left another case : what if i < 8 right after the first question ?

Break it into subcases. Try with the middle numbers respectively as, i > 4 , or i = r or i < 4

& For the subcase, i > 4, try with i > 5 or i = 5 or i < 5

& For the subcase, i < 4, try with i > 2 or i = 2 or i < 2


Related Solutions

Task 2C: User picks an integer in a range and computer guesses by randomly This approach...
Task 2C: User picks an integer in a range and computer guesses by randomly This approach is similar to Task 2B. The only difference is, the computer will generate a random integer in the range as a guess. In this strategy, a guess is a random int in a given range. Hence, for the same range and same answer, the number of guesses will be different. For example, suppose the range is in [0, 10] and the answer is 7....
In C++ Task 2B: User picks an integer in a range and computer guesses using approach...
In C++ Task 2B: User picks an integer in a range and computer guesses using approach similar to binary-search Enter the left end and right end of a range of integers. User chooses an integer in that range. Computer makes a guess that equals the mid of the range. User gives a feedback for each guess: 1 for too big, 2 for too small and 3 for just right. When the feedback is 1 (too big), the computer throws away...
Six different numbers are chosen at random from the set {1,2,3, … ,50}. a) What is...
Six different numbers are chosen at random from the set {1,2,3, … ,50}. a) What is the probability that a number greater than 40 is selected? b) What is the probability that a number greater than 40 is selected and a number less than 10 is selected?
An operator walks from her workstation to a set of shelves 10 steps away. She picks...
An operator walks from her workstation to a set of shelves 10 steps away. She picks up both a hammer (weighs 2.5 pounds) and a box of nails from the shelf(s), which are at knee level. She must reach 10 inches into the shelf to grasp the hammer. Following the retrieval of the hammer she much reaches 10 inches into an adjacent shelf to grasp a box of nails. She returns to her workstation and sets the hammer and nails...
Problem 4.Step 1: Generate a random integer between 3 and 6. Set A to be the...
Problem 4.Step 1: Generate a random integer between 3 and 6. Set A to be the value of the generated number.Step 2: Generate a random integer between 3 and 6. Set B to bethe value of the generated number.You are running a camp of 30 students, including John and Jane.3a.) What is the total possible ways you can arrange 2 focus groupsof students one group being size A(from step 1), and the other sizeB.3b.) What is the probability that John...
Write a program that prompts the user to enter an integer from 1 to 15 and...
Write a program that prompts the user to enter an integer from 1 to 15 and displays a pyramid, as shown in the following sample run: here............THE PYRAMID HAS TO BE THIS SHAPE AND IT IS DONE IN JAVA PLEASE 7 6 5 4 3 2 1 2 3 4 5 6 7 6 5 4 3 2 1 2 3 4 5 6 5 4 3 2 1 2 3 4 5 4 3 2 1 2 3 4...
Consider a random sequence x1,…,x7 of 7 numbers each chosen from the set {1,2,3,…,10} with replacement....
Consider a random sequence x1,…,x7 of 7 numbers each chosen from the set {1,2,3,…,10} with replacement. What is the probability that max{x1,…,x7} occurs exactly once in x1,…,x7?
Consider the set of integer numbers from 0 to 9, that is {0, 1, 2, 3,...
Consider the set of integer numbers from 0 to 9, that is {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. Bob wishes to use these numbers to create a 7-digit password to secure his new laptop. Note that each number can appear in any position (for example, 0 can be the first number in the password). (a) Find the number of 7-digit passwords that are possible. (b) Find the number of 7-digit passwords with distinct digits. (c) Find...
(a) Design an algorithm that reveals some secret integer number from the set {1, 2, ......
(a) Design an algorithm that reveals some secret integer number from the set {1, 2, ... , n} by guessing random numbers within the given range until the secret number has been guessed. Numbers should be replaced after being guessed such that ​it is possible to guess 2 and then 2 again​, assuming 2 is in the given range. The algorithm should return both the secret number as well as the number of guesses taken. (b) If possible, calculate the...
i) A set of 4 6-tuples (“sextuplets”) is linearly independent: (always), (never), (sometimes). ii) A set...
i) A set of 4 6-tuples (“sextuplets”) is linearly independent: (always), (never), (sometimes). ii) A set of 6 4-tuples (“quadruplets”) is linearly independent: (always), (never), (sometimes). iii) A set of 4 equations with 6 unknown variables which is consistent has a unique solution: (always), (never), (sometimes). iv) A set of 4 equations with 6 unknown variables is inconsistent: (always), (never), (sometimes) v) A set of homogeneous equations is inconsistent: (always), (never), (sometimes) vi) The solution to a set of homogeneous...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT