subject

Consider the following number guessing game. A target integer chosen from 0 to n (inclusive) is known only to the referee. A player is given k chips and is allowed to ask a series of questions in order to identify the unknown integer as long as there is a chip available. Each question must be presented in the form "Is the target integer less than k?" where k is an integer. The referee will answer the question with either a "Yes" or a "No". The referee will always tell the truth. Each Yes costs the player one chip, while a No costs the player nothing Design a Java program to calculate the minimum number of questions needed to identify any target number for a given n and number of chips k. Your program should take in, as input arguments, values of k and n, and output the value of the minimum number of questions needed in the worst case. The following command finds the minimum number of questions needed for n= 32 and k = 3
java -jar Guess. jar 3 32 0
and returns the following:
Professor Danny
For a target number between 0 and 32, with 3 chips, it takes at most 6 questions to identify the target number in the worst case.
Specific Requirements:
1. Use the dynamic programming technique to design your program.
Explain in English your design and present pseudo code (4pts). Define the optimal substructure (4pts), i. e., recurrence. If your program passes all the test cases, you will receive 8 pts. Additionally, 4pts will be awarded for a bottom up implementation.
2. Make an interactive game where a user is the referee and the program will guess the target integer with the minimum number of questions. (Bonus Points: 4 pts)

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 13:50
Explain how email technologies enable the exchange of messages between users. find out the typical parts of an email address and explain each part.
Answers: 1
question
Computers and Technology, 23.06.2019 21:10
Asample of 200 rom computer chips was selected on each of 30 consecutive days, and the number of nonconforming chips on each day was as follows: 8, 19, 27, 17, 38, 18, 4, 27, 9, 22, 30, 17, 14, 23, 15, 14, 12, 20, 13, 18, 14, 20, 9, 27, 30, 13, 10, 19, 12, 26. construct a p chart and examine it for any out-of-control points. (round your answers to four decimal places.)
Answers: 2
question
Computers and Technology, 24.06.2019 08:30
Aconsumer would pay an extra they used the rent to own program to buy the computer, rather than using cash. for all of the items, is the cheapest option over the life of the contract. the most expensive overall option is to use purchase the item.
Answers: 2
question
Computers and Technology, 24.06.2019 20:30
Which key should you press to leave the cell as it originally was? a. delete b. cancel c. backspace d. enter
Answers: 1
You know the right answer?
Consider the following number guessing game. A target integer chosen from 0 to n (inclusive) is know...
Questions
Questions on the website: 13722359