Giter Site home page Giter Site logo

weasel's Introduction

The Weasel Program

Context

The Weasel Program, is a thought experiment and a variety of computer simulations illustrating it. Their aim is to demonstrate that the process that drives evolutionary systems (random variation combined with non-random cumulative selection) is different from pure chance. The thought experiment was formulated by Richard Dawkins, and the first simulation written by him; various other implementations of the program have been written by others.

Algorithm

A Weasel style algorithm should run as follows.

  1. Start with a random string of 28 characters.
  2. Make 100 copies of this string, with a 5% chance per character of that character being replaced with a random character.
  3. Compare each new string with the target "METHINKS IT IS LIKE A WEASEL", and give each a score (the number of letters in the string that are correct and in the correct position).
  4. If any of the new strings has a perfect score (28), halt.
  5. Otherwise, take the highest scoring string, and go to step 2.

For these purposes, a "character" is any uppercase letter, or a space. Correct letters are not "locked". Each correct letter may become incorrect in subsequent generations. The terms of the program and the existence of the target phrase do however mean that such “negative mutations” will quickly be “corrected”.

By repeating the procedure, a randomly generated sequence of 28 letters and spaces will be gradually changed each generation. The sequences progress through each generation:

Generation 01:   WDLTMNLT DTJBKWIRZREZLMQCO P
Generation 02:   WDLTMNLT DTJBSWIRZREZLMQCO P
Generation 10:   MDLDMNLS ITJISWHRZREZ MECS P
Generation 20:   MELDINLS IT ISWPRKE Z WECSEL
Generation 40:   METHINKS IT IS LIKE I WEASEL
Generation 43:   METHINKS IT IS LIKE A WEASEL

weasel's People

Contributors

yuxi-andres avatar duende84 avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

aamandachaves

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.