ekiim's blog

Exercises

  1. Compute the products

    [401010401][345]\begin{bmatrix} 4 & 0 & 1 \\ 0 & 1 & 0 \\ 4 & 0 & 1 \\ \end{bmatrix} \begin{bmatrix} 3 \\ 4 \\ 5 \end{bmatrix}

    And

    [100010001][523]\begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{bmatrix} \begin{bmatrix} 5 \\ -2 \\ 3 \end{bmatrix}

    And

    [2013][11] \begin{bmatrix} 2 & 0 \\ 1 & 3 \end{bmatrix} \begin{bmatrix} 1 \\ 1 \end{bmatrix}

    Draw a pair of perpendicular axes and mark off the vectors two the points x=2,y=1x=2, y=1, and x=0,y=3x=0, y=3. Add the two vectors by completng the parallelogram.

  2. Working a column at a time, compute the products

    [415161][13]\begin{bmatrix} 4 & 1 \\ 5 & 1 \\ 6 & 1 \\ \end{bmatrix} \begin{bmatrix} 1 \\ 3 \end{bmatrix}

    And

    [123456789][010]\begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \\ \end{bmatrix} \begin{bmatrix} 0 \\ 1 \\ 0 \end{bmatrix}

    And

    [436689][1213] \begin{bmatrix} 4 & 3 \\ 6 & 6 \\ 8 & 9 \end{bmatrix} \begin{bmatrix} \frac{1}{2} \\ \frac{1}{3} \end{bmatrix}

  3. Find two inner products and a matrix product:

    [127][127]\begin{bmatrix} 1 & -2 & 7 \end{bmatrix} \begin{bmatrix} 1 \\ -2 \\ 7 \end{bmatrix}

    And

    [127][351]\begin{bmatrix} 1 & -2 & 7 \end{bmatrix} \begin{bmatrix} 3 \\ 5 \\1 \end{bmatrix}

    And

    [127][351]\begin{bmatrix} 1 \\ -2 \\ 7 \end{bmatrix} \begin{bmatrix} 3 & 5 &1 \end{bmatrix}

    The first gives the lengths of the vector (squared).

  4. If an mm by nn matrix AA multiplies an nn-dimensional vector xx, how many eparate multiplications are involved? What if AA multiplies an nn by pp matrix BB?

  5. Compute the product Ax=[360022111][211] Ax = \begin{bmatrix} 3 & -6 & 0 \\ 0 & 2 & -2 \\ 1 & -1 & -1 \\ \end{bmatrix} \begin{bmatrix} 2 \\ 1 \\ 1 \end{bmatrix} For this matrix AA, find a solution vector to the system Ax=0Ax=0, which zeros on the right side of all three equations. Can you find more than one solution?

  6. Write down the 3 by 2 matrices AA and BB which have entries aij=i+ja_{ij} = i + j and bij=(1)i+jb_{ij} = (-1)^{i+j}.

  7. Express the inner product of the row vector y=[y1y2yn]y=\begin{bmatrix} y_1 & y_2 & \dots & y_n \end{bmatrix}, and the column vector xx in summation notation.

  8. Give a 3 by 3 example (not just A=0A=0) of

    1. a diagonal matrix: $a_{ij} = 0 if iji \neq j;
    2. a symetric matrix: aij=ajia_{ij} = a_{ji} for all ii and jj;
    3. a upper triangular matrix: aij=0a_{ij} = 0 if i>ji > j;
    4. a skew-symmetric matrix: aij=ajia_{ij} = -a_{ji} for all ii and jj.
  9. Do the following subroutines multiply AxAx by rows or columns?

    DO 10I=1,N10I = 1, N
    DO 10J=1,N10J = 1, N
    10 B(I)=B(I)+A(I,J)X(J)B(I) = B(I) + A(I,J) * X(J)

    DO 10J=1,N10J = 1, N
    DO 10I=1,N10I = 1, N
    10 B(I)=B(I)+A(I,J)X(J)B(I) = B(I) + A(I,J) * X(J)

    The result are mathematically equivalent, assuming that initially all B(I)=0B(I) = 0, but the structure of FORTRAN makes the second code slightly more efficient (Appendix C). It is much more efficient on a vector machine like the CRAY, since the inner loop can change many $B(I) at once — where the first code makes any changes to a single B(I) and does not vectorize.

  10. If the entries of AA are aija_{ij}, use subscript notation to write down

    1. the first pivot
    2. the multiplier Ii1I_{i1}, of row 1 to be substracted from row ii
    3. the new entry that replaces aija_ij after that substraction
    4. the second pivot
  11. True or false; give a specific counterexample when false

    1. If the first and third columns of BB are the same, so are the first and third columns of ABAB
    2. If the first and third rows of BB are the same, so are the first and third rows of ABAB
    3. If the first and third rows of A are the same, so are the first and third rows of ABAB.
    4. (AB)2=A2B2(AB)^2 = A^2B^2
  12. The first row of ABAB is a linear combination of all the rows of BB. What are the coefficients in this combination, and what is the first row of ABAB if A=[214011],B=[110110]? A = \begin{bmatrix} 2&1&4\\0&-1&1\end{bmatrix}, B=\begin{bmatrix}1&1\\0&1\\1&0\end{bmatrix}\text{?}

  13. The product of two lower triangular matrices is again lower triangular (all its entries abover the main diagonal are zero). Confirm this with a 3 by 3 example, and then explan how it follows from the laws of matrix multiplication.

  14. By trial and error find examples of 2 by 2 matrices such that

    1. A2=IA^2 = -I, having only real entries;
    2. B2=0B^2 = 0, although B0B\neq0
    3. CD=DCCD = -DC, not allowing the case CD=0CD=0
    4. FE=0FE=0, although no enteries of EE or FF are zero.
  15. Describe the rows of EAEA and the columns of AEAE if E[1701]E\begin{bmatrix}1&7\\0&1\end{bmatrix}

  16. Check the associative law (EF)G=E(FG)(EF)G=E(FG) for matrices in the text.

  17. Suppose AA commutes with every 2 by 2 matrix (AB=BAAB=BA) and in particular

    A=[abcd]A=\begin{bmatrix}a&b\\c&d\end{bmatrix}

    commutes with

    B1=[1000]B_1=\begin{bmatrix}1&0\\0&0\end{bmatrix}

    and

    B2=[0100]B_2=\begin{bmatrix}0&1\\0&0\end{bmatrix}

    Show that a=da=d and b=c=0b=c=0 if AB=BAAB=BA for all matrices BB, then AA is a mupliple of the identity.

  18. Let xx be the column vector with components 1,0,,01, 0,\dots, 0. Show that the rule (AB)x=A(Bx)(AB)x=A(Bx) forces the first column of ABAB to equal AA times the first column of BB.

  19. Which of the following matrices are guaranteed to equal (A+B)2(A + B)^2? (B+A)2,(A2+2AB+B2),A(A+B)+B(A+B),(A+B)(A+B),A2+AB+BA+B2(B+A)^2, (A^2 + 2AB+B^2),A(A+B) + B(A+B), (A+B)(A+B), A^2 + AB + BA + B^2

  20. In summation notation, the i,ji, j entries of ABAB is (AB)ij=kaikbkj(AB)_{ij} = \sum_k a_{ik}b_{kj}, If AA and BB are nn by nn matrices with all entries equal to 1, find (AB)ij(AB)_{ij}. The same notation turns associative law (AB)C=A(BC)(AB)C=A(BC) in to j(kaikbkj)cjl=kaik(jbkjcjl)\sum_j(\sum_k a_{ik}b_{kj})c_jl = \sum_k a_{ik}(\sum_j b_{kj}c_{jl}) Compute both sides if CC is alos nn by nn, with every cjl=2c_{jl} = 2.

  21. There is a forth way of looking at matrix multilication, as columns times roews. If the columns of AA are c1,,cnc_1, \dots, c_n, and the rows of BB are vectors r1,rnr_1, \dots r_n, then ciric_ir_i is the matrix and AB=c1r1+c2r2++cnrn AB = c_1r_1 + c_2r_2 + \dots + c_nr_n

    1. Give a 2 by 2 example of this rule for matrix mutiplication.
    2. Explain whi the right side gives the correct value k=1naikbkj\sum_{k=1}^n a_{ik}b_{kj} for very entry (AB)ij(AB)_{ij}
  22. The matrices that “rotate” the xyx-y plane are A(θ)=[cosθsinθ sinθcosθ]A(\theta) = \begin{bmatrix} \cos{\theta} & -\sin{\theta} \\\ \sin{\theta} & \cos{\theta} \end{bmatrix}.

    1. Verify A(θ1)A(θ2)=A(θ1+θ2)A(\theta_1)A(\theta_2) = A(\theta_1 + \theta_2) from the identities for cos(θ1+θ2)\cos(\theta_1+\theta_2) and cos(θ1+θ2)\cos(\theta_1+\theta_2).
    2. What is A(θ)A(\theta) times A(θ)A(-\theta).
  23. For the matrices A=[12121212] and B=[1001] and C=AB=[12121212] A = \begin{bmatrix} \frac{1}{2} & \frac{1}{2} \\ \frac{1}{2} & \frac{1}{2} \end{bmatrix} \text{ and } B = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix} \text{ and } C = AB = \begin{bmatrix} \frac{1}{2} & -\frac{1}{2} \\ \frac{1}{2} & -\frac{1}{2} \end{bmatrix} find all the powers A2,A3A^2, A^3 (which is A2A^2 times AA),\dots, and B2,B3,B^2, B^3, \dots, and C2,C3,C^2, C^3, \dots.

  24. More general than multiplication by columns is block multiplication. If matrices are separated into blocks (submatrices) and their shape makes block multiplication posible, then it is allowed: [xxxxxxxxx][xxxxxxxxx] or [xxxxxxxx][xxxxxxxx] or  \left[\begin{array}{cc|c} x & x & x \\ x & x & x \\ \hline x & x & x \end{array}\right] \left[\begin{array}{cc|c} x & x & x \\ x & x & x \\ \hline x & x & x \end{array}\right] \text{ or } \left[\begin{array}{cc|cc} x & x & x & x \\ x & x & x & x \end{array}\right] \left[\begin{array}{cc} x & x \\ x & x \\ \hline x & x \\ x & x \end{array}\right] \text{ or } \dots

    1. Replace those x’s by numbers and confirm that block multiplication succeds.
    2. Give two more examples (with x’s) if AA is 3 by 4 and BB is 4 by 2. Vertical cuts in AA must match by horizonal cuts in BB.