Question
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
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 looks like. A swarm of robots arrives over the course of n seconds; in the i th second, xi robots arrive. Based on remote sensing data, you know this sequence Xl, x2 ..... x~ 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 ifj seconds have passed since the EMP was last used, then it is capable of destroying up to f(]) robots. So specifically, ff it is used in the kth second, and it has beenj seconds since it was previously used, then it will destroy rrfin(xk, f(])) robots. (After t~s use, it will be completely drained.) We will also assume that the EMP starts off completely drained, so ff it is used for the first time in the jth second, then it is capable of destroying up to f(]) robots. The problem. Given the data on robot arrivals x~, x2 ..... xn, and given the recharging function f(.), choose the points in time at which youre going to activate the EMP so as to destroy as many robots as possible. Example. Suppose n = 4, and the values of xi and f(i) are given by the following table
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started