Schematex
matrix·Mendelian genetics (Punnett square)·education, genetics, biology·complexity 3/3·since v0.1.1

Dihybrid cross Punnett square (9:3:3:1)

A two-gene Punnett square where the engine computes the gametes, the 4×4 offspring grid, and the canonical 9:3:3:1 phenotype ratio — Mendel's pea seed shape × colour cross — with each phenotype class auto-tinted.

For the biology teacher or genetics student predicting offspring ratios

Open in Playground →
matrix·§
↘ preview
100%
Punnett square — Seed shape & colour (RrYy × RrYy) Punnett square — dihybrid cross RrYy × RrYy; phenotype ratio 9:3:3:1 Seed shape & colour (RrYy × RrYy) RrYy RrYy RY Ry rY ry RY Ry rY ry RRYY RRYy RrYY RrYy RRYy RRyy RrYy Rryy RrYY RrYy rrYY rrYy RrYy Rryy rrYy rryy Phenotype ratio 9:3:3:1 9 × Round, Yellow 3 × Wrinkled, Yellow 3 × Round, Green 1 × Wrinkled, Green Genotype ratio 4:2:2:2:2:1:1:1:1 — 9 distinct genotypes
UTF-8 · LF · 4 lines · 128 chars✓ parsed·9.6 ms·10.2 KB SVG

What this shows

A Punnett square predicts the offspring of a genetic cross. You write only the two parental genotypes — the engine does the Mendelian bookkeeping: it enumerates each parent's gametes (one allele per gene locus), fills the grid with every gamete combination, and counts the resulting genotype and phenotype ratios.

This is a dihybrid cross (two genes at once) — Mendel's classic pea experiment crossing seed shape (R round dominant / r wrinkled) with seed colour (Y yellow dominant / y green). Two heterozygous parents each produce four gametes (RY, Ry, rY, ry), so the grid is 4×4 = 16 boxes. The engine computes the famous 9:3:3:1 phenotype ratio — 9 round-yellow : 3 wrinkled-yellow : 3 round-green : 1 wrinkled-green — and tints each box by its phenotype class so the ratio is visible at a glance. Case sets dominance (uppercase = dominant), and the optional trait lines name each phenotype so the legend reads in plain English.

Matrix syntax