Each DNA base (A/C/G/T) encodes 2 bits (logโ4), so one byte maps to 4 bases:
00โA 01โC 10โG 11โT
raw density = 2 bits / base
Real DNA synthesis is error-prone, so a payload is written as R independent physical copies of the same sequence. Each copy suffers random per-base substitution errors at rate p, landing uniformly on one of the 3 other bases. Decoding takes a majority vote across the R reads at every position, with ties broken by a fair random pick among whichever bases are tied for the lead:
effective density = 2 / R bits / base
P(base correct) = ฮฃ over (n_A,n_C,n_G,n_T) with n_A+n_C+n_G+n_T=R
where the true base's count is a co-leader:
[ R!/(n_A!n_C!n_G!n_T!) ยท (1-p)^(n_true) ยท (p/3)^(R-n_true) ] / (# tied leaders)
P(whole message correct) = P(base correct)^(number of bases)
Note on this simulator's math: the 3D sibling used a simpler two-outcome binomial-majority formula (right vs. "wrong", ignoring that a wrong call can land on any of 3 different bases). Verified numerically: because this is a 4-symbol channel, a "wrong majority" can itself split across 2-3 different bases even when R is odd, producing multi-way ties the binary formula misses โ and those ties resolve in the true base's favor part of the time. At R=5, p=30% that binary approximation reads 83.7% while the true rate is ~91.0%, a 7+ point understatement. The exact multinomial formula above (matching the fair tie-break the decoder actually performs) replaces it here. The "P(whole message)" stat multiplies the per-base probability across every base in the payload, which the original panel omitted; it is shown here alongside per-base probability so both trade-off axes (a single base vs. the entire archived message) are visible at once.
- Message size โ payload length in bytes; each byte becomes 4 bases.
- R (copies) โ how many redundant molecules are synthesized per base position. Higher R buys reliability at the direct cost of storage density.
- Error rate p โ probability any single physical base is misread during synthesis + sequencing (real DNA storage runs โ0.5โ5%).
- Synthesize & Sequence โ draws random errors on every copy, then majority-votes each position back to a decoded strand: green cells matched the original base, red cells are residual errors the vote could not fix.
- Grid cell width / drag โ drag inside the copies grid to pan across long payloads; the zoom slider sets how many bases are visible per screen width.
This is the actual physical trade-off behind DNA data storage research (Microsoft/UW, Twist Bioscience, Catalog DNA): DNA holds ~215 petabytes/gram in principle, but every real system spends bases on redundancy and error-correcting codes to survive synthesis and sequencing noise.