Cody

# Problem 638. Uniform binary crossover

Solution 155737

Submitted on 30 Oct 2012
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
%% mask = [1 0 0 0 1 1 1 0 0]; parent1 = [0 0 0 1 1 1 0 0 0]; parent2 = [1 1 0 0 1 0 1 1 0]; children = [0 1 0 0 1 1 0 1 0;1 0 0 1 1 0 1 0 0]; assert(isequal(uniform_crossover(mask,parent1,parent2),children))

```Error: You may not use the command(s) str2func in your code ```

2   Fail
%% mask = 1; parent1 = 1; parent2 = 0; children = [1;0]; assert(isequal(uniform_crossover(mask,parent1,parent2),children))

```Error: You may not use the command(s) str2func in your code ```

3   Fail
%% mask = 1; parent1 = 1; parent2 = 0; children = [1;0]; assert(isequal(uniform_crossover(mask,parent1,parent2),children))

```Error: You may not use the command(s) str2func in your code ```

4   Fail
%% mask = [1 1 1 0 1 0 1 1 0 0 0 0 0 1 0]; parent1 = [0 1 1 1 1 0 0 0 0 1 0 0 1 0 1]; parent2 = [0 1 1 0 1 0 1 0 1 0 1 1 0 1 1]; children = [0 1 1 0 1 0 0 0 1 0 1 1 0 0 1;0 1 1 1 1 0 1 0 0 1 0 0 1 1 1] assert(isequal(uniform_crossover(mask,parent1,parent2),children))

```Error: You may not use the command(s) str2func in your code ```