{VERSION 3 0 "IBM INTEL LINUX" "3.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 }1 0 0 0 8 4 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 2" 3 4 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 8 2 0 0 0 0 0 0 -1 0 }} {SECT 0 {SECT 1 {PARA 3 "" 0 "" {TEXT -1 57 "Computing the Perron Eige nvector of a Non-negative Matrix" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "with(linalg):\nDigits:=3;\n " }{TEXT -1 256 "For the following matrix M, which is a rearrangement \+ of M2, we compute the egenvector corresponding to the largest eigenval ue. We also do this for the transpose of M. If M = (M_\{ij\}), thin k of m_\{ij\} at the number of times football team i beat team j.\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 408 "M2:= matrix([[0,4,5,2,4, 7],[6,0,4,1,7,6],[5,6.0,0,9,5,5],\n[8,9,1,0,7,8],[6,3,5,3,0,8],[3,4,5, 2,2,0]]):\nM2t :=transpose(M2):\nR:= matrix([[0,0,1,0,0,0],[0,1,0,0,0, 0],[1,0,0,0,0,0],\n[0,0,0,1,0,0],[0,0,0,0,0,1],[0,0,0,0,1,0]]):\nM:= t ranspose(evalm(R&*M2&*R));\nMt :=transpose(M);\nX:=vector([1,1,1,1,1,1 ]);\n#W2:=evalm(M2&*X): L2:=evalm(M2t&*X): S2:=evalm(W2 + L2):\nW:=eva lm(M&*X);\nL:=evalm(Mt&*X);\nS:=evalm(W + L);" }}}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 48 "Loop to compute MX and then normalize the output" }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 88 "MainEigenvect := proc(Q,n)\n local i,k,X,Y,Z,sum;\nX:=vector([1,1,1,1,1,1]);\nY:=evalm(X/6);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 172 "for k from 1 to n\ndo\n X:=evalm( Q&*Y):\n sum:=0;\n for i from 1 to 6\n do \n sum := sum+X[i];\n \+ od;\n Y:=evalm(X/sum);\nod;\n#RETURN(sum, evalm(Y));\nRETURN(evalm(Y ));\nend;\n" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 19 "Do the computati on." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "MainEigenvect(M,4);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "MainEigenvect(M,10);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "MainEigenvect(Mt,10);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "MainEigenvect(Mt,20);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{MARK "0" 0 } {VIEWOPTS 1 1 0 3 2 1804 }