Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions

Question

Write short notes on Interviews.

Answered: 1 week ago

Question

Explain the legal environments impact on labor relations. page 631

Answered: 1 week ago