534: Genetic Algorithms

Explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
Genetic Algorithms
Just make sure you don't have it maximize instead of minimize.
Title text: Just make sure you don't have it maximize instead of minimize.

[edit] Explanation

In the computer science field of artificial intelligence, a genetic algorithm is a search heuristic that mimics the process of natural evolution. This heuristic is routinely used to generate useful solutions to optimization and search problems. Genetic algorithms belong to the larger class of evolutionary algorithms, which generate solutions to optimization problems using techniques inspired by natural evolution, such as inheritance, mutation, selection, and crossover.

In particular, genetic algorithms are designed to evolve, with various mechanisms being used to mimic natural selection. One such mechanism is to assign "costs" to various aspects of the program, and to select for programs which minimize these costs (thus mimicking organisms in an environment where they have to compete for limited resources).

The line indicated by an arrow is a reference to the Terminator series, in which the main antagonist is an artificial intelligence known as Skynet. By setting an absurdly high cost for an algorithm transforming into Skynet, the coder makes a preventative measure against the algorithm achieving such sentience.

The line about water crossing is a possible reference to the old computer game Oregon Trail, in which crossing water was hazardous.

The title text appears to be referring to the method by which the program select the desired option, with minimizing being where the program seeks the lowest possible cost, and maximizing where the program seeks the highest possible cost, presumably suggesting that if the program maximized, it would chose the BecomingSkynet option before any other due to its massive cost.

[edit] Transcript

[Code displayed, presumably from an IDE.]
def getSolutionCosts(navigationCode):
fuelStopCost = 15
extraComputationCost = 8
[There is a giant arrow pointing to the next line.]
thisAlgorithmBecomingSkynetCost = 999999999
waterCrossingCost = 45
Genetic algorithms tip: Always include this in your fitness function.
Comment.png add a comment!

Discussion

No comments yet.
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox

It seems you are using noscript, which is stopping our project wonderful ads from working. Explain xkcd uses ads to pay for bandwidth, and we manually approve all our advertisers, and our ads are restricted to unobtrusive images and slow animated GIFs. If you found this site helpful, please consider whitelisting us.

Want to advertise with us, or donate to us with Paypal or Bitcoin?