Answered step by step
Verified Expert Solution
Question
1 Approved Answer
8. (13 points) Greedy Algorithms Alice, Bob and yourself have been trapped in a room with many hideous zombies. You have a gun that you
8. (13 points) Greedy Algorithms Alice, Bob and yourself have been trapped in a room with many hideous zombies. You have a gun that you can fire at a rate ofone second per shot (no reloading and you always hit your targeted zombie). Each zombie i is di feet away and is walking towards you ata speed of si (in feet per second). If a zombie reaches 0 feet away it will eat you. You all are arguing over which order to shoot the zombies so you can live as long as possible (i.e. kill the maximum number of zombies) a) (2 point) Alice thinks you should shoot the closest zombie first. Describe a set of zombies for which this is not correct. (Give a distance and speed for each zombie.) b) (2 points) Bob thinks you should shoot the fastest zombie first. Describe a set of zombies for which this not correct. (Give a distance and speed for each zombie.) c) (2 points) Which zombie should you shoot first? d) (2 points) What order would you target these zombies? Assume each pair is a zombie z (di,s) Z = {(4,0.5), (6,2), (3,3), (8,4), (2,0.1), (9,4), (7,2)) 8. (13 points) Greedy Algorithms Alice, Bob and yourself have been trapped in a room with many hideous zombies. You have a gun that you can fire at a rate ofone second per shot (no reloading and you always hit your targeted zombie). Each zombie i is di feet away and is walking towards you ata speed of si (in feet per second). If a zombie reaches 0 feet away it will eat you. You all are arguing over which order to shoot the zombies so you can live as long as possible (i.e. kill the maximum number of zombies) a) (2 point) Alice thinks you should shoot the closest zombie first. Describe a set of zombies for which this is not correct. (Give a distance and speed for each zombie.) b) (2 points) Bob thinks you should shoot the fastest zombie first. Describe a set of zombies for which this not correct. (Give a distance and speed for each zombie.) c) (2 points) Which zombie should you shoot first? d) (2 points) What order would you target these zombies? Assume each pair is a zombie z (di,s) Z = {(4,0.5), (6,2), (3,3), (8,4), (2,0.1), (9,4), (7,2))
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