# Problem 1. Compute the incidence matrix L from the diagram. L := < <0, 1, 0, 0, 0, 1, 1>| <1, 0, 1, 1, 0, 1, 0>| <0, 0, 0, 1, 0, 0, 1>| <0, 0, 0, 0, 0, 0, 1>| <0, 0, 0, 1, 0, 1, 1>| <0, 0, 0, 0, 0, 0, 1>| <1, 0, 0, 0, 1, 0, 0>>; # Problem 2. Compute the rankings as follows: interface(displayprecision = 2,rtablesize=25): with(LinearAlgebra): # Compute the iterates a[0] to a[19] and h[0] to h[19]. fix:=x->Normalize(x,inplace): Ones:=Vector(7,1): h[0] := L.Ones; fix(h[0]); a[0] := Transpose(L).Ones; fix(a[0]); h[1] := L.a[0]; fix(h[1]); a[1] := Transpose(L).h[0]; fix(a[1]); for i from 2 to 19 do h[i] := L.Transpose(L).h[i-2]; fix(h[i]); end do: for i from 2 to 19 do a[i] := Transpose(L).L.a[i-2]; fix(a[i]); end do: # Do 10 iterations to find approximate eigenvectors for L^TL and LL^T. H := : for i from 2 to 9 do H := ; end do: A := : for i from 2 to 9 do A := ; end do: # Interpret H and A by using decimals instead of fractions: A7by10:=evalf(A); H7by10:=evalf(H); # Problem 3. Compute approximate eigenvectors # Approximate eigenvectors are the last columns of the two matrices A,H. v1:=Column (A,10): v2:=Column (H,10): evalf(v1),evalf(v2); # Problem 4. Calculate the length of L L^T h and the length of h # Compute eigenvalue lambda2 for v2. ans2:=L.Transpose(L).v2; lambda2:=Norm(ans2)/Norm(v2); # Compute eigenvalue lambda1 for v1. ans1:=Transpose(L).L.v1; lambda1:=Norm(ans1)/Norm(v1); # Problem 5. Verify that h, a are approximate eigenvectors. # Verify eigenpair (lambda2,v2) evalf(ans2-lambda2*v2); # eigenpair (lambda2,v2) verified, if it is nearly zero. # Verify eigenpair (lambda1,v1) evalf(ans1-lambda1*v1); # eigenpair (lambda1,v1) verified, if it is nearly zero. # Problem 6. Is the site with the most incoming links the best # authority? Is the site with the most outgoing links the best hub?