Purpose of the assignment

This assignment will help you construct a deeper understanding of game theory and gain practice writing functions. The development of both skills will faciliate your next programming project.

Task

Consider the Hawk-Dove game covered in lecture. Your task is to write a function that simulates the change in Hawk frequency over time caused by natural selection. Your function should take the following arguments: V = the value of the resource, C = the cost of injury, p0 = the initial hawk frequency, and N = the number of generations to simulate. This function should then return the vector of hawk frequency over time.

Once you have your function written, test it by simulating the following game: V = 0.5, C = 0.3, p0 = 0.1, w0 = 0.4, and N = 50. Plot the results.

Post your group’s code on the “Hawk-Dove discussion”.