Ruby (quiz?) simulation idea

Discussion in 'Ruby' started by Hal Fulton, Dec 7, 2004.

  1. Hal Fulton

    Hal Fulton Guest

    This is just off the top of my head. I thought I'd post it instead of
    emailing, in case people want to discuss it and/or think about it.

    This is "life" in a sense, but not John Horton Conway.

    Imagine you have N lifeforms to start with, each with a certain
    genotype. For simplicity, we could assume simple dominance, no
    sex-linked traits, and panmictic mating (probability of mating is
    random based on the population). Purists out there: Please don't
    flame any slight misuse of terms unless it's really relevant.

    Flashback to the first day of Genetics 101:

    AA = homozygous dominant
    Aa = heterozygous
    aa = homozygous recessive

    The population's genotype frequencies are obviously
    pAA + pAa + paa = 1

    A few seconds of thought should show that the gene frequencies
    are
    pA = pAA + 0.5pAa
    pa = paa + 0.5paa
    and also
    pA + pa = 1

    I imagine modeling each individual as an object running in a
    thread. For the heck of it, give each individual a location in
    a grid. Let them wander around. When a nature male bumps into a
    mature female, a probability function determines whether they mate
    and how many offspring they have.

    Assume each individual has a known average lifespan and a typical
    mating age. (I'd favor expressing these in millisec for purposes
    of the simulation). Let the "children" have certain probabilities
    of surviving to mating age: qAA, qAa, and qaa. Typically, these
    are all near 1.0 -- in many situations, the heterozygote will be
    a little less likely to survive, and the homozygote least of all.
    (This is the trivial case in which "A" is good or healthy and "a"
    is bad or unhealthy.)

    All things being equal, such a population will eventually reach
    what is called Hardy-Weinberg equilibrium, in which the genotype
    frequencies reach a constant and stay there (for a suitable value
    of epsilon).

    Run the simulation with large numbers of individuals. Sample the
    population once in awhile and check the numbers. Watch for
    equilibrium.

    Write a pure deterministic (algebraic) model that will predict when
    equilibrium occurs. See how well it matches your simulation. An
    iteration in the deterministic model is simply a "generation" -- I
    think we can consider that equal to a lifespan (or perhaps, hmm, the
    lifespan minus the mating age?).

    Just a thought...


    Hal
    Hal Fulton, Dec 7, 2004
    #1
    1. Advertising

  2. On Dec 6, 2004, at 7:25 PM, Hal Fulton wrote:

    > This is just off the top of my head. I thought I'd post it instead of
    > emailing, in case people want to discuss it and/or think about it.


    [snip description]

    Silence means consent?

    > Write a pure deterministic (algebraic) model that will predict when
    > equilibrium occurs. See how well it matches your simulation. An
    > iteration in the deterministic model is simply a "generation" -- I
    > think we can consider that equal to a lifespan (or perhaps, hmm, the
    > lifespan minus the mating age?).


    I think this should be "extra credit". Some of us are easily pleased
    and would be content watching little dots move around and multiply.

    James Edward Gray II
    James Edward Gray II, Dec 7, 2004
    #2
    1. Advertising

  3. On Tue, 7 Dec 2004 23:25:07 +0900
    James Edward Gray II <> wrote:

    > On Dec 6, 2004, at 7:25 PM, Hal Fulton wrote:
    >
    > > This is just off the top of my head. I thought I'd post it instead of
    > > emailing, in case people want to discuss it and/or think about it.

    >
    > [snip description]
    >
    > Silence means consent?
    >


    I'd like to propose something a bit different that stresses the fact that
    evolution is _not_ survival of the _strongest_ but survival of the _fittest
    population_.

    Maybe you have heard of this theme before, I also tried to simulate it once but
    it didn't work out how I thought, so it should be an interesting problem.

    The setting: (Directly from memory, so correct any misfacts)

    A certain kind of blood sucking bats (Vampires ;) can survive only one day
    without finding food. They live in big groups in their caves, but
    hunt/gather[1] alone.

    These bats are a standard example for how altruism develops in evolution.

    A bat may share the blood it has gathered through the night with another bat
    that had no success. But why should it? If it shares, it needs to gather
    successfully the next night, otherwise it will starve. So it diminusishes its
    strength and helps a rival, whose genes will have a better chance to spread.
    Wouldn't it be better off being egoistic and increasing its survival
    possibility?

    In practice, the bats developed some kind of "tit for tat" algorithm. So it is
    _for the population with this trait_ an evolutionary positive trait to be
    altruistic.

    So obviously what is the goal of the quiz. Write a "bat simulator" and feed it
    with a population of bats with different survival strategies. Equip the bats
    live with whatever detail you deem neccessary (Hunting, Mating, Breeding,
    Genetic Exchange, Mutation, ...) and see if the populations with different
    traits come to an equilibrium.

    Try to adjust the factors such that altruistic bats survive, if this didn't
    happen on the first run.

    Drawback of this proposal: No sensible nice graphics possible. Only graphs. But
    maybe _why can draw us a bat that looks like an elephant with a duck on its
    back ;)

    Best Regards,

    Brian


    [1] they don't kill their prey, so maybe I should say gather

    --
    Brian Schröder
    http://www.brian-schroeder.de/
    Brian Schröder, Dec 7, 2004
    #3
  4. On Dec 7, 2004, at 9:28 AM, Brian Schröder wrote:

    > I'd like to propose something a bit different that stresses the fact
    > that
    > evolution is _not_ survival of the _strongest_ but survival of the
    > _fittest
    > population_.


    War of the simulators? I say we unleash Brian's vampire bats on the
    pregnant sims from Hal's idea and...

    Seriously. It doesn't have to be an either or thing. It's possible
    we'll do many simulators over time.

    My queued quiz directory is currently empty, so the more the merrier.
    (If you have a good quiz idea, submit now and be first in line!)

    I'm watching this discussion and archiving the ideas presented.

    The only thing I'll add is that I'll tend to favor more fleshed out
    ideas (read: low work for James). Ready-to-run quizzes sent to
    will be given the highest priority and
    attention, as always.

    James Edward Gray II
    James Edward Gray II, Dec 7, 2004
    #4
  5. Hal Fulton

    James Britt Guest

    Brian Schröder wrote:
    > On Tue, 7 Dec 2004 23:25:07 +0900
    > James Edward Gray II <> wrote:
    >
    >
    >>On Dec 6, 2004, at 7:25 PM, Hal Fulton wrote:
    >>
    >>
    >>>This is just off the top of my head. I thought I'd post it instead of
    >>>emailing, in case people want to discuss it and/or think about it.

    >>
    >>[snip description]
    >>
    >>Silence means consent?
    >>

    >
    >
    > I'd like to propose something a bit different that stresses the fact that
    > evolution is _not_ survival of the _strongest_ but survival of the _fittest
    > population_.
    >
    > Maybe you have heard of this theme before, I also tried to simulate it once but
    > it didn't work out how I thought, so it should be an interesting problem.


    Sounds like something from A.K. Dewdney's Computer Recreations column
    that ran in Scientific American. He also wrote a book,
    The (New) Turing Omnibus: 66 Excursions in Computer Science, that is
    full of good explanations of assorted CompSci principles and concepts.

    http://isbn.nu/0805071660

    And he created Core Wars. If there isn't already a good Ruby version of
    that, it might make for a nice quiz.

    http://www.koth.org/info/akdewdney/index.html
    http://homepages.paradise.net.nz/~anton/cw/corewar-faq.html


    James
    James Britt, Dec 7, 2004
    #5
  6. On Wed, 8 Dec 2004 00:51:46 +0900
    James Edward Gray II <> wrote:

    > On Dec 7, 2004, at 9:28 AM, Brian Schröder wrote:
    >
    > > I'd like to propose something a bit different that stresses the fact
    > > that
    > > evolution is _not_ survival of the _strongest_ but survival of the
    > > _fittest
    > > population_.

    >
    > War of the simulators? I say we unleash Brian's vampire bats on the
    > pregnant sims from Hal's idea and...
    >
    > Seriously. It doesn't have to be an either or thing. It's possible
    > we'll do many simulators over time.
    >
    > My queued quiz directory is currently empty, so the more the merrier.
    > (If you have a good quiz idea, submit now and be first in line!)
    >
    > I'm watching this discussion and archiving the ideas presented.
    >
    > The only thing I'll add is that I'll tend to favor more fleshed out
    > ideas (read: low work for James). Ready-to-run quizzes sent to
    > will be given the highest priority and
    > attention, as always.
    >
    > James Edward Gray II
    >
    >


    Oh, oh, oh. I wanted to stress cooperation and altruism, and now we have
    already arrived at a war ;) My forecastings for mankind are red as a vampire
    bats blood stained teeth ;)

    Regards,

    Brian


    --
    Brian Schröder
    http://www.brian-schroeder.de/
    Brian Schröder, Dec 7, 2004
    #6
  7. On Wed, 8 Dec 2004 00:55:17 +0900
    James Britt <> wrote:

    > Brian Schröder wrote:
    > > On Tue, 7 Dec 2004 23:25:07 +0900
    > > James Edward Gray II <> wrote:
    > >
    > >
    > >>On Dec 6, 2004, at 7:25 PM, Hal Fulton wrote:
    > >>
    > >>
    > >>>This is just off the top of my head. I thought I'd post it instead of
    > >>>emailing, in case people want to discuss it and/or think about it.
    > >>
    > >>[snip description]
    > >>
    > >>Silence means consent?
    > >>

    > >
    > >
    > > I'd like to propose something a bit different that stresses the fact that
    > > evolution is _not_ survival of the _strongest_ but survival of the _fittest
    > > population_.
    > >
    > > Maybe you have heard of this theme before, I also tried to simulate it once
    > > but it didn't work out how I thought, so it should be an interesting
    > > problem.

    >
    > Sounds like something from A.K. Dewdney's Computer Recreations column
    > that ran in Scientific American.


    This is not my source, as I don't read scientific american. But it is a very
    popular example that can be found in a lot of textbooks about evolution. I also
    think it was one of the first theories whose plausiblity was tested by
    simulation. In fact I was introduced to the problem in my cognitive science
    courses at university.

    The interesting thing I found out when trying to simulate it myself, is that it
    is not so easy to make a simulation that has the same outcome as nature. As
    always in the paper it all sounded a lot clearer.

    Regards,

    Brian

    --
    Brian Schröder
    http://www.brian-schroeder.de/
    Brian Schröder, Dec 7, 2004
    #7
  8. James Edward Gray II, Dec 7, 2004
    #8
  9. On Dec 7, 2004, at 3:18 PM, James Edward Gray II wrote:

    > (off-list reply)


    Or not. Sorry.

    James Edward Gray II
    James Edward Gray II, Dec 7, 2004
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Tran
    Replies:
    9
    Views:
    182
    David Tran
    Jan 21, 2005
  2. Lyndon Samson

    Idea for Ruby Quiz - Su Doku solver

    Lyndon Samson, Apr 23, 2005, in forum: Ruby
    Replies:
    6
    Views:
    100
    James Edward Gray II
    Apr 24, 2005
  3. Lyndon Samson

    Ruby Quiz Idea

    Lyndon Samson, Oct 19, 2005, in forum: Ruby
    Replies:
    6
    Views:
    96
    David Balmain
    Oct 21, 2005
  4. Kev Jackson

    Ruby quiz idea

    Kev Jackson, Jan 19, 2006, in forum: Ruby
    Replies:
    3
    Views:
    83
    James Edward Gray II
    Jan 19, 2006
  5. Daniel Moore
    Replies:
    10
    Views:
    306
    James Gray
    Jan 31, 2009
Loading...

Share This Page