My own server My Home page Sign Guestbook Read Guestbook
The Apache manual The PHP manual PHP examples (Core PHP Progr.) PHP examples (Pro. PHP Progr.) My own PHP exemples

PHP-test 13

Simulation of evolution


Random mutations, but non-random selection

This is a very simplified simulation that tries to illustrate that the "evolution is random" idea is a misconception. It does this by separating the randomness of mutation from the non-random direction that selection provides.

In each generation, each individual has a random chance of having a mutation, set by the mutation rate (here 10%).

There are ten possible mutations, assigned at random. Note that for this particular "cold" environment, three are "more fit", one neutral or back to original state, three are "less fit", and three are lethal.


  *   Indicates a mutation in the offspring
      Most favored mutation, increases by one in each generation, unless all other offspring are most favored
      Favored mutation, increases by one in each generation, unless out-competed by most favored
      Favored mutation, increases by one in each generation, unless out-competed by most favored
      Original state or neutral mutation, gives only one offspring, unless out-competed by most favored or favored
      Disfavored mutation, gives only one offspring, unless out-competed by most favored, favored or neutral
      Disfavored mutation, gives only one offspring, unless out-competed by most favored, favored or neutral
      Disfavored mutation, gives only one offspring, unless out-competed by most favored, favored or neutral
      Lethal mutation, gives no offspring
      Lethal mutation, gives no offspring
      Lethal mutation, gives no offspring
      Dead

20 individuals per generation, 25 generations, mutation rate 10%, "cold" environment.

Gen. 0                                                                           *                                            
Gen. 1               *                                                     *           *                                      
Gen. 2                                       *                                   *                                   *        
Gen. 3                                                                           *                                            
Gen. 4                     *                                                           *                                      
Gen. 5   *                                                                 *                                                  
Gen. 6   *                                                           *                                                        
Gen. 7                                                         *                                                              
Gen. 8                           *                             *                                                              
Gen. 9         *     *                                                                                   *                    
Gen. 10                                                                                                                        
Gen. 11                                                   *           *                                                        
Gen. 12         *           *                                                                                                  
Gen. 13                     *                                                                                                  
Gen. 14                     *                                                                                                  
Gen. 15                                                                                       *                                
Gen. 16                                                                           *                             *              
Gen. 17               *                       *                       *                                                        
Gen. 18                                                                                                                        
Gen. 19         *                                                                                               *     *     *  
Gen. 20                     *                                                                                                  
Gen. 21   *           *     *           *                                               *                                      
Gen. 22                                                                           *                                            
Gen. 23                                                   *                             *                                      
Gen. 24                                                                                             *                          

To try another simulation with the same parameters, reload the page.

If you want to try other parameters, enter them here and click the submit button:

Individuals per generation:   Generations:   Mutation rate:    Environment: 


Click this button if you want to see the code for this page instead of a simulation.


Page created 2004-08-22, last changed 2004-09-09 15:21
This mirror page last changed 2009-12-04

© 2004 Bo Johansson