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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started