diff --git a/docs/index.md b/docs/index.md index 6ffd298..e4c68cd 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,4 +1,6 @@ -## changer-ranger +--- +title: changer-ranger +--- Fun with the change-making problem. diff --git a/docs/real.md b/docs/real.md new file mode 100644 index 0000000..4992ab0 --- /dev/null +++ b/docs/real.md @@ -0,0 +1,30 @@ +--- +title: Real-life currencies +--- + +How well do real-life currencies perform in making change? + +## The currencies + +For this analysis, I have chosen four well-known currencies. Here they are with their sub-base-unit coins (e.g. for USD, everything under $1). + +Currency | Code | Denominations +-------------- | ---- | ------------- +US dollar | USD | 25, 10, 5, 1 +Japanese yen | JPY | 100, 50, 10, 5, 1 +Euro | EUR | 100, 50, 20, 10, 5, 2, 1 +Pound sterling | GBP | 100, 50, 20, 10, 5, 2, 1 + +There are also 1 USD and 0.50 USD coins in circulation, but they are quite uncommon so they have been left out of this analysis. + +## Minimizing number of coins + +![Number of coins needed to change amounts from 1 to 99 in four currencies, optimizing for fewest coins or lowest weight](currency_comparison_changestats_counts.png) + +## Minimizing the weight of coins + +![Total weights of coins needed to change amounts from 1 to 99 in four currencies, optimizing for fewest coins or for lowest total weight.](currency_comparison_changestats_weights.png) + +## Discrepancies between lowest-count and lowest-weight + +## Discrepancies between optimal and greedy minimum-count solutions