Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

There is an ideal, cubic lake consisting of small cells, 100 100 100, so 1,000,000 cells in all. Ideal means that there are a lot

There is an ideal, cubic lake consisting of small cells, 100 100 100, so 1,000,000 cells in all. Ideal means that there are a lot of real world issues to ignore:

The edges of the lake are flat and the angles are all right angles. There is no impact of the sun on algae growth. You should ignore what the algae consume to grow. Temperature should be regarded as constant.

You should ignore any factor not included in the program statement.

Write a program to simulate the growth of algae in the pond, running iterations and changing the algae in each cell using the following rules:

Problem statement:

  • Each cell starts with two algae
  • For each alga in a cell with three or fewer algae, in each iteration take the following actions: Die Probability .1 With probability .1 the alga dies. Reproduce Probability .3 With probability .3 the alga reproduces. Note that algae are one celled creatures that reproduce by division, so no partner is necessary. Ignore any evolutionary considerations. Survive .6 With probability .6 the alga survives with no change.
  • For each alga in a cell with four algae: Die Probability .3 With probability .3 the algae dies, higher than smaller population cells, due to overcrowding.

If an alga elects to migrate, generate three random numbers, x, y, and z. Each number should be -1, 0, or 1 with equal probability. Add the numbers to the current cells coordinates with maximum 100 and min- imum 0, and move the alga to the new cell. If the changes amount to no move, leave the alga where it is.

If the cell wants to move to must have room, so if there are four algae in the target cell already the alga cannot move.

Survive .4 With probability .4 the algae lives but does not migrate, reproduce,

or die.

If a cell has five or more algae after the last step, enough have to die to bring the total down to four.

The above rules apply to each alga, not to a cell. An initial cell contains two algae. Each alga may live, reproduce, or die, so one of the two initial algae can reproduce while the other dies, or both may die. An algae from another cell may migrate in. In any cell, after the first iteration, both may have lived, both may have reproduced, and both may have migrated, so in the second round the cell may have 0, 1, 2, 3, or 4 algae. Also, an alga in an adjacent cell may elect to mi- grate in. In fact, since the probability of reproducing is .3, the probability of the two algae both reproducing is .09, so about 90,000 cells of the 1,000,000 should have four algae in the second iteration based simply on reproduction probabili- ties. Other algae may migrate in.

Track total algae in the lake and the count of cells with 0, 1, 2, 3, 4 algae.

An important note is that once an alga has decided to migrate to a new cell it is done with that algas life cycle and there is no more action to take with that alga, so if your program handles each cell in three embedded loops, the cell it is moving to may not have been handled yet. That means when you get to that cell you have to make a distinction between algae living in this cell before the iteration and algae that have moved in during this iteration. There are a number of ways to do this in a program.

One option is to have a second matrix that tracks migration, then when an alga decides to move, lower the count of algae in its cell, but record the motion in the second matrix. Then, once the life cycle is over, add the two matrices, with a 3 maximum value of 4 for each cell.

Questions to be answered:

  1. Does the population settle down to being roughly the same between itera- tions?
  2. Does the count of cells with 0, 1, 2, 3, and 4 cells settle down to be roughly the same between iterations?
  3. How long does it take to settle down?
  4. Change the probability algae in cells with three or fewer of dieing, repro- ducing, and surviving from [.1, .3, .6] to [.2, .3, .5] and the probability in cells with four of migrating, dieing, and surviving from [.3, .3, .4] to [.4, .1, .5] and answer the same questions.

Deliverables:

  1. A report with the following parts:
    • Hypothetical answers to the questions. The accuracy of the hypothetical answers will not be graded, but the hypotheses should be there and should be reasonable.
    • A set of answers to the questions for the first set of probabilities and a set of answers for the second set of probabilities.
  1. Source code. The report should probably be one page.

Simulate the following population system:

There is a two dimensional pond of 100x100 squares. Each starts with two algae cells. Then for each square the algae cells live, die, or migrate according to the rules in the file Program I.pdf in the Files section.

Please use Python to solve that.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Contemporary Issues In Database Design And Information Systems Development

Authors: Keng Siau

1st Edition

1599042894, 978-1599042893

Students also viewed these Databases questions

Question

Calculate the possible angles between L and the z axis for l = 2.

Answered: 1 week ago