Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Show that if there were a coin worth 12 cents, the greedy algorithm using quarters, 12 - cent coins, dimes, nickels, and pennies would not always produce change using the fewest coins possible

Short Answer

Expert verified

For 12 - cents, greedy algorithm will always not produce fewest number of coins.

Step by step solution

01

Step 1

As mentioned in the question we have to use the greedy algorithm using quarters for 12 cents.

As per given preferences rankings of the men for the three women are:

m1:w3,w1,w2;m2:w1,w2,w3;m3:w2,w3,w1

02

Step 2

Now, for the rankings of the women, we have:

w1:m1,m2,m3;w2:m2,m1,m3;w3:m3,m2,m1.

This is because then no women will be matched with the men out of her preferences and also will not violate the condition of stability.

Therefore, we can conclude that for cents greedy algorithm will always not produce fewest number of coins.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Study anywhere. Anytime. Across all devices.

Sign-up for free