Skip to content

Instantly share code, notes, and snippets.

@elia
Created March 26, 2012 21:54
Show Gist options
  • Select an option

  • Save elia/2210051 to your computer and use it in GitHub Desktop.

Select an option

Save elia/2210051 to your computer and use it in GitHub Desktop.
Genetic algorithms
pairs = %w[GC CG AT TA]
3_000_000_000.times.inject([]) {|dna,_| dna << pairs.sample }
# retry until it's valid human DNA…
@olistik

olistik commented Mar 27, 2012

Copy link
Copy Markdown

IT..
COULD..
WORK!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment