FinalRev - 100M Lecture-Based Review Questions for the...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
100M: Lecture-Based Review Questions for the Final Exam 1. (Lecture 27) Modify the following function so that it is more e cient. function w = Update(P,v) % P is an n-by-n array of transition probabilities WITH THE PROPERTY % THAT P(i,j) IS ZERO IF |i-j|>1 % v is an n-by-1 state vector % w is the update of v n = length(v); w = zeros(n,1); for i=1:n % Compute the i-th component of the new state vector.. for j=1:n w(i) = w(i) + P(i,j)*v(j); end end 2. (Lecture 27) Suppose G is a given n-by-n connectivity array with no columns that are zero. Using the function function [pR,pRValues] = PageRank0(G) % G is an n-by-n connectivity array with no columns that are all zeros. % pR is an n-by-1 array with the property that pR(j) is the page % rank of page j. Write a script that prints the indices of all the webpages that have a link pointing to the page with the highest page rank. 3. (Lecture 26) Refer to the following function: function C = CensusData % Packages the data that is in the files Names.dat, Pop.dat, and Rep.dat % to facilitate the analysis of US census data and how it is used to % determine the number of congressional seats for each state. % There are 22 census dates: 1790, 1800,..., 2000. % % C is a length 22 structure array with these fields: % year The year of the census. (1790, 1800,...,2000).
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern