rebelwarrior

rebelwarrior

Genetic Algorithms in Elixir: Natural Selection Chp5(p.71)

Hi Sean,

Just go your book and looking it over.

Some bg on me, I’m a ecology and evolutionary major from Princeton, later self-taught programmer. I’ve been noticing a lot of confusion on natural selection related to genetic algorithms just in general.

In general genetic algorithms aren’t based on natural selection but on artificial (human) selection. The big difference is how fitness relates to the outcome. In artificial selection you determine “fitness” a priori, that is before selection, while in evolution “fitness” really is an emergent property. It’s a little weird and that’s why evolution took such a long time to understand.

Darwin’s later adoption of the phrase “survival of the fittest” (which he didn’t coin) is probably the source of this confusion but fitness is not the determinant factor for survival. What? I know. It sounds like the exact opposite of what you’ve heard. But fitness is a property that shows up only after survival. A better way to say it would be “those that survive, tend to be more fit” A tendency that is not deterministic. Can you have the less fit survive? Well technically yes, but more importantly you have no idea what “fit” is until after selection. Remember that natural selection explains the why of speciation. Why there are many species and why they evolve not fitness. Contrast this with artificial or human selection. We breed dogs for certain qualities, we grow plants and select the seed with the qualities we most desire. Here “fitness” is determined by humans before selection, in fact, selection is based on these factors. This seems to be more closely aligned with genetic algorithms to me.

Ok getting back to the book. The following phrase “The fittest individuals are the ones that are selected to reproduce because they can pass their strong genes to the next generation.” on page 71 is technically wrong when referring to natural selection; it is correct when referring to artificial selection.

Nicely this phrase just before it “Charles Darwin’s theory of evolution suggests that strong traits that are key to survival become more common in successive generations.” is correct.

This may seem like a small thing but this misunderstanding of Natural Selection has lead to it being used as a pseudoscientific justification for discrimination in the hands of Social Darwinist, which is really just a pseudoscientific excuse to not be a nice person.

Let me know if you have any questions, happy to discuss.

– David Acevedo

3 722 1

Marked As Solved

seanmor5

seanmor5

Author of Genetic Algorithms in Elixir

Hey David, thanks for the excellent feedback. I see exactly what you’re saying in the sense that using analogies like this can be misleading. Overall, my understanding is that biological/genetic underpinnings in genetic algorithms go little beyond their inspiration. Despite this, I decided it was best to try to use some of these analogies in the hopes that they may be useful in understanding GAs a little better.

To your point, I see exactly how the analogy I used in that circumstance is incorrect, and how that kind of misleading analogy can be harmful. While I won’t be able to fix it before the next beta ships, I will absolutely address it before the final version.

I appreciate your feedback. If you come across any misleading analogies/inconsistencies, feel free to message me or post in here! Thank you for taking the time to make the book better!

Popular Prag Prog topics Top

New
kuroneko
Whilst the author has been careful to provide exact results for the tests elsewhere in the book (such as surds with the transformation te...
3 1053 0
New
edruder
I thought that there might be interest in using the book with Rails 6.1 and Ruby 2.7.2. I’ll note what I needed to do differently here. ...
9 1170 1
New
alanq
This isn’t directly about the book contents so maybe not the right forum…but in some of the code apps (e.g. turbo/06) it sends a TURBO_ST...
1 1363 7
New
patoncrispy
I’m new to Rust and am using this book to learn more as well as to feed my interest in game dev. I’ve just finished the flappy dragon exa...
5 1475 3
New
curtosis
Running mix deps.get in the sensor_hub directory fails with the following error: ** (Mix) No SSH public keys found in ~/.ssh. An ssh aut...
2 1434 3
New
jskubick
I think I might have found a problem involving SwitchCompat, thumbTint, and trackTint. As entered, the SwitchCompat changes color to hol...
0 2588 2
New
jskubick
I’m under the impression that when the reader gets to page 136 (“View Data with the Database Inspector”), the code SHOULD be able to buil...
2 1163 8
New
taguniversalmachine
It seems the second code snippet is missing the code to set the current_user: current_user: Accounts.get_user_by_session_token(session["...
0 1877 8
New
SlowburnAZ
Getting an error when installing the dependencies at the start of this chapter: could not compile dependency :exla, "mix compile" failed...
0 1027 10
New

Other popular topics Top

AstonJ
There’s a whole world of custom keycaps out there that I didn’t know existed! Check out all of our Keycaps threads here: https://forum....
15 7812 20
New
New
gagan7995
API 4 Path: /user/following/ Method: GET Description: Returns the list of all names of people whom the user follows Response [ { ...
7 2839 4
New
rustkas
Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either c...
91 4879 44
New
AstonJ
Biggest jackpot ever apparently! :upside_down_face: I don’t (usually) gamble/play the lottery, but working on a program to predict the...
19 2830 11
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
21 5360 10
New
New
PragmaticBookshelf
Author Spotlight: Karl Stolley @karlstolley Logic! Rhetoric! Prag! Wow, what a combination. In this spotlight, we sit down with Karl ...
31 3516 17
New
PragmaticBookshelf
Author Spotlight: Tammy Coron @Paradox927 Gaming, and writing games in particular, is about passion, vision, experience, and immersio...
36 3220 19
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
1 1089 1
New

Latest in PragProg

View all threads ❯