A gene is a heritable unit of biological information that influences an organism’s traits. Biologically, it is a DNA sequence located on a chromosome; in genetic algorithms, it encodes one or more traits of an individual. section 2.4.3 section 2.5.1
DNA contains ordered base pairs, folds into chromosomes, and includes many genes. A gene may contain hundreds or thousands of base pairs, while a chromosome may contain hundreds or thousands of genes. Genetic algorithms simplify this biology by working mainly with genes and chromosomes and by mimicking selected aspects of meiosis. section 2.5.1
In a genetic algorithm, a gene can be represented in several practical ways:
- A Boolean or numeric value, such as 0 or 1, occupying one position in a chromosome. section 2.5.2
- An array value or a group of values, depending on how much information one trait requires. section 2.5.2
- A structured subgroup representing an object, such as a polygon defined by points, color, and transparency. section 3.5
Genes as a NumPy population
A simple population can contain 100 individuals, each represented by 100 binary genes: pop = np.random.randint(0, 2, size=(population, genes)). Each row is one chromosome and each position is a gene. In the EvoLisa example, groups of ten floating-point values instead encode polygon geometry, color, and alpha, which are extracted and rendered before fitness evaluation. section 2.5.3 section 3.5
Use the diagram to trace the relationship between DNA, genes, chromosomes, the nucleus, and the cell. section 2.5.1




