Home
Anserine

> Recent Entries
> Archive
> Friends
> User Info
> My Website


Evolution is not Pokemon! [+0]


achewood ai albums amv anarchy online bands books boy with pigtails calendar cartoons celebrities chiptune coding community computer cooling creationism culture dinosaurs dreams education einstürzende neubaten emo evolution firefox firth flash freedom of speech fundie gaming geek gender goose goth graffiti grammar graphics graphics card history hosting icon identity illness indie internet kids language law linux lj logic love magnatune math me media meme minneapolis mixtube momus motd movies music mysticism mythology nautilus pompilius news oops pants pickleclicky pictures pointless posts politics portal psu psychology puppeh! rant ray comfort reasons to be militant recycled relativity religion revisionism rhmb rights rp russian sambakza schemes science scotland scrawl scripting scrob second life set theory silly smoking software stebe stereo total stupidity synthpop tag teeth television territorialism terry pratchett the mother of all wristwatches title tutorials unfinished uni video games videos violence vocaloid words writing xkcd

January 21st, 2008


05:00 pm - Evolution is not Pokemon!
On Saturday night, I told the story of the fundie who insisted that because the person who posited the possibility of MRI scanners was a creationist, the science behind magnetic resonance imaging must be creationism. I joked that I wanted to do something with evolutionary biology, and call it computing science.

Well, naturally, someone beat me to it:-

function GENETIC ALGORITHM(population, FITNESS-FN) returns an individual
  inputs: population, a set of individuals
          FITNESS-FN, a function that measures the fitness of an individual

  repeat
    new_population ← empty set
    loop for i from 1 to SIZE(population) do
      x ← RANDOM-SELECTION(population, FITNESS-FN)
      y ← RANDOM-SELECTION(population, FITNESS-FN)
      child ← REPRODUCE(x, y)
      if (small random probability) then child ← MUTATE(child)
      add child to new_population
    populationnew_population
  until some individual is fit enough, or enough time has elapsed
  return the best individual in population, according to FITNESS-FN

function REPRODUCE(x, y) returns an individual inputs: x, y, parent individuals n ← LENGTH(x) c ← random number from 1 to n return APPEND(SUBSTRING(x, 1, c), SUBSTRING(y, c+1, n))


Thing o' beauty. I loves it!

(I suppose this theoretically counts as studying, but if anything won't come up in tomorrow's exam, it's genetic algorithms :/ )
Tags: ,

(Mark territory)


> Go to Top
LiveJournal.com