20260412 Below is a reminder of some MATLAB experiments NOT for points. The problems for points are farther below. ---------- ---------- ---------- ---------- ---------- Use R2022b MATLAB or later. (1) Test whether symbolic MATLAB is installed. Start MATLAB and do commands: a = [1 2 ; 3 4] b = [4 ; 5] syms x y eqn = a * [x ; y] == b solu = solve([eqn], [x, y]) solu.x solu.y (2) For bigger square matrices we may define: badA = [1 2 3 ; 4 5 6 ; 7 8 9] det(badA) badA^(-1) A = sym([1 2 3 ; 4 5 6 ; 7 8 9]) and B = sym([6 ; 15 ; 24]) det(A) A^(-1) syms x y z eqn = A * [x ; y ; z] == B solu = solve([eqn], [x, y, z]) solu.x solu.y solu.z (3) In (2) still only one solution [0;3;0], MATLAB ignores kernel [1;-2;1] HOWEVER, there is the nullspace operator and the range operator null(A) (gives orthogonal basis) colspace(A) (gives orthogonal basis) So try: null(A) colspace(A) ---------- ---------- ---------- ---------- ---------- Problems for points. Beware that we want EXACT answers, no rounding. So 1/3 is good, but 0.3333333333 is not. All forms of collaboration are OK, but turn in your final work in your own handwritten form (some students hand-write comments on printouts, OK too). Consider the abstract matrices A = [1 a 0 0] [0 1 0 0] [0 b 1 0] [0 c 0 1] and B = [1 x 0 0] [0 1 0 0] [0 y 1 0] [0 z 0 1] 1. Compute some powers of A, namely A^0, A^1, A^2, A^3, A^4. 2. Let n be an arbitrary non-negative integer. Compute A^n. 3. Propose a good definition of the square root A^(1/2) of A, based on question 1 above (in this case MATLAB may give you the good answer). 4. Compute both matrix products A * B and B * A. What makes the result remarkable (a propery which usually doesn't hold for matrices)? 5. Let A^t and B^t be the transposes of A and B respectively (even google knows how to write the transpose of a matrix in MATLAB). Compute A * B^t and B * A^t. Subjective question: Do you see differences and/or similarities between the two matrix products, and can you explain them? 6. Consider the abstract matrix with k not equal to 1 C = [1 a 0 0] [0 k 0 0] [0 b 1 0] [0 c 0 1] Find a nice form for C^n (MATLAB helps, consider simplifications to make the final answer look better). We precede problem 7 below with a little explanation. Look up `binomial coefficient' on (for example) Wikipedia. Using google to search for `binomial coefficient' gives you many links like the one for Wikipedia. MATLAB uses the function nchoosek for binomial coefficients. So nchoosek(5,2) returns 10. For small k, for example a fixed k satisfying 0 <= k <= 3, we can write nchoosek(n,k) as a simple polynomial in n (although MATLAB usually doesn't). 7. Consider abstract matrix A = [a 1 0 0] [0 a 1 0] [0 0 a 1] [0 0 0 a] (We state without proof: A is not diagonalizable.) (a) Compute A^1 = A, A^2 = A*A, A^3 = A*A*A, and A^4 = A*A*A*A. (b) Give the correct formula for A^n, where n is an arbitrary positive integer. 8. Compute the null space N(B) and the range R(B) of abstract matrix B, where B = [0 1 0 0] [0 a 1 0] [0 0 a 1] [0 0 0 0] [0 0 0 b] 9. Find eigenvalues and eigenvectors of abstract matrix A = [4 1 -1] [4 0 2] [2 -1 3] Write your resulting diagonal matrix C as a product as in equation C = P^(-1) * A * P.