← Tool directory

Python teaching tool

Genetic Inheritance Visualizer

Illustrate a simplified model of inheritance over two to four generations.

Bring
The number of generations you want to explore in a simulation.
You get
A diagram of simulated inheritance across those generations.

Worked example

How does one simulated family diagram change when you ask for four generations instead of two?

Source notes

Run genetic-inheritance-complete-v21.py twice. At the prompt enter 2 for your first diagram and 4 for your second. Open both timestamped SVG files and compare the number of people and the colored squares within their grids.

Observed result

The two-generation file contained three person grids, one child and two parents. The four-generation file contained fifteen, adding four grandparents and eight great-grandparents. Each person had an 8-by-8 grid. The files contained 195 and 975 SVG rectangle elements, respectively, including the rectangle behind each grid.

What this establishes

The program samples a parent independently at each grid position. The squares are teaching symbols. They do not represent measured DNA segments or identify a particular relative as their source.

Next research step

Run the two-generation case again. Count the people first, then compare the positions of the colors. The structure is fixed while the sampled colors can change.

Sources and verification

Two local runs of the published Python script completed. We parsed the resulting SVGs and counted the person groups and rectangle elements.

Related tools