Your PDF file should be named as follows: FistnameLastnameHWxx.pdf, where xx repre- sents the homework number, e.g., 01.
You should write up your own solution, and you are not permitted to share or copy some- one else’s written solution or code. All projects are individual projects.
1. (10 points) For this problem we are going to implement our own Monte Carlo simulation of a web surfer using a network of six nodes represented by the following adjacency graph.
That is, gij = 1 if there is a outgoing link from node i to node j, and 0 otherwise. You may assume that just like in the original formulation of PageRank that 85% of the time a surfer follows a link on the web page being visited and that the other 15% they visit a random page. Compute the probability of landing on each page from up to 5000 simulations of our surfer’s movements on the network above. Also, write down the transition matrix M = [mij]6×6. The transition matrix M is referred as Google matrix (see, Page 332 of the textbook). Note that the sum of elements in each row is equal to 1.
Note: The sample code in the textbook should be a good starting point for this problem.
2. (10 points) Using the same network and probabilities as above, compute the probabilities of landing on each page using multiple surfers. You can do this as follows.
• Initialize a counter for every node.
• Initialize a surfer for every node.
• Have the surfers move to a different node with the probabilities following the transition matrix
M calculated in Problem 1.
• When the surfers move to a different node increment the counter that corresponds to that node by the amount of surfers that land on that node.
• Repeat this process 500 times. Compute the probabilities by dividing the count of each node by the number of simulations carried out.
Do your results agree with the previous problem?
3. (10 points) A famous probability puzzle is the Monty Hall problem. A contestant on a game show is given the choice of choosing between three doors. If they choose the correct door they win a car, otherwise nothing. Behind one door is the car, and behind the other two doors are goats. However, when you pick a door, the host, who knows what’s behind each of the doors, opens a door that you did not pick that contains a goat. The host then gives you the option to stay or switch. Write MATLAB code that simulates the Monty Hall problem. It should output the probability of success if you switch doors as well as the probability of success if you decide to stay. Run the code 1000 times. Do the results converge to what your intuition expected them to?