Question: Consider the Moran process described in Problem 4 of Problem Set 1. Of interest is whether the the color that eventually dominates has to do

Consider the Moran process described in Problem 4 of Problem Set 1. Of interest is whether the the color that eventually dominates has to do with the color that is gravitated toward when the urn moves out of balance for the first time. (a) Modify your function from Problem Set 1 to MoranProc <- function(n=20){ urn <- rep(c("blue","red"),each=n/2) ...... } where the input n represents the population size. Different from Problem Set 1, the process should keep running until one of the two colors dominates and the other color is eliminated. Note that technically the input n should be an even number, but in case of odd numbers, the rep() function automatically rounds n/2 down to the nearest integer. Instead of returning the sample path, the function should output a single-element logical element, TRUE indicating the color it first gravitates toward is the same as the color that eventually dominates, and FALSE indicating otherwise. (b) For n = 5, 10, 20, run MoranProc(n) 1000 times and calculate the proportion of TRUEs. Briefly comment on the results.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!