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

instrument / verified-clean

# Hardy-Weinberg Equilibrium Calculator

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/hardy-weinberg-equilibrium-calculator/>)[02**Mechanism**Method and assumptions](<https://guthlabs.ai/docs/instruments/hardy-weinberg-equilibrium-calculator/mechanism/>)[03**Implementation**Binding and validation](<https://guthlabs.ai/docs/instruments/hardy-weinberg-equilibrium-calculator/implementation/>)[04**Qualification**Evidence and errata](<https://guthlabs.ai/docs/instruments/hardy-weinberg-equilibrium-calculator/qualification/>)

## Ledger state

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

**Area**: Biology, Medicine & Pharmacology (educational estimates only — every panel labeled not-medical-advice)

**Tranche**: tranche-4

**Evidence ID**: t4-134

**Ledger rows**: 1

No ledger note is attached.

## Review findings

The stated HWE identities are standard, but the advertised feature set is incomplete and ambiguous. The instrument should explicitly define accepted input combinations, genotype-to-allele conversion, expected-count calculation, chi-square formula and significance level, zero-expected-count handling, and whether N is required for counts and testing. The educational/non-medical label is appropriate, but the interface should also state that HWE is an idealized statistical model and that a chi-square result does not by itself establish or disprove biological equilibrium.

### Formula and scope findings

- The formulas p+q=1 and p²+2pq+q²=1 are correct HWE identities, but they do not specify how to derive p and q from genotype frequencies or how to derive expected genotype frequencies from supplied allele frequencies.

- The input claim "allele or genotype frequencies (any subset)" is ambiguous and can be underdetermined or internally inconsistent; the required input combinations and validation rules are not specified.

- For genotype-frequency input, the standard allele-frequency formulas p=f(AA)+0.5f(Aa) and q=f(aa)+0.5f(Aa) are missing.

- Expected genotype counts require the formula count=N×frequency and require a supplied population size; population size is described as optional even though counts are an advertised output.

- The chi-square deviation test has no formula, observed-versus-expected input definition, significance level, or explicit degrees-of-freedom rule. A standard 1-df HWE test would use χ²=Σ(O−E)²/E, subject to expected-count constraints, but that formula is not stated.

- The formulas do not state the validity constraints 0≤p≤1, 0≤q≤1, p+q=1, and nonnegative genotype frequencies summing to 1.

### Unit assumptions

- p, q, and genotype frequencies are dimensionless proportions from 0 to 1; percentage inputs must be converted by dividing by 100.

- N is a number of individuals, not a percentage or other measurement unit; genotype counts are N multiplied by expected genotype frequencies.

- AA, Aa, and aa denote the three diploid genotype categories, with expected frequencies p², 2pq, and q² respectively.

- A chi-square calculation would require observed genotype counts or frequencies and a consistent choice of count-based or frequency-based calculation; no such convention is specified.

## Boundary hardening

**BREAK_CLAIMED** · SELF_FLAGGED

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.

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

## 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-tranche4/tranche4-results.json`

- `BOUNDARY_HAZARD_CATALOG.json`
