# Write a program to simulate… | Good Grade Guarantee!

CS 355/555, Spring 2020, Program I 1There is an ideal, cubic lake consisting of small cells, 100100100, so 1,000,000cells in all. Ideal” means that there are a lot of real world issues to ignore:The edges of the lake areat 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 iterationsand 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 thefollowing actions:Die Probability .1With probability .1 the alga dies.Reproduce Probability .3With probability .3 the alga reproduces. Note that algae are one celledcreatures that reproduce by division, so no partner is necessary. Ignoreany evolutionary considerations.Survive .6With probability .6 the alga survives with no change.{ For each alga in a cell with four algae:Die Probability .3With probability .3 the algae dies, higher than smaller population cells,due to overcrowding.CS 355/555, Spring 2020, Program I 2Migrate Probability .3If an alga elects to migrate, generate three random numbers, x, y, andz. Each number should be -1, 0, or 1 with equal probability. Add thenumbers to the current cell’s coordinates with maximum 100 and min-imum 0, and move the alga to the new cell. If the changes amount tono move, leave the alga where it is.If the cell wants to move to must have room, so if there are four algaein the target cell already the alga cannot move.Survive .4With probability .4 the algae lives but does not migrate, reproduce,or die.{ If a cell has ve or more algae after the last step, enough have to die tobring the total down to four.The above rules apply to each alga, not to a cell. An initial cell contains twoalgae. Each alga may live, reproduce, or die, so one of the two initial algae canreproduce while the other dies, or both may die. An algae from another cell maymigrate in. In any cell, after the rst iteration, both may have lived, both mayhave reproduced, and both may have migrated, so in the second round the cellmay 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 thetwo algae both reproducing is .09, so about 90,000 cells of the 1,000,000 shouldhave 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 itis done with that alga’s life cycle and there is no more action to take with thatalga, so if your program handles each cell in three embedded loops, the cell it ismoving to may not have been handled yet. That means when you get to thatcell you have to make a distinction between algae living in this cell before theiteration and algae that have moved in during this iteration. There are a numberof ways to do this in a program.One option is to have a second matrix that tracks migration, then when an algadecides to move, lower the count of algae in its cell, but record the motion in thesecond matrix. Then, once the life cycle is over, add the two matrices, with aCS 355/555, Spring 2020, Program I 3maximum value of 4 for each cell.Questions to be answered:

Does the population settle down to being roughly the same between itera-tions?

Does the count of cells with 0, 1, 2, 3, and 4 cells settle down to be roughlythe same between iterations?

How long does it take to settle down?

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 cellswith four of migrating, dieing, and surviving from [:3; :3; :4] to [:4; :1; :5] andanswer the same questions.Deliverables:

A report with the following parts:{ Hypothetical answers to the questions. The accuracy of the hypotheticalanswers will not be graded, but the hypotheses should be there andshould be reasonable.{ A set of answers to the questions for the rst set of probabilities and aset of answers for the second set of probabilities.

Source code.The report should probably be one page.

QUALITY: 100% ORIGINAL – **NO PLAGIARISM**.

****REMEMBER TO PRECISE PAGE NUMBER******Hit The Order Button To Order A******Custom Paper****