7 kyu

Genetic Algorithm Series - #1 Generate

1,148 of 3,609gabrielsiedler

Description:

A genetic algorithm is based in groups of chromosomes, called populations. To start our population of chromosomes we need to generate random binary strings with a specified length.

In this kata you have to implement a function generate that receives a length and has to return a random binary strign with length characters.

Example:

Generate a chromosome with length of 4 generate(4) could return the chromosome 0010, 1110, 1111... or any of 2^4 possibilities.

Note: Some tests are random. If you think your algorithm is correct but the result fails, trying again should work.

See other katas from this series

This kata is a piece of Binary Genetic Algorithm

Strings
Fundamentals
Genetic Algorithms
Algorithms

More By Author:

Check out these other kata created by gabrielsiedler

Stats:

CreatedDec 25, 2015
PublishedDec 25, 2015
Warriors Trained6170
Total Skips465
Total Code Submissions20032
Total Times Completed3609
JavaScript Completions1148
C# Completions537
Python Completions1210
Ruby Completions167
PHP Completions447
Elixir Completions74
CoffeeScript Completions16
TypeScript Completions188
Total Stars114
% of votes with a positive feedback rating86% of 626
Total "Very Satisfied" Votes481
Total "Somewhat Satisfied" Votes120
Total "Not Satisfied" Votes25
Ad
Contributors
  • gabrielsiedler Avatar
  • jhoffner Avatar
  • OverZealous Avatar
  • hencethus Avatar
  • Javatlacati Avatar
  • NaMe613 Avatar
  • anter69 Avatar
  • brunolm Avatar
  • donaldsebleung Avatar
  • siebenschlaefer Avatar
  • kazk Avatar
  • FArekkusu Avatar
  • hobovsky Avatar
  • Just4FunCoder Avatar
  • saudiGuy Avatar
Ad