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

instrument mechanism / verified-clean

# Random Number & Distribution Sampler mechanism

The inspectable method record for Random Number & Distribution Sampler, kept separate from implementation and qualification.

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

## Model scope

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.

- 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.

## Units and conventions

- 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.

## Inspectable vector

One of 4 source-bound review vectors:

````
{
  "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."
}
````

## Failure boundary

**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.

## Other records

[01**Overview**](<https://guthlabs.ai/docs/instruments/random-number-distribution-sampler/>)[03**Implementation**](<https://guthlabs.ai/docs/instruments/random-number-distribution-sampler/implementation/>)[04**Qualification**](<https://guthlabs.ai/docs/instruments/random-number-distribution-sampler/qualification/>)

## Sources and evidence

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

- `VERIFIED_LEDGER.json`

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

- `BOUNDARY_HAZARD_CATALOG.json`
