Canonical: https://toolipedia.app/coin-change-solver

# Dynamic Programming Solver

Solve coin change, subset sum and matrix chain order problems and see the answer, the fewest coins or multiplications, the number of ways and the filled table.

Breadcrumbs: Toolipedia > Everyday tools > Games, puzzles and random picks > Dynamic Programming Solver

## About Dynamic Programming Solver

Three classic dynamic programming problems with the working shown. Coin change takes your coin values and a target: it gives the fewest coins, one best combination and the number of different combinations, so coins 1, 5, 10 and 25 for 100 give 4 coins (four quarters) and 242 ways. Subset sum tells you whether some of your numbers, each used once, add up to the target, shows one such subset and counts them. Matrix chain order takes the matrix sizes and finds the bracketing with the fewest scalar multiplications; the textbook sizes 30, 35, 15, 5, 10, 20, 25 give 15,125. Small tables are shown filled.

## How to use Dynamic Programming Solver
1. Choose coin change, subset sum or matrix chain order.
2. Enter the coins or numbers or matrix sizes, separated by commas, and the target amount where one is needed.
3. Read the answer and the number of ways, then study the filled table to see how each cell was built.

## Why use this tool?
- Private: everything happens in your browser. Nothing you enter is uploaded.
- Free, with no sign-up, no watermark and no limit on how often you use it.
- Works on phones, tablets and computers: Android, iPhone, Windows, Mac and Linux. Nothing to install.
- Free to embed on your own website, with a ready-made code to copy.

## Also known as
- dynamic programming solver
- coin change calculator
- subset sum solver
- matrix chain multiplication calculator
- dp table calculator
- fewest coins for an amount

## Frequently asked questions

### Does coin change count 1+5 and 5+1 as different ways?

No. Ways counts combinations, so the order of coins does not matter. For 6 with coins 1 and 5, the ways are 1×6 and 5+1, which is 2.

### How do I enter matrix sizes for the chain problem?

List n+1 numbers for n matrices: sizes 10, 30, 5, 60 mean A1 is 10×30, A2 is 30×5 and A3 is 5×60. The best order is the bracketing with the lowest multiplication count.

### Why is the table missing for large targets?

A table with more than 2,600 cells would be too wide to read, so it is hidden. The answers above it are still computed exactly, using big numbers where the count of ways is huge.

### Is Dynamic Programming Solver free?

Yes. Dynamic Programming Solver on Toolipedia is free to use, with no sign-up and no watermark.

### Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

### Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

### Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

### Can I put Dynamic Programming Solver on my own website?

Yes. Use the Embed on your site button under the tool to copy a short piece of code and paste it into your page. It is free, needs no account, and the tool keeps working inside your page.

## Related tools

More free tools that go well with Dynamic Programming Solver:
- [Coin Flip Simulator](https://toolipedia.app/coin-flip-simulator)
- [Word Search Solver](https://toolipedia.app/word-search-solver)
- [Sudoku solver](https://toolipedia.app/sudoku-solver)
- [Speedrun Split Calculator](https://toolipedia.app/speedrun-split-calculator)
- [Maze Game and Solver](https://toolipedia.app/maze-game-and-solver)
