Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(10 points) A group of n dancers will be performing while while holding flags. It's optimal if each dancer is holding a flag as

 

(10 points) A group of n dancers will be performing while while holding flags. It's optimal if each dancer is holding a flag as close as possible to their height. You have a collection of n flags of varying lengths and you want to assign a flag to each dancer such that you are minimizing the total difference in heights. That is minimizing i=1 Id; - fil where d; is height of a dancer and f; is height of flag. Consider the following two strategies and prove or disprove that they work. 1. (5 points) Greedly, pick the dancer and flag that have the minimum difference in height. 2. (5 points) Sort the two lists and then assign the ith dancer to the ith flag. Does this algorithm work? If it doesn't, show a counter example.

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

Statistics The Art And Science Of Learning From Data

Authors: Alan Agresti, Christine A. Franklin

3rd Edition

9780321849281, 321755944, 321849280, 978-0321755940

More Books

Students also viewed these Programming questions

Question

6.8 Find a z o such that P(-z

Answered: 1 week ago

Question

Use translations to graph f. f(x) = x-/2 +1

Answered: 1 week ago

Question

What is meant by disparity in sentencing?

Answered: 1 week ago