Source: https://guthlabs.ai/docs/instruments/random-number-distribution-sampler/

instrument / verified-clean

# Random Number & Distribution Sampler

The current ledger marks this instrument verified clean within the source-bound verification corpus.

Status: **VERIFIED_CLEAN**Lifecycle: **verified-clean**

## Inspectable records

[01**Overview**Purpose and lifecycle](<https://guthlabs.ai/docs/instruments/random-number-distribution-sampler/>)[02**Mechanism**Method and assumptions](<https://guthlabs.ai/docs/instruments/random-number-distribution-sampler/mechanism/>)[03**Implementation**Binding and validation](<https://guthlabs.ai/docs/instruments/random-number-distribution-sampler/implementation/>)[04**Qualification**Evidence and errata](<https://guthlabs.ai/docs/instruments/random-number-distribution-sampler/qualification/>)

## Ledger state

The current ledger marks this instrument verified clean within the source-bound verification corpus.

**Area**: Mathematics — arithmetic through advanced (algebra, matrices, calculus, sequences/series, number theory, combinatorics, graphing, complex numbers, geometry, logic, sets)

**Tranche**: tranche-6

**Evidence ID**: t6-141

**Ledger rows**: 1

No ledger note is attached.

## Review findings

The named methods are standard and conceptually appropriate, and the honest-label warning is adequate. However, deterministic behavior cannot be verified from the declared inputs because the custom RNG, seed behavior, inverse-CDF boundary rules, and histogram binning are unspecified. The four vectors therefore use deterministic_uniforms as a conformance-harness input; the implementation specification should either expose an equivalent seeded RNG interface or document that test override explicitly.

### Formula and scope findings

- The Box-Muller transform is correctly named, but the specification does not define whether both generated normal values are returned, nor how uniform inputs equal to 0 or 1 are handled. A value of 0 causes log(0), and the implementation must enforce 0 < u1 <= 1 (normally 0 < u1 < 1).

- Inverse-CDF sampling is a standard method, but the specification does not provide the actual inverse-CDF algorithms or boundary convention for uniform values exactly at cumulative-probability boundaries.

- The phrase 'inverse-CDF sampling for others' is underspecified for binomial and Poisson distributions: the implementation must define the PMFs, cumulative summation procedure, and numerical stopping rule.

- The custom RNG is not specified by algorithm, seed interface, or state transition. Without this, sample lists cannot be independently reproduced from only distribution type, parameters, and sample count.

- Histogram generation is underspecified: bin count or edges, interval inclusion rules, handling of values on bin boundaries, and normalization versus raw counts are missing.

- No explicit uniform-distribution formula is given; the standard formula should be x = a + (b - a)u for u in [0,1), with a stated endpoint convention.

### Unit assumptions

- Distribution parameters are dimensionless unless the caller supplies an external unit; generated values inherit the parameter units.

- Uniform bounds a and b use the same units.

- Normal mu and sigma use the same units, and sigma is a standard deviation, not a variance.

- Binomial n is a dimensionless nonnegative integer and p is a dimensionless probability.

- Poisson lambda is a dimensionless mean count for the sampling interval; changing the interval changes lambda.

- Histogram bin edges use the same units as the sampled values, and the test vector uses raw counts rather than density normalization.

## Boundary hardening

**BREAK_CLAIMED** · SELF_FLAGGED

An adversarial Box-Muller input u1 = 0 produces an undefined logarithm; the instrument must reject it. Reversed uniform bounds also expose an unresolved convention difference that can change the result from 12.5 to 17.5.

## Errata and corrections

No applied erratum is attached to this unique-name record.

## Inspectable example

4 review vectors are recorded. One source-bound sample is shown below.

````
{
  "inputs": {
    "distribution": "uniform",
    "a": 2,
    "b": 6,
    "sample_count": 2,
    "deterministic_uniforms": [
      0,
      0.75
    ],
    "histogram_edges": [
      2,
      4,
      6
    ],
    "histogram_rule": "[2,4), [4,6]"
  },
  "expected_outputs": {
    "samples": [
      2,
      5
    ],
    "histogram_counts": [
      1,
      1
    ]
  },
  "working": "Use x = a + (b - a)u. For u = 0: x = 2 + (6 - 2)*0 = 2 + 0 = 2. For u = 0.75: x = 2 + (6 - 2)*0.75 = 2 + 4*0.75 = 5. Histogram: sample 2 is in [2,4), so the first count is 1. Sample 5 is in [4,6], so the second count is 1. Therefore samples = [2,5] and histogram_counts = [1,1]. The u = 0 case checks the lower-bound convention."
}
````

## Related workflows

No source-defined multi-instrument workflow membership is recorded.

## Sources and evidence

These pointers bind the page to evidence. They do not grant authority or collapse verification into deployment.

- `VERIFIED_LEDGER.json · VERIFIED_CLEAN`

- `evidence-tranche6/tranche6-results.json`

- `BOUNDARY_HAZARD_CATALOG.json`
