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
- Genetic Algorithm Series - #1 Generate
- Genetic Algorithm Series - #2 Mutation
- Genetic Algorithm Series - #3 Crossover
- Genetic Algorithm Series - #4 Get population and fitnesses
- Genetic Algorithm Series - #5 Roulette wheel selection
This kata is a piece of Binary Genetic Algorithm
Strings
Fundamentals
Genetic Algorithms
Algorithms
Similar Kata:
Stats:
Created | Dec 25, 2015 |
Published | Dec 25, 2015 |
Warriors Trained | 6170 |
Total Skips | 465 |
Total Code Submissions | 20032 |
Total Times Completed | 3609 |
JavaScript Completions | 1148 |
C# Completions | 537 |
Python Completions | 1210 |
Ruby Completions | 167 |
PHP Completions | 447 |
Elixir Completions | 74 |
CoffeeScript Completions | 16 |
TypeScript Completions | 188 |
Total Stars | 114 |
% of votes with a positive feedback rating | 86% of 626 |
Total "Very Satisfied" Votes | 481 |
Total "Somewhat Satisfied" Votes | 120 |
Total "Not Satisfied" Votes | 25 |