Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(a) describe the subproblem (b) give a recurrence for the subproblem (c) provide pseudo-code showing how a table for the subproblems is filled (d) give

image text in transcribed

(a) describe the subproblem (b) give a recurrence for the subproblem (c) provide pseudo-code showing how a table for the subproblems is filled (d) give the time and space requirements of your method The residents of the underground city of Zion defend themselves through a combination of kung-fu, heavy artillery, and efficient algorithms. Recently, they have become interested in automated methods that can help fend off attacks by swarms of robots Heres what one of these robot attacks look like: A swarm of robots arrives over the course of n seconds; in the ith second, xi robots arrive Based on remote sensing data, you know this sequence r1.22,..., xn in advance . You have at your disposal an electromagnetic pulse (EMP), which can destroy some of the robots as they arrive; the EMPs power depends on how long its been allowed to charge up. To make this precise, there is a function f(-) so that if j seconds have passed since the EMP was last used, then it is capable of destroying up to f(j) robots So, specifically, if it is used in the kth second, and it has been j seconds since it was previously used, then it will destroy min[k, f(j) robots. (After this use, will be completely drained.) . We will also assume that the EMP starts off completely drained, so if it is used for the first time in the jth second, then it is capable of destroying up to f(j) robots Given the data on robot arrivals X = (x1, 22, ,xn), and given the recharging function f (-), the problem is to determine the maximum number of robots that can be destroyed by activating the EMP at certain points in time For example, suppose n = 4, X = (1, 10.10.1) and f(-) = (1.2.4.8). The best solution would be to activate the EMP in the 3rd and 4th seconds. In the 3rd second, the EMP has gotten to charge for 3 seconds, and so it destroys min(10,4)-4 robots. In the 4th second, the EMP has only gotten to charge for 1 second since its last use, and it destroys min(1,1)=1 robot. This is a total of 5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions