The optimal load of our backpack last week, which supports a maximum of 15 kilos, is three packages of 4 kilos, of 10 euros each, and another three of 1 kilo, of those of 2 euros each, with a value total of 36 euros.
Our monetary system is quite well thought out, in order to make change easily and with a reduced number of coins, but perhaps it could be improved, as Ignacio Alonso points out: “I think that the 2 and 20 cent coins and the 2 euro they could be eliminated due to the complication they add compared to the fact that they can be replaced by only two of unit value; there are too many coins, although it is not a mathematical question, because they are not clearly distinguishable visually from the contiguous ones”.
As for the greedy algorithm, it usually gives an optimal result with both the euro and dollar monetary systems, but it does not work with all kinds of hypothetical values, as Salva Fuster points out: “As an example, to see where the greedy algorithm fails , we could think that we only have coins with values 1, 5 and 7. To get the amount 10, the greedy algorithm would lead us to the use of four coins: one of 7 and three of 1, while said amount could be obtained with fewer coins: two out of 5. It seems to me that the key is to have some coin with a value less than twice another”.
The protein peseta
Surely many readers remember the peseta, and through the pockets of the less young they will have passed coins of very different alloys, sizes and values. Ignoring banknotes and limiting ourselves only to metal coins, I remember handling them (not all at the same time or always of the same size and composition, since some had a short life and others underwent successive transformations) of 5, 10, 25 and 50 cents, and 1, 2, 2.50 (yes, an unlikely “mixed” coin of two and a half pesetas), 5, 10, 25, 50, 100, 200 and 500 pesetas.
Such a wide range of values allows for some interesting problems. For example, and assuming that the 14 coins mentioned were all in circulation at the same time:
In how many different ways could 1 peseta be paid?
In how many different ways could 5 pesetas be paid?
And for those who have a lot of free time this long and hot summer: In how many different ways, without using cents, could you pay 100, 200 and 500 pesetas?
Other: Is there any transaction in pesetas in which the greedy algorithm would fail in order to give change with the least number of coins possible? (We still assume that all 14 different values were available at the same time.)
As for banknotes, and although some of us have even known those of 1 and 5 pesetas, most of my kind readers will only remember those with a value equal to or greater than 100 “pelas”: 100, 200, 500, 1,000, 2,000 , 5,000 and 10,000. The 1,000 bill, the popular “talego”, was the one commonly used in transactions of a certain entity and was responsible for the colloquial name of the million pesetas “kilo”. Why? It’s not hard to find a reasonable explanation with a bit of lateral thinking. (Counter clue: the fact that “kilo” means “thousand” may be, in this case, a misleading clue).
You can follow MATTER in Facebook, Twitter and Instagramor sign up here to receive our weekly newsletter.
#problematic #peseta