For this homework assignment you'll be running a simulation. The goal is to implement the simulation in a smart way, using Python data structures, NumPy, and Matplotlib effectively.
Suppose that M students each have N songs on their smartphone. For the sake of simplicity, assume that each student has the same N songs on their phone as every other student does. Furthermore, for each student, each song has a number between 0 and 1 associated with it. For each student, these sum of those numbers must be 1. They can be thought of as the probability that the student plays that song. For each student, the song with the largest number associated with it will be referred to as the student's 'favorite' song.
The simulation takes place over a series of time steps $t_0, t_1,\dots, t_k$. At each time step,
What happens after a long time?
This assignment is worth twenty points. When complete, you should email the script to Dr. Johnson. The due date is Wednesday, June 22, by 9:00AM. Late assignments will be penalized 1 point per day (that's 0.5 full letter grades per day late). Submission anytime after 9:00AM on June 22 counts as 1 day late.
You may discuss and work on this assignment with your peers. However, you must submit your own work, copying is not permitted. You will be graded individually, and if your work appears to be a copy of someone else's, I may ask for you to demonstrate in person and on the spot your ability to write the code to solve a similar problem.
Submit your work as a Python script file (.py). I should be able to run the script and see the output. I should not need to make any changes to the file.
Implement the simulation. Your implementation must:
In [ ]: