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

instrument implementation / implementation-contract

# Random Number & Distribution Sampler implementation

A source-bound implementation contract for Random Number & Distribution Sampler; deployment and executable qualification remain separate.

Status: **VERIFIED_CLEAN**Lifecycle: **implementation-contract**

## Binding contract

This record describes what an executable surface must bind and validate. It does not claim that a public calculator, package, or production route is deployed.

**Record owner**: Guth Instruments

**Lifecycle**: verified-clean

**Evidence ID**: t6-141

**Effect**: Computation or source lookup only

## Input and validation requirements

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.

## Required corrections

No binding erratum is attached to this unique-name record. Implementers must still preserve the declared units, domain, and failure behavior.

## Inspectable interface fixture

The sample below is evidence for interface and validation tests, not a production implementation.

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

## Other records

[01**Overview**](<https://guthlabs.ai/docs/instruments/random-number-distribution-sampler/>)[02**Mechanism**](<https://guthlabs.ai/docs/instruments/random-number-distribution-sampler/mechanism/>)[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`
