Skip to content

Main content

Random Coin Change Combination Challenge Generator

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.

Loading tool…

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

  1. Supply denominations, minimumTarget, maximumTarget, count, control in the field shapes below. Set seed when you need an explicit replay.
  2. 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.
  3. 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 fieldMeaning and unitsAccepted input
denominationsDenominationsRequired. Array of Safe integer; minimum 1; maximum 32.; minimum items 1; maximum items 8.
minimumTargetMinimum TargetRequired. Safe integer; minimum 0; maximum 128.
maximumTargetMaximum TargetRequired. Safe integer; minimum 0; maximum 128.
countCountRequired. Safe integer; minimum 1; maximum 8.
controlControlRequired. Text; one of "any", "reachable", "impossible".
seedOptional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed.Optional. Safe integer.
Output fieldInterpretationReturned shape
denominationsDenominationsRequired. Array of Safe integer; minimum 1; maximum 32.; minimum items 0; maximum items 8.
casesCasesRequired. Array of Object; no unknown keys.; minimum items 0; maximum items 8.
cases[].targetTargetRequired. Safe integer; minimum 0; maximum 128.
cases[].reachableReachableRequired. Boolean.
cases[].combinationCountCombination CountRequired. Text; maximum UTF-16 length 64.
cases[].minimumCoinsMinimum CoinsRequired. Safe integer; minimum 0; maximum 128. or Null.
cases[].witnessWitnessRequired. Array of Safe integer; minimum 1; maximum 32.; minimum items 0; maximum items 128.
cases[].quotientBoundsQuotient BoundsRequired. Array of Safe integer; minimum 0; maximum 128.; minimum items 0; maximum items 8.
randomnessReplay source and normalized 32-bit seed, or null seed for an advancing context source.Required. Object; no unknown keys.
randomness.seedOptional safe-integer replay seed; normalization and precedence are explained below.Required. Safe integer. or Null.
randomness.sourceSourceRequired. 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.

json
{
  "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

  1. Tool behavior and example: Random Coin Change Combination Challenge Generator — tool.io

  2. Calculation or validation: arithmetic/divmod — tool.io

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.