Difference between revisions of "534: Genetic Algorithms"

Explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
(I probably did quite a bit wrong, but hopefully it is now easier to clean up than to create it anew.)
 
m (removed Category:Terminator using HotCat)
(14 intermediate revisions by 11 users not shown)
Line 1: Line 1:
 
{{comic
 
{{comic
 
| number    = 534
 
| number    = 534
| date      =  
+
| date      = January 23, 2009
 
| title    = Genetic Algorithms
 
| title    = Genetic Algorithms
| image    = [www.http://imgs.xkcd.com/comics/genetic_algorithms.png]
+
| image    = genetic_algorithms.png
 
| titletext = Just make sure you don't have it maximize instead of minimize.
 
| titletext = Just make sure you don't have it maximize instead of minimize.
 
}}
 
}}
  
 
==Explanation==
 
==Explanation==
Cueball is seen here defining a program (possibly in python). The title is a reference to the type of program Cueball is writing, a Genetic Algorithm.  
+
In the {{w|Computer science}} field of {{w|Artificial intelligence}}, a {{w|Genetic algorithm}} is a search {{w|Heuristic (computer science)|heuristic}} that mimics the process of {{w|Evolution|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 {{w|Mathematical optimization|optimization}} problems using techniques inspired by natural evolution, such as inheritance, mutation, selection, and crossover.
  
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 a {{w|Fitness function}} calculated as the sum of all 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.
+
The line indicated by an arrow is a reference to the {{w|Terminator (franchise)|Terminator}} series, in which the main antagonist is an artificial intelligence known as {{w|Skynet (Terminator)|Skynet}} that seeks to destroy all humans. By setting an absurdly high cost for an algorithm transforming into Skynet, the coder makes a preventive 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 line about water crossing is a possible reference to the old computer game {{w|The Oregon Trail (video game)|Oregon Trail}}, in which crossing water was hazardous. This video game was referenced again in [[623: Oregon]].
 +
 
 +
The title text refers to the method by which the program select the desired option, with minimizing being where the program seeks the lowest possible number, and maximizing where the program seeks the highest possible number. When dealing with cases such as generating profit, maximization would obviously be preferred over minimization; but selecting maximization here would be disastrous as it would always chose the BecomingSkynet option before any other due to its massive cost.
  
 
==Transcript==
 
==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 / Narration: Genetic algorithms tip: *Always* include this in your fitness function. / {{title text: Just make sure you don't have it maximize instead of minimize.}}
+
:[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.
  
{{comic discussion}}  
+
{{comic discussion}}
<!-- Include any categories below this line-->
+
[[Category:Programming]]
 +
[[Category:Comics with color]]
 +
[[Category:Artificial Intelligence]]

Revision as of 23:04, 30 October 2015

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.

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 a Fitness function calculated as the sum of all 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 that seeks to destroy all humans. By setting an absurdly high cost for an algorithm transforming into Skynet, the coder makes a preventive 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. This video game was referenced again in 623: Oregon.

The title text refers to the method by which the program select the desired option, with minimizing being where the program seeks the lowest possible number, and maximizing where the program seeks the highest possible number. When dealing with cases such as generating profit, maximization would obviously be preferred over minimization; but selecting maximization here would be disastrous as it would always chose the BecomingSkynet option before any other due to its massive cost.

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! ⋅ comment.png add a topic (use sparingly)! ⋅ Icons-mini-action refresh blue.gif refresh comments!

Discussion

This solves the problem until you reach a situation where destroying all humans is outvalued by 22222 bridge crossings. Nafedalbi (talk) 15:53, 18 April 2022 (UTC)Nafedalbi

Could that be what Google Maps was trying to accomplish back when it had that "500 consecutive U-turns" bug?172.70.131.106 21:00, 18 April 2022 (UTC)