Source: https://guthlabs.ai/docs/instruments/hardy-weinberg-equilibrium-calculator/implementation/

instrument implementation / implementation-contract

# Hardy-Weinberg Equilibrium Calculator implementation

A source-bound implementation contract for Hardy-Weinberg Equilibrium Calculator; 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**: t4-134

**Effect**: Computation or source lookup only

## Input and validation requirements

The count-derived frequency path breaks at population_size=0 because it requires division by zero. The instrument should reject that input explicitly. A separate convention hazard exists because swapping the meanings of p and q reverses the AA and aa outputs.

## 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": {
    "p": 0.6,
    "q": 0.4,
    "population_size": 100
  },
  "expected_outputs": {
    "p": 0.6,
    "q": 0.4,
    "expected_AA_frequency": 0.36,
    "expected_Aa_frequency": 0.48,
    "expected_aa_frequency": 0.16,
    "expected_AA_count": 36,
    "expected_Aa_count": 48,
    "expected_aa_count": 16
  },
  "working": "p+q=0.6+0.4=1.0. p²=0.6×0.6=0.36. 2pq=2×0.6×0.4=0.48. q²=0.4×0.4=0.16. Check: 0.36+0.48+0.16=1.00. Counts: 100×0.36=36, 100×0.48=48, 100×0.16=16."
}
````

## Other records

[01**Overview**](<https://guthlabs.ai/docs/instruments/hardy-weinberg-equilibrium-calculator/>)[02**Mechanism**](<https://guthlabs.ai/docs/instruments/hardy-weinberg-equilibrium-calculator/mechanism/>)[04**Qualification**](<https://guthlabs.ai/docs/instruments/hardy-weinberg-equilibrium-calculator/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-tranche4/tranche4-results.json`
