Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/uncomputable/expressive-wallet

What is a minimal wallet of coins that can express all amounts below a target?
https://github.com/uncomputable/expressive-wallet

coq formal-verification maths maths-problem ocaml theorem-proving

Last synced: 11 days ago
JSON representation

What is a minimal wallet of coins that can express all amounts below a target?

Awesome Lists containing this project

README

        

# Expressive Wallet Problem

Trigger warning: math ⚠️

"Given a set of coin denominations, what is a minimal wallet that can express all amounts up to a target amount?"

This math problem actually has some use in daily life! Always pay the bill exactly ✅

## Example: Euro cents 1, 2, 5, 10, 20, 50

Here are minimal wallets for targets 0 to 100.

It is surprising how slowly the wallet grows with respect to the target. I can't help but see a skyscraper.

| Target | Minimal Wallet |
|--------|------------------------------|
| 0 | [] |
| 1 | [1] |
| 2 | [1, 2] |
| 3 | [1, 2] |
| 4 | [1, 2, 2] |
| 5 | [1, 2, 2] |
| 6 | [1, 2, 2, 5] |
| 7 | [1, 2, 2, 5] |
| 8 | [1, 2, 2, 5] |
| 9 | [1, 2, 2, 5] |
| 10 | [1, 2, 2, 5] |
| 11 | [1, 2, 2, 5, 10] |
| 12 | [1, 2, 2, 5, 10] |
| 13 | [1, 2, 2, 5, 10] |
| 14 | [1, 2, 2, 5, 10] |
| 15 | [1, 2, 2, 5, 10] |
| 16 | [1, 2, 2, 5, 10] |
| 17 | [1, 2, 2, 5, 10] |
| 18 | [1, 2, 2, 5, 10] |
| 19 | [1, 2, 2, 5, 10] |
| 20 | [1, 2, 2, 5, 10] |
| 21 | [1, 2, 2, 5, 10, 20] |
| 22 | [1, 2, 2, 5, 10, 20] |
| 23 | [1, 2, 2, 5, 10, 20] |
| 24 | [1, 2, 2, 5, 10, 20] |
| 25 | [1, 2, 2, 5, 10, 20] |
| 26 | [1, 2, 2, 5, 10, 20] |
| 27 | [1, 2, 2, 5, 10, 20] |
| 28 | [1, 2, 2, 5, 10, 20] |
| 29 | [1, 2, 2, 5, 10, 20] |
| 30 | [1, 2, 2, 5, 10, 20] |
| 31 | [1, 2, 2, 5, 10, 20] |
| 32 | [1, 2, 2, 5, 10, 20] |
| 33 | [1, 2, 2, 5, 10, 20] |
| 34 | [1, 2, 2, 5, 10, 20] |
| 35 | [1, 2, 2, 5, 10, 20] |
| 36 | [1, 2, 2, 5, 10, 20] |
| 37 | [1, 2, 2, 5, 10, 20] |
| 38 | [1, 2, 2, 5, 10, 20] |
| 39 | [1, 2, 2, 5, 10, 20] |
| 40 | [1, 2, 2, 5, 10, 20] |
| 41 | [1, 2, 2, 5, 10, 20, 20] |
| ... | ... |
| 60 | [1, 2, 2, 5, 10, 20, 20] |
| 61 | [1, 2, 2, 5, 10, 20, 20, 50] |
| ... | ... |
| 100 | [1, 2, 2, 5, 10, 20, 20, 50] |