Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 1: A day at a crowded beach. You are back at the beach, but now it is too crowded. You have only k umbrellas.

image text in transcribed

Problem 1: A day at a crowded beach. You are back at the beach, but now it is too crowded. You have only k umbrellas. You run your optimal greedy algorithm from the previous homework, and you realize that the minimum number of umbrellas needed to cover everyone is larger than k. You decide to try to cover as many people as possible with the k umbrellas you have available. Formal description: You are given 21,...,In E Z, and some k,LEN. You want to find a collection of intervals 1.... CR, each of length L, such that the number of points in 21, ..., that fall inside IU... UI is maximized. Describe a polynomial-time algorithm for this problem. That is, the running time of your algorithm should be at most polynomial in n. Prove that your algorithm is correct and that it runs in polynomial time. For example, if the input is x1 = 1, 22 = 3, 23 = 4,24 = 6,25 = 9, 36 = 10, 27 = 11, 2g = 12, 29 = 15, 210 = 17, k = 3, and L=3, then an optimum solution is 1,4), (9, 12), 14, 17). an HHHHHHHHHHHHHH 1 ! 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Hint: Use dynamic programming. Problem 1: A day at a crowded beach. You are back at the beach, but now it is too crowded. You have only k umbrellas. You run your optimal greedy algorithm from the previous homework, and you realize that the minimum number of umbrellas needed to cover everyone is larger than k. You decide to try to cover as many people as possible with the k umbrellas you have available. Formal description: You are given 21,...,In E Z, and some k,LEN. You want to find a collection of intervals 1.... CR, each of length L, such that the number of points in 21, ..., that fall inside IU... UI is maximized. Describe a polynomial-time algorithm for this problem. That is, the running time of your algorithm should be at most polynomial in n. Prove that your algorithm is correct and that it runs in polynomial time. For example, if the input is x1 = 1, 22 = 3, 23 = 4,24 = 6,25 = 9, 36 = 10, 27 = 11, 2g = 12, 29 = 15, 210 = 17, k = 3, and L=3, then an optimum solution is 1,4), (9, 12), 14, 17). an HHHHHHHHHHHHHH 1 ! 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Hint: Use dynamic programming

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

Recommended Textbook for

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions

Question

Discuss the importance of workforce planning.

Answered: 1 week ago

Question

Differentiate between a mission statement and a vision statement.

Answered: 1 week ago