Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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?
- Host: GitHub
- URL: https://github.com/uncomputable/expressive-wallet
- Owner: uncomputable
- License: cc0-1.0
- Created: 2023-11-12T21:50:36.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-18T16:00:59.000Z (about 1 year ago)
- Last Synced: 2024-11-06T05:43:20.731Z (about 2 months ago)
- Topics: coq, formal-verification, maths, maths-problem, ocaml, theorem-proving
- Language: Coq
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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] |