Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider that you are living on a planet that may be under attack by swarms of alien drones. A swarm of drones arrive over the
Consider that you are living on a planet that may be under attack by swarms of alien drones. A swarm of drones arrive over the course of n seconds: x, drones arrive in the i-th second. Using telescopes you are aware of the sequence xi, x2, ..., x, in advance. Your planet can defend using a particular laser device, which can make the drones harmless as they arrive. The laser's power depends on the time it has been charging since its last use. You have knowledge of a function f(), that indicates the following: ifj seconds have elapsed since the laser was last used, then it can render fO) drones harmless In particular, if the laser was used in second k, and j seconds have passed since it was previously used, then it will render min(xk, f0)) drones harmless. After this use it will be fully drained, so it would have to wait at least until the following second to be usable (as given by the function f) The goal of the problen and the f function, choose the points in time when you would use the laser, in order to maximize the number of drones that are made harmless. For example, given the data from point (b) below, an optimal solution would be to activate the laser in the 3d second (which allows it to rend harmless min (10,4) 4 drones) and in the 4th second (when it rends harmless min(1,1)- 1 drones) Develop a dynamic programming algorithm that finds the value of an optimal plan using the steps outlined above, Consider that you are living on a planet that may be under attack by swarms of alien drones. A swarm of drones arrive over the course of n seconds: x, drones arrive in the i-th second. Using telescopes you are aware of the sequence xi, x2, ..., x, in advance. Your planet can defend using a particular laser device, which can make the drones harmless as they arrive. The laser's power depends on the time it has been charging since its last use. You have knowledge of a function f(), that indicates the following: ifj seconds have elapsed since the laser was last used, then it can render fO) drones harmless In particular, if the laser was used in second k, and j seconds have passed since it was previously used, then it will render min(xk, f0)) drones harmless. After this use it will be fully drained, so it would have to wait at least until the following second to be usable (as given by the function f) The goal of the problen and the f function, choose the points in time when you would use the laser, in order to maximize the number of drones that are made harmless. For example, given the data from point (b) below, an optimal solution would be to activate the laser in the 3d second (which allows it to rend harmless min (10,4) 4 drones) and in the 4th second (when it rends harmless min(1,1)- 1 drones) Develop a dynamic programming algorithm that finds the value of an optimal plan using the steps outlined above
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