Genetic Algorithms by Hand: Selection, Crossover, Mutation & Fitness
Run a genetic algorithm cell by cell with given random numbers: encode solutions as bits, score them with penalties, spin the roulette wheel, hold tournaments, cross and mutate chromosomes, step a full generation and check convergence against the brute-force optimum.
The first lesson is free โ no account needed.
About this course
A genetic algorithms course that runs a genetic algorithm cell by cell with given random numbers, so every step can be checked, for computer science and AI students, data scientists and anyone curious about evolutionary optimisation. You decode 5-bit chromosomes into numbers with BIN2DEC and score them with a fitness function, penalise over-weight solutions of a backpack (knapsack) problem, spin a roulette wheel with cumulative shares and MATCH and draw it as a pie chart, hold 2-way tournaments, cross parents at a single point with LEFT and RIGHT and gene by gene with IF, flip bits when a random number falls below the mutation rate, run one full generation of selection, crossover and mutation, and chart how best and average fitness converge over ten generations against the brute-force optimum of all 32 values. The first lab is free.
Lessons
- Encoding Solutions as Bit Strings: BIN2DEC & SUMPRODUCTFree
- Fitness with a Penalty: Scoring Over-Weight Backpacks Pro
- Roulette-Wheel Selection: Cumulative Shares & MATCH Pro
- Tournament Selection: Random Entrants, Fitter One Wins Pro
- Single-Point Crossover: LEFT, RIGHT & a Gene-Wise IF Pro
- Bit-Flip Mutation: Flip a Gene When u < pm Pro
- One Full Generation: Select, Cross, Mutate, Re-Score Pro
- Convergence over Generations vs the Brute-Force Optimum Pro