Crossover    and    Mutation     The    two    main    operations    in    evolutionary    computing    are    crossover    and    mutation.    Crossover     works    like    this:     Randomly    choose    two    parents    from    the    population.    Let’s    say    these:     Parent    1:        T        F        T        F        T        T        F     Parent    2:        T        T        T        F        F        T        T     Those    two    parents    will    create    a    child    whose    DNA    is    related    to    the    parents’.    It    works    like     this:    for    each    of    the    seven    genes    in    the    chromosome,    we    will    randomly    pick    a    number     between    1    and    10    and    use    it    to    choose    which    parents’    value    the    child    will    get.    If    the    random     number    is    1    through    5,    we    will    use    Parent    1’s    included    value    for    the    child;    if    it    is    6    through     10,    we’ll    use    Parent    2’s.    Let’s    assume    our    seven    random    numbers    are:     1        4        10        3        6        6        9     Then    the    child’s    set    of    item    included    =ields    would    be:     Child:        T        F        T        F        F        T        T     Mutation    is    even    simpler:    we    choose    a    single    individual    from    our    population    and    again     generate    a    random    number    between    1    and    10    for    each    nucleotide.    Mutation    generally     happens    more    rarely    than    reproduction,    so    if    the    random    number    is    1,    we    will    =lip    that    gene     in    the    individual;    otherwise,    we    will    leave    it    the    same.    Let’s    assume    our    seven    random     numbers    are:     5        1        7        8        9        2        7     and    the    chosen    individual’s    included    values    are:     T        T        F        T        T        T        F     Then    after    mutation,    that    individual    now    looks    like    this    (with    the    second    gene    =lipped    from     a    T    to    a    F):     T        F        F        T        T        T        F     public class Chromosome extends ArrayList implements Comparable private static Random rng Used for random number generation public Chromosome() This no-arg constructor can be empty public Chromosome(ArrayList items) Adds a copy of each of the items passed in to this Chromosome. Uses a random number to decide whether each item’s included Field is set to true or false.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Crossover    and    Mutation    
The    two    main    operations    in    evolutionary    computing    are    crossover    and    mutation.    Crossover    
works    like    this:    
Randomly    choose    two    parents    from    the    population.    Let’s    say    these:    
Parent    1:        T        F        T        F        T        T        F    
Parent    2:        T        T        T        F        F        T        T    
Those    two    parents    will    create    a    child    whose    DNA    is    related    to    the    parents’.    It    works    like    
this:    for    each    of    the    seven    genes    in    the    chromosome,    we    will    randomly    pick    a    number    
between    1    and    10    and    use    it    to    choose    which    parents’    value    the    child    will    get.    If    the    random    
number    is    1    through    5,    we    will    use    Parent    1’s    included    value    for    the    child;    if    it    is    6    through    
10,    we’ll    use    Parent    2’s.    Let’s    assume    our    seven    random    numbers    are:    
1        4        10        3        6        6        9    
Then    the    child’s    set    of    item    included    =ields    would    be:    
Child:        T        F        T        F        F        T        T    
Mutation    is    even    simpler:    we    choose    a    single    individual    from    our    population    and    again    
generate    a    random    number    between    1    and    10    for    each    nucleotide.    Mutation    generally    
happens    more    rarely    than    reproduction,    so    if    the    random    number    is    1,    we    will    =lip    that    gene    
in    the    individual;    otherwise,    we    will    leave    it    the    same.    Let’s    assume    our    seven    random    
numbers    are:    
5        1        7        8        9        2        7    
and    the    chosen    individual’s    included    values    are:    
T        T        F        T        T        T        F    
Then    after    mutation,    that    individual    now    looks    like    this    (with    the    second    gene    =lipped    from    
a    T    to    a    F):    
T        F        F        T        T        T        F    

public class Chromosome extends ArrayList implements Comparable private static Random rng Used for random number generation public Chromosome() This no-arg constructor can be empty public Chromosome(ArrayList items) Adds a copy of each of the items passed in to this Chromosome. Uses a random number to decide whether each item’s included Field is set to true or false. 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Problems on Dynamic Programming
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education