Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Let A and B be two sets of n positive integers. You get to reorder each set however you like. After reording, let a_i be

image text in transcribed

Let A and B be two sets of n positive integers. You get to reorder each set however you like. After reording, let a_i be the i-th element of A and b_i be the i-th element of B. The goal is to maximize the function product^n_i=1 a_i^b_i. You will develop a greedy algorithm for this task. (a) Describe a greedy idea on how to solve this problem, and shortly argue why you think it is correct (not a formal proof). (b) Describe your greedy algorithm in pseudocode. What is its runtime? Given a sequence A = {a_1, ..., a_n} of points on the real line. The task is to determine the smallest set of unit-length (closed) intervals that contains all of the input points. Consider the following two greedy approaches: (a) Let I be an interval that covers the most points in A. Add I to the solution, remove the points covered by I from A, and recurse/continue. (b) Add the interval I = [a_1, a_1 + 1] to the solution, remove the points covered by I from A, and recurse/continue. One of these approaches is correct, the other one is not. Show which of the approaches is not correct by finding a counter-example. (The counter example consists of an example input and two "solutions" -one is the actual optimal solution, the other is the solution computed by the greedy algorithm, which is not as good as the optimal solution.)

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

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions

Question

7. How will you encourage her to report back on the findings?

Answered: 1 week ago

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago