Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose you are given two sets A and B, each containing n positive integers. You can choose to reorder each set however you like.

 

Suppose you are given two sets A and B, each containing n positive integers. You can choose to reorder each set however you like. After reordering, let a; be the ith element in A, and b; be the ith element in B. You will receive a payoff of 1 aibi. a) If you reorder A and B into monotonically decreasing order, consider any indices i and j such that i < j, which of the two combinations has higher value: a,b; +a;b; or ab; + b;a? Prove your answer. Based on this, describe the optimal way of reordering that maximizes your payoff. bi b) If you receive payoff of 1 at, what is the way of reordering to maximize the payoff? Prove your answer in a similar way to a). c) Briefly describe how your methods above can be viewed as greedy algorithms.

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

Introduction to Algorithms

Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest

3rd edition

978-0262033848

More Books

Students also viewed these Programming questions

Question

How can a tapered part be turned on a lathe?

Answered: 1 week ago

Question

Does the product look and feel like a quality product?

Answered: 1 week ago

Question

What are the attributes of a technical decision?

Answered: 1 week ago