Description
Sample amounts from an explicitly solved bounded target interval, retaining exact unbounded unordered combination counts, minimum-coin witnesses and reachable or impossible controls; minimum ties retain the first smaller-denomination recurrence.
A generated practice exercise contains a prompt and an answer key under a specific rule set. A planted answer establishes one possible solution; only an explicit enumeration or uniqueness check establishes whether alternatives exist.
Sample amounts from an explicitly solved bounded target interval, retaining exact unbounded unordered combination counts, minimum-coin witnesses and reachable or impossible controls; minimum ties retain the first smaller-denomination recurrence.
When to use this tool
Use this generator to create reproducible coin change combination challenge cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.
How to use the tool and how it works
- Supply denominations, minimumTarget, maximumTarget, count, control in the field shapes below. Set seed when you need an explicit replay.
- Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
- Read denominations, cases. Use the conventions below. Keep answer-bearing fields separate when presenting an exercise.
Use dynamic programming to count unordered unlimited-coin combinations exactly and compute a minimum-coin witness for every bounded target. Sample targets under any, reachable, or unreachable policy and return decimal-string counts, nullable minimumCoins, and witness lists.1
Delegated operations used for this result: divmod. Their calculation or parsing conventions apply to the corresponding result fields.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| denominations | Denominations | Required. Array of Safe integer; minimum 1; maximum 32.; minimum items 1; maximum items 8. |
| minimumTarget | Minimum Target | Required. Safe integer; minimum 0; maximum 128. |
| maximumTarget | Maximum Target | Required. Safe integer; minimum 0; maximum 128. |
| count | Count | Required. Safe integer; minimum 1; maximum 8. |
| control | Control | Required. Text; one of "any", "reachable", "impossible". |
| seed | Optional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed. | Optional. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| denominations | Denominations | Required. Array of Safe integer; minimum 1; maximum 32.; minimum items 0; maximum items 8. |
| cases | Cases | Required. Array of Object; no unknown keys.; minimum items 0; maximum items 8. |
| cases[].target | Target | Required. Safe integer; minimum 0; maximum 128. |
| cases[].reachable | Reachable | Required. Boolean. |
| cases[].combinationCount | Combination Count | Required. Text; maximum UTF-16 length 64. |
| cases[].minimumCoins | Minimum Coins | Required. Safe integer; minimum 0; maximum 128. or Null. |
| cases[].witness | Witness | Required. Array of Safe integer; minimum 1; maximum 32.; minimum items 0; maximum items 128. |
| cases[].quotientBounds | Quotient Bounds | Required. Array of Safe integer; minimum 0; maximum 128.; minimum items 0; maximum items 8. |
| randomness | Replay source and normalized 32-bit seed, or null seed for an advancing context source. | Required. Object; no unknown keys. |
| randomness.seed | Optional safe-integer replay seed; normalization and precedence are explained below. | Required. Safe integer. or Null. |
| randomness.source | Source | Required. Text; one of "context", "seed". |
An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.
{
"input": {
"denominations": [
2,
3
],
"minimumTarget": 5,
"maximumTarget": 6,
"count": 1,
"control": "any",
"seed": 42
},
"output": {
"denominations": [
2,
3
],
"cases": [
{
"target": 6,
"reachable": true,
"combinationCount": "2",
"minimumCoins": 2,
"witness": [
3,
3
],
"quotientBounds": [
3,
2
]
}
],
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- Unreachable targets have zero combinations, null minimumCoins, and an empty witness. Target zero has one empty combination. Denominations must be distinct positive integers; this does not model limited stock or currency exchange.
- A replay requires the same complete input and implementation. The stated sampling convention applies within its eligible space. A finite draw does not exhaust all possible outputs; repeats remain possible unless a distinct-selection rule is explicit.
- The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.
Alternative or Complementary methods
For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.
References
Similar or alternative tools
- Random Balance Scale Equation Puzzle Generator
Construct balanced symbolic pan equations from sampled nonnegative weights, retaining exact solutions without claiming uniqueness.
- Random Configurable Bingo Card Generator
Generate a bounded integer bingo grid with explicit column ranges, column/card-wide uniqueness and an optional free cell using randomized augmenting-path matching; overlapping ranges are supported, search is bounded and cards are not uniform over all feasible layouts.