Homework #2 > Name: Prefered Email: Collaborators: Due February 19th at 23:45:00. Submit electronically via Wolfware @ http://submit.ncsu.edu/. Neither email nor paper submissions will be accepted. > > #Hint: Make liberal use of evalm() > > with(linalg): Warning, the protected names norm and trace have been redefined and unprotected Problem the first: a) For which value(s) of 'a' does the following matrix have rank 2? Explain. [ 1 2 3 4] [ 0 (a+1) a 1] [ 0 a a 0] > > > > b) For which values of 'a' is the following matrix in row echelon form? Explain. [ 1 2 3 4] [ 0 (a-1) a 1] [ 0 a^2-1 a-1 0] > Given the matrix [ 1/2 6 1 ] A = [ 2 0 3 ] [ 4 1 0 ] c) Compute A', the transpose of A. > > > > > Problem the second: a) Is it true that for all square matrices A, B that (AB)^2 = A^2 B^2? Explain your answer, and give examples/counter-examples. > > > > b) Given the binary operation [,]:R^(n,n) x R^(n,n) -> R^(n,n) defined by [A,B] = A*B - B*A decide whether this operation is commutative. (i.e. if it is, show it algebraically, otherwise give an example which shows it is not). > > > [Bonus] Is the operation in part (b) associative? (if it is, show it algebraically, otherwise give an example which shows it is not). > > > > > > Problem the third: Suppose the after birth, the Fibonacci rabbits take 2 months to be able breed (instead of just one), and that each pair gives birth to 2 new pairs of rabbits each month there after. a) If we start with 1 pair of baby rabbits at month 0, how many rabbits in months 1-5? > > > > > b) Write a formula for the number of rabbits in month n in terms of the number of rabbits in previous months (n >= 3). > > > > c) Write a matrix (it should be 3x3) which will compute the population at month n given the population in the previous three months.Use matrix powering to compute the population in month 20. > > Problem the fourth: Given a polynomial f(x) = a_n * x^n + a_(n-1) * x^(n-1) + ... + a_2 x^2 + a_1 x + a_0 (where a_i's are real numbers) we define the polynomial evaluated on the m x m square matrix B as follows: f(B) = a_n * B^n + ... + a_2 * B^2 + a_1 * B + a_0* I_m. Here I_m is the m by m identity matrix. e.g. If f(x) = 3*x^2 - 6, then f(A) = 3*A^2 - 6* I_m If B = matrix([[0, 0, -4], [1, 0, 1], [0, 1, 0]]): a) Compute g(B), where g(x) = x^2 - x + 1 > > I_3 := band([1],3); > > b) Compute h(B), where h(x) = 3*x^3 - 3*x + 12 > > > > If C = [ 0 -4 ] [ 1 2 ] c) Find a polynomial f(x) = x^2 + b x + c with f(C) = 0^(2x2) (Hint: write down f(C) as a matrix with b and c constants, Maple will do this for you quite easily). Can you think of another polynomial which when evaluated on C would give 0_(2x2)? > > I_2 := band([1],2); > > > Problem the last: Given the matrix [ 1/2 6 1 ] A = [ 2 0 3 ] [ 4 1 0 ] a) Is it true that B^(n+m) = B^n B^m for any square matrix B, and all integers n and m? If it is not, provide a counter example. If it is, sketch a short argument why. > > > > b) Compute A^2, A^4, A^6, and A^7 (in that order) using exactly one matrix multiplication for each (this means no using ^ either, though you may reuse matrices you've already computed); > > > > > d) [More Difficult, don't worry too much if you can't get it.] In class we talked about how to compute A^(2^k) efficiently. Consider the binary representation of an integer: m = b0 + b1 * 2 + b2 * 2^2 + ... + bn * 2^n where each bi is 0 or 1. (i.e. (bn b(n-1) .... b1 b0) are the binary digits of m) Keeping in mind parts (b) and (c), how might you adapt the method from class to compute A^m? > > > > > [Bonus] In the case where m = 31, compare the number of operations it takes to compute A^m your way versus computing A*A*A*...*A. > > > > [Bonus] Implement this method in Maple. The following is a Maple function to get a list of the binary digits of m (not guaranteed to be good code, but might be useful): > > binaryDigits := proc(m) > # Call as: binaryDigits(yournumber); > local binary_rep, binary_digits, bit; > binary_rep := convert(m,binary); # Maple converts the number to binary > # Note that it still treats binary_rep as > # as a decimal number! > > binary_digits := []; # Initialize > while binary_rep >= 1 do > bit := irem(binary_rep,10); # Grab the last 1 or 0 > binary_digits := [op(binary_digits),bit]; # Store the bit in our list > binary_rep := (binary_rep - bit) / 10; # Strip the last bit, and shift > od; > RETURN(binary_digits); # Note that the digits are returned in reverse order > end: > > >