> #Ok to post > #Timothy Nasralla, HW6, 9/27/21 #Question 1: Given the information about the > survival rates and fertility of a group of people, set up a recurrence in > human language then express in maple rotation a REC and use GrowthCe to find > the growth constants. > read "/Users/tan88/OneDrive - Rutgers University/Documents/mw5.txt" > Help5() RecToSeq(INI,REC,N), GrowthC(INI,REC,K) , GrowthCe(REC) LeslieMod(SUR,FER): e.g. LeslieMod([9/10,9/10],[0,1,1]); LeslieMat(SUR,FER); e.g. LeslieMat([9/10,9/10],[0,1,1]); > with(LinearAlgebra) #m0(t) = 0.1m0(t-1) + 1.2m1(t-1) + 0.9m2(t-1) + 0.1m3(t-1) > #m1(t) = 0.95m0(t-1), m2(t) = 0.97m1(t-1), m3(t) = 0.9m2(t-1) #In order to > have the first equation entirely in terms of m0. m0(t) = 0.1*m0(t-1) + > 1.2*.95*m0(t-2) + 0.9*0.97*0.95*m0(t-3) + 0.1*0.9*0.97*0.95m0(t-4) > [&x, Add, Adjoint, BackwardSubstitute, BandMatrix, Basis, BezoutMatrix, BidiagonalForm, BilinearForm, CARE, CharacteristicMatrix, CharacteristicPolynomial, Column, ColumnDimension, ColumnOperation, ColumnSpace, CompanionMatrix, CompressedSparseForm, ConditionNumber, ConstantMatrix, ConstantVector, Copy, CreatePermutation, CrossProduct, DARE, DeleteColumn, DeleteRow, Determinant, Diagonal, DiagonalMatrix, Dimension, Dimensions, DotProduct, EigenConditionNumbers, Eigenvalues, Eigenvectors, Equal, ForwardSubstitute, FrobeniusForm, FromCompressedSparseForm, FromSplitForm, GaussianElimination, GenerateEquations, GenerateMatrix, Generic, GetResultDataType, GetResultShape, GivensRotationMatrix, GramSchmidt, HankelMatrix, HermiteForm, HermitianTranspose, HessenbergForm, HilbertMatrix, HouseholderMatrix, IdentityMatrix, IntersectionBasis, IsDefinite, IsOrthogonal, IsSimilar, IsUnitary, JordanBlockMatrix, JordanForm, KroneckerProduct, LA_Main, LUDecomposition, LeastSquares, LinearSolve, LyapunovSolve, Map, Map2, MatrixAdd, MatrixExponential, MatrixFunction, MatrixInverse, MatrixMatrixMultiply, MatrixNorm, MatrixPower, MatrixScalarMultiply, MatrixVectorMultiply, MinimalPolynomial, Minor, Modular, Multiply, NoUserValue, Norm, Normalize, NullSpace, OuterProductMatrix, Permanent, Pivot, PopovForm, ProjectionMatrix, QRDecomposition, RandomMatrix, RandomVector, Rank, RationalCanonicalForm, ReducedRowEchelonForm, Row, RowDimension, RowOperation, RowSpace, ScalarMatrix, ScalarMultiply, ScalarVector, SchurForm, SingularValues, SmithForm, SplitForm, StronglyConnectedBlocks, SubMatrix, SubVector, SumBasis, SylvesterMatrix, SylvesterSolve, ToeplitzMatrix, Trace, Transpose, TridiagonalForm, UnitVector, VandermondeMatrix, VectorAdd, VectorAngle, VectorMatrixMultiply, VectorNorm, VectorScalarMultiply, ZeroMatrix, ZeroVector, Zip] > #m0(t) = 0.1*m0(t-1) + 1.14m0*(t-2) + 0.82935*m0(t-3) + 0.082935*m0(t-4) > REC := [0.1, 1.14, 0.82935, 0.082935] > GrowthCe(REC) 1.385732629 > #Question 2, find the LeslieMat of the previously given example and compare > the growth factors. > SUR := [.95, .97, .9]; FER := [.1, 1.2, .9, .1] > LeslieMat(SUR,FER) > Eigenvalues(%) > #The largest eigenvalue, 1.3857... is equivalent to the growth constant found > in question 1. > #Question 3: Find the transition matrix of the given Markov chain and solve > for P^1000 to find the "page ranks". > #Part A, find the transition matrix P. P := Matrix([[.5, 1/6, 1/6, 1/6], [.2, > .4, .2, .2], [7/30, 7/30, .3, 7/30], [4/15, 4/15, 4/15, .2]]) > #Find P^1000 and analyze the information. > evalf(P^1000) > #Since the rows are identical we are able to determine the page ranks. > #.3152 of the surfers stay on Site 1, .2627 of the surfers stay on Site 2, > .2251 of the surfers stay on Site 3, and .1970 of the #surfers stay on Site 4. > #Therefore, the page ranks (or popularity of the sites) would be, in > decreasing order: S1, S2, S3, S4.