# Output of majority-model.ts

Command:  `bun majority-model.ts`.  Exact generating-function calculations, with brute-force and seeded simulation checks.  The parent rerun preserves the R2 numbers and clarifies that Part C conditions on already recovered ancestral readings.  This replaces the withdrawn R1 branching simulation.

```text
# Part A.  Expected good share by generation (Appendix C, pp. 162-165)
q	k	gen	copies	good share	good:bad
0.250	2	2	2	75.00%	1.5:0.5
0.250	2	3	4	62.50%	2.5:1.5
0.250	2	4	8	56.25%	4.5:3.5
0.250	2	5	16	53.13%	8.5:7.5
0.250	2	6	32	51.56%	16.5:15.5
0.250	2	8	128	50.39%	64.5:63.5
0.250	2	10	512	50.10%	256.5:255.5
0.333	3	2	3	66.67%	2.0:1.0
0.333	3	3	9	55.56%	5.0:4.0
0.333	3	4	27	51.85%	14.0:13.0
0.333	3	5	81	50.62%	41.0:40.0
0.333	3	6	243	50.21%	122.0:121.0
0.333	3	8	2187	50.02%	1094.0:1093.0
0.333	3	10	19683	50.00%	9842.0:9841.0

# Part B.  Exact distribution:  how likely is a 75:25 split, and given one, how likely is the minority original?
Band = good share in 75-85% or 15-25%.  Exact = 25:75 to the nearest copy.
q	k	counting	copies	P(split in band, either way)	P(minority original | band)	P(minority original | exact)
0.001	2	last generation, gen 10	512	0.002485	0.09%	0.10%
0.010	2	last generation, gen 10	512	0.06567	0.10%	0.83%
0.030	2	last generation, gen 10	512	0.4149	0.15%	0.40%
0.100	2	last generation, gen 10	512	7.42e-4	1.69%	1.72%
0.200	2	last generation, gen 10	512	1.05e-15	15.79%	15.87%
0.250	2	last generation, gen 10	512	2.17e-21	35.54%	35.61%
0.333	2	last generation, gen 10	512	3.25e-27	49.43%	49.44%
0.001	2	every copy, gens 2-9	510	0.003165	0.01%	0.52%
0.010	2	every copy, gens 2-9	510	0.04352	0.17%	0.80%
0.030	2	every copy, gens 2-9	510	0.2523	0.26%	1.04%
0.100	2	every copy, gens 2-9	510	0.07498	1.84%	2.10%
0.200	2	every copy, gens 2-9	510	5.48e-6	10.60%	10.90%
0.250	2	every copy, gens 2-9	510	5.27e-9	18.33%	18.67%
0.333	2	every copy, gens 2-9	510	4.71e-15	31.36%	31.62%
0.001	2	500 drawn from gen 12 (2048)	500	0.002728	0.07%	0.10%
0.010	2	500 drawn from gen 12 (2048)	500	0.08872	0.07%	0.66%
0.030	2	500 drawn from gen 12 (2048)	500	0.5442	0.12%	0.19%
0.100	2	500 drawn from gen 12 (2048)	500	7.46e-8	1.65%	1.65%
0.200	2	500 drawn from gen 12 (2048)	500	8.84e-24	23.42%	23.50%
0.250	2	500 drawn from gen 12 (2048)	500	4.37e-27	44.66%	44.68%
0.333	2	500 drawn from gen 12 (2048)	500	3.99e-29	49.93%	49.93%
0.001	3	last generation, gen 7	729	1.13e-4	0.01%	0.02%
0.010	3	last generation, gen 7	729	0.02600	0.02%	0.20%
0.030	3	last generation, gen 7	729	0.2571	0.02%	0.18%
0.100	3	last generation, gen 7	729	0.04132	0.15%	0.16%
0.200	3	last generation, gen 7	729	4.83e-12	2.03%	2.04%
0.250	3	last generation, gen 7	729	3.84e-20	6.26%	6.28%
0.333	3	last generation, gen 7	729	2.31e-33	33.95%	33.99%

# Part C.  Recovered readings of ancestors E and L, on independent lines from the autograph; descendants add no further evidence once those readings are known
Given that E and L disagree, chance that E has the original.  dE, dL = copying steps from the autograph.
q	dE	dL	P(E original | E and L disagree)
0.01	2	2	50.00%
0.01	2	4	66.66%
0.01	2	8	79.97%
0.01	4	2	33.34%
0.01	8	2	20.03%
0.05	2	2	50.00%
0.05	2	4	66.42%
0.05	2	8	79.14%
0.05	4	2	33.58%
0.05	8	2	20.86%

# Part D.  Checks
mass 1.00000000000001;  mean 256.013006147 vs recurrence 256.013006147
brute force vs generating function, q=0.2 k=2 gen 4:  last generation max diff 5.86e-15, all generations max diff 1.01e-14
Monte Carlo (400,000 runs) vs generating function, q=0.1 k=2 gen 7:  largest gap 2.56 standard errors over 65 bins
survivor thinning mass 1.00000000000
```
