FinalRev

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

Info iconThis 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). % states
Background image of page 1

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

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

This test prep was uploaded on 02/15/2008 for the course CS 100 taught by Professor Fan/vanloan during the Fall '07 term at Cornell.

Page1 / 4

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

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online