Computers and Technology
Computers and Technology, 22.03.2021 20:00, jude3412

Jars on a ladder problem. Given a ladder of n rungs and k identical glass jars, one has to designan experiment of dropping jars from certain rungs, in order to find the highest rung (HS) on theladder from which a jar doesn’t break if dropped. Idea: With only one jar (k=1), we can’t risk breaking the jar without getting an answer. So westart from the lowest rung on the ladder, and move up. When the jar breaks, the previous rung isthe answer; if we are unlucky, we have to do all n rungs, thus n trials. Now lets think of k=log(n):with log(n) or more jars, we have enough jars to do binary search, even if jars are broken at everyrung. So in this case we need log(n) trials. Note that we can’t do binary search with less than log(n)jars, as we risk breaking all jars before arriving at an answer in the worst case. Your task is to calculateq = MinT(n, k)= the minimum number of dropping trials any suchexperiment has to make, to solve the problem even in the worst/unluckiest case (i. e., not runningout of jars to drop before arriving at an answer).MinTstands for Minimum number of Trials. A(5 points).Explain the optimal solution structure and write a recursion for MinT(n, k).

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 20:00, bowmanari2154
What is used to analyze and summarize your data without graphical support
Answers: 1
image
Computers and Technology, 23.06.2019 07:30, cireland
Write a program that inserts the digits of an integer into an array in originalorderfollowed by reverse order. first, promptthe user to enter a positive integer(> 0). determine the number of digits of the integer. create a dynamically allocated integer arrayof a size twice the number of digits. now insert the digits in original order which will occupy half of the array. then, insert the digits in reverse order. finally, output thedigits in thearray. use at least two functions to organize your program.
Answers: 3
image
Computers and Technology, 23.06.2019 10:30, tommyaberman
Would a ps4 wired controller work on an xbox one
Answers: 1
image
Computers and Technology, 23.06.2019 12:20, jshhs
When guido van rossum created python, he wanted to make a language that was more than other programming languages. a. code-based b. human-readable c. complex d. functional
Answers: 1
Do you know the correct answer?
Jars on a ladder problem. Given a ladder of n rungs and k identical glass jars, one has to designan...

Questions in other subjects:

Konu
Social Studies, 16.07.2019 22:40
Konu
English, 16.07.2019 22:40