Study Guides / Linear Algebra / Exercise session 2
EXERCISE SESSION 2 · ETH ZURICH · HS19 · linalg

Linear Systems and Gaussian Elimination

Systems of linear equations, Gaussian elimination

SB
Steven Battilana Quant · ex-ETH

Review

Definition Euler's formula
eiφ=cos⁡φ+isin⁡φe^{i \varphi} = \cos \varphi + i \sin \varphi
Definition polar form

The polar form of z=x+iy∈Cz = x + iy \in \mathbb{C} is (careful! φ∈(−π,π]\varphi \in (-\pi, \pi])

z= reiφ,⇔Euler’s formulaz= r(cos⁡φ+isin⁡φ),with r=∥z∥,x=r cos⁡φ,y=r sin⁡φ.\begin{aligned} z = \,&re^{i \varphi},\\ \overset{\text{Euler's formula}}{\Leftrightarrow} z = \,& r(\cos \varphi + i \sin \varphi),\\ \text{with } &r = \Vert z \Vert,\\ &x = r\, \cos \varphi,\\ &y = r\, \sin \varphi. \end{aligned}φ={arctan⁡(yx),x>0arctan⁡(yx)+π,x<0∧y≥0arctan⁡(yx)−π,x<0∧y<0π2,x=0∧y>0−π2,x=0∧y<0undefined,x=0∧y=0\varphi = \begin{cases} \arctan (\frac{y}{x}), &x>0\\ \arctan (\frac{y}{x}) + \pi, &x<0 \wedge y \geq 0\\ \arctan (\frac{y}{x}) - \pi, &x<0 \wedge y < 0\\ \frac{\pi}{2}, &x = 0 \wedge y > 0\\ -\frac{\pi}{2}, &x = 0 \wedge y < 0\\ \text{undefined}, &x = 0 \wedge y = 0 \end{cases}
Remark

In principle, the angle φ′\varphi' in the interval (0,2π](0, 2\pi] can be computed by first computing the angle in the interval (−π,π](-\pi, \pi] as described above and then, only if it is negative, increasing it by 2π2\pi:

φ′={φ+2π,φ<0φ,otherwise.\varphi' = \begin{cases} \varphi + 2\pi, &\varphi < 0\\ \varphi, &\text{otherwise.} \end{cases}
Remark

As an alternative to arctan, φ\varphi can also be computed via sine and cosine:

φ∈[0,π]:cos⁡(φ)=xr⟺φ=arccos⁡(xr)φ∈[−π2,π2]:sin⁡(φ)=yr⟺φ=arcsin⁡(yr)\begin{aligned} \varphi \in [0, \pi]: \quad \cos(\varphi) &= \frac{x}{r} \qquad \Longleftrightarrow \qquad \varphi = \arccos\left(\frac{x}{r}\right)\\ \varphi \in [-\tfrac{\pi}{2}, \tfrac{\pi}{2}]: \quad \sin(\varphi) &= \frac{y}{r} \qquad \Longleftrightarrow \qquad \varphi = \arcsin\left(\frac{y}{r}\right) \end{aligned}

Linear Systems

The general case has mm linear equations and nn unknowns and forms a linear system. If

m>n, then the linear system is overdetermined (solvable numerically)m<n, then the linear system is underdetermined (solvable analytically)m=n, (solvable analytically)\begin{aligned} m &> n, \text{ then the linear system is overdetermined (solvable numerically)}\\ m &< n, \text{ then the linear system is underdetermined (solvable analytically)}\\ m &= n, \text{ (solvable analytically)} \end{aligned} a11x1+a12x2+⋯+a1nxn=b1a21x1+a22x2+⋯+a2nxn=b2⋮⋮am1x1+am2x2+⋯+amnxn=bm}⇒Ax=b\left. \begin{aligned} a_{11}x_1 + a_{12}x_2 + \cdots + a_{1n}x_n &= b_1 \quad\\ a_{21}x_1 + a_{22}x_2 + \cdots + a_{2n}x_n &= b_2\\ \vdots \qquad \qquad \qquad \qquad \qquad &\vdots\\ a_{m1}x_1 + a_{m2}x_2 + \cdots + a_{mn}x_n &= b_m \end{aligned} \right\} \quad \Rightarrow \quad A\boldsymbol{x} = \boldsymbol{b}

where

A=(a11a12⋯a1na21a22⋯a2n⋮⋮am1am2⋯amn),x=(x1⋮xn),b=(b1⋮bm)A = \begin{pmatrix} a_{11} & a_{12} & \cdots & a_{1n}\\ a_{21} & a_{22} & \cdots & a_{2n}\\ \vdots & & & \vdots\\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{pmatrix} ,\quad \boldsymbol{x} = \begin{pmatrix} x_1\\ \vdots \\ x_n \end{pmatrix} ,\quad \boldsymbol{b} = \begin{pmatrix} b_1\\ \vdots \\ b_m \end{pmatrix}

A=^A \mathrel{\hat{=}} coefficient matrix, x=^x \mathrel{\hat{=}} vector of unknowns, b=^b \mathrel{\hat{=}} solution vector (RHS)

Approach: Gaussian elimination

Remark

Exactly one of the following holds for a linear system. It has

  • exactly one solution, then it is called a regular linear system
  • no solution, then it is called a singular linear system
  • ∞\infty many solutions, then it is also called a singular linear system
Remark Recipe: Gaussian elimination

Given: linear system Ax=bA\mathbf{x=b} (for m<n ∨ m=nm<n\, \vee\, m=n)

A=(a11a12⋯a1na21a22⋯a2n⋮⋮am1am2⋯amn),b=(b1⋮bm)A = \begin{pmatrix} a_{11} & a_{12} & \cdots & a_{1n}\\ a_{21} & a_{22} & \cdots & a_{2n}\\ \vdots & & & \vdots\\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{pmatrix} ,\quad \boldsymbol{b} = \begin{pmatrix} b_1\\ \vdots \\ b_m \end{pmatrix}

Wanted:

x=(x1⋮xn)\boldsymbol{x} = \begin{pmatrix} x_1\\ \vdots \\ x_n \end{pmatrix}
  1. Set up the augmented matrix

    (a11⋯a1nb1⋮⋮⋮am1⋯amnbm)=(Ab).\left(\begin{array}{ccc|c} a_{11} & \cdots & a_{1n} & b_1\\ \vdots & & \vdots & \vdots \\ a_{m1} & \cdots & a_{mn} & b_m \end{array}\right) = \left(\begin{array}{c|c} A & \boldsymbol{b} \end{array}\right) .
  2. Using operations of type (I), (II), (III), bring (Ab)\left(\begin{array}{c|c} A & b \end{array}\right) into the following form (row echelon form, i.e. it does not necessarily have to give the identity matrix!):

    (10x1⋱⋮01xn)⇔(𝟙x), where 𝟙=^identity matrix\left(\begin{array}{ccc|c} 1 & & 0 & x_1\\ & \ddots & & \vdots\\ 0 & & 1 & x_n \end{array}\right) \Leftrightarrow \left(\begin{array}{c|c} \text{𝟙} & \boldsymbol{x} \end{array}\right) \text{, where } \text{𝟙} \mathrel{\hat{=}} \text{identity matrix}
    • (I) Swap rows
    • (II) Add/subtract one row (equation) to/from another
    • (III) Multiply a row (equation) by kk with k∈R∖{0}k \in \mathbb{R} \setminus \{0\}
  3. This works best if you form the following ratio (we will need it again later!)

    lij:=aijajjl_{ij} := \frac{a_{ij}}{a_{jj}}

    and use it as follows

    (i)(ii)(iii)(a11x1a12x2a13x3b1RHSa21a22a23b2a31a32a33b3)\rule{0pt}{3em} \begin{array}{r} (i)\\ (ii)\\ (iii) \end{array} \left(\begin{array}{ccc|c} \overset{\smash{\raisebox{0.5em}{$\scriptstyle x_1$}}}{a_{11}} & \overset{\smash{\raisebox{0.5em}{$\scriptstyle x_2$}}}{a_{12}} & \overset{\smash{\raisebox{0.5em}{$\scriptstyle x_3$}}}{a_{13}} & \overset{\smash{\raisebox{0.5em}{\scriptsize RHS}}}{b_1}\\ a_{21} & a_{22} & a_{23} & b_2\\ a_{31} & a_{32} & a_{33} & b_3 \end{array}\right) ⇝(ii)−l21⋅(i)  (a11a12a13b1a21−l21a11a22−l21a12a23−l21a13b2−l21b1a31a32a33b3)⇝(iii)−l31⋅(i)  (a11a12a13b10a22~a23~b2~a31−l31a11a32−l31a12a33−l31a13b3−l31b1)⇝  (a11a12a13b10a22~a23~b2~0a32~a33~b3~)…\begin{aligned} \stackrel{(ii) - l_{21} \cdot (i)}{\leadsto} \; & \left(\begin{array}{ccc|c} a_{11} & a_{12} & a_{13} & b_1\\ a_{21} - l_{21}a_{11} & a_{22} - l_{21}a_{12} & a_{23} - l_{21}a_{13}& b_2 - l_{21}b_1\\ a_{31} & a_{32} & a_{33} & b_3 \end{array}\right)\\[1.5ex] \stackrel{(iii) - l_{31} \cdot (i)}{\leadsto} \; & \left(\begin{array}{ccc|c} a_{11} & a_{12} & a_{13} & b_1\\ 0 & \widetilde{a_{22}} & \widetilde{a_{23}} & \widetilde{b_2}\\ a_{31} - l_{31}a_{11} & a_{32} - l_{31}a_{12} & a_{33} - l_{31}a_{13}& b_3 - l_{31}b_1 \end{array}\right)\\[1.5ex] \leadsto \; & \left(\begin{array}{ccc|c} a_{11} & a_{12} & a_{13} & b_1\\ 0 & \widetilde{a_{22}} & \widetilde{a_{23}} & \widetilde{b_2}\\ 0 & \widetilde{a_{32}} & \widetilde{a_{33}} & \widetilde{b_3} \end{array}\right) \dots \end{aligned}
Example 1

Solve the following linear system:

2x1−x2−2x3=24x1−2x2+2x3=−28x1−4x2+6x3=−6\begin{aligned} 2x_1 - x_2 - 2x_3 &= 2 \quad\\ 4x_1 - 2x_2 + 2x_3 &= -2 \quad\\ 8x_1 - 4x_2 + 6x_3 &= -6 \quad \end{aligned}
Show solutionHide solution 2x1−x2−2x3=24x1−2x2+2x3=−28x1−4x2+6x3=−6}⇒(2−1−224−22−28−46−6)\left. \begin{aligned} 2x_1 - x_2 - 2x_3 &= 2 \quad\\ 4x_1 - 2x_2 + 2x_3 &= -2 \quad\\ 8x_1 - 4x_2 + 6x_3 &= -6 \quad \end{aligned} \right\} \quad \Rightarrow \quad \left(\begin{array}{ccc|c} 2 & -1 & -2 & 2\\ 4 & -2 & 2 & -2\\ 8 & -4 & 6 & -6 \end{array}\right)⇝(ii)−l21⋅(i)  (2−1−22006−68−46−6)⇝(iii)−l31⋅(i)  (2−1−22006−60014−14)⇝16⋅(ii)  (2−1−22001−10014−14)⇝(iii)−141⋅(ii)  (2−1−22001−10000)⇝(i)−(−2)1⋅(ii)  (2−100001−10000)⇝12⋅(i)  (1−1200001−10000)=:(∗)\begin{aligned} \stackrel{(ii) - l_{21} \cdot (i)}{\leadsto} \; & \left(\begin{array}{ccc|c} 2 & -1 & -2 & 2\\ 0 & 0 & 6 & -6\\ 8 & -4 & 6 & -6 \end{array}\right)\\[1.5ex] \stackrel{(iii) - l_{31} \cdot (i)}{\leadsto} \; & \left(\begin{array}{ccc|c} 2 & -1 & -2 & 2\\ 0 & 0 & 6 & -6\\ 0 & 0 & 14 & -14 \end{array}\right)\\[1.5ex] \stackrel{\frac{1}{6} \cdot (ii)}{\leadsto} \; & \left(\begin{array}{ccc|c} 2 & -1 & -2 & 2\\ 0 & 0 & 1 & -1\\ 0 & 0 & 14 & -14 \end{array}\right)\\[1.5ex] \stackrel{(iii) - \frac{14}{1} \cdot (ii)}{\leadsto} \; & \left(\begin{array}{ccc|c} 2 & -1 & -2 & 2\\ 0 & 0 & 1 & -1\\ 0 & 0 & 0 & 0 \end{array}\right)\\[1.5ex] \stackrel{(i) - \frac{(-2)}{1} \cdot (ii)}{\leadsto} \; & \left(\begin{array}{ccc|c} 2 & -1 & 0 & 0\\ 0 & 0 & 1 & -1\\ 0 & 0 & 0 & 0 \end{array}\right)\\[1.5ex] \stackrel{\frac{1}{2} \cdot (i)}{\leadsto} \; & \left(\begin{array}{ccc|c} 1 & -\frac{1}{2} & 0 & 0\\ 0 & 0 & 1 & -1\\ 0 & 0 & 0 & 0 \end{array}\right) =: (*) \end{aligned}

The 3rd row contains only zeros ⇒∞\Rightarrow \infty many solutions. Back substitution in the 2nd row gives:

x3=−1x_3 = -1

Back substitution in the 1st row gives:

x1−12x2=0⇔x1=12x2x_1 - \frac{1}{2} x_2 = 0 \quad \Leftrightarrow \quad x_1 = \frac{1}{2} x_2

Choose e.g. x2=t∈Rx_2=t \in \mathbb{R} as a free parameter

L={(12tt−1)∣t∈R}\mathbb{L} = \left\{ \left. \begin{pmatrix} \frac{1}{2} t\\ t \\ -1 \end{pmatrix} \right| t \in \mathbb{R} \right\}
Remark

If instead of (∗)(*) we had obtained e.g.

(1−1200001−10002)\left(\begin{array}{ccc|c} 1 & -\frac{1}{2} & 0 & 0\\ 0 & 0 & 1 & -1\\ 0 & 0 & 0 & 2 \end{array}\right)

there would be no solution, because the 3rd row reads 0=20=2, which is famously a contradiction.

Example 2

For which values of a∈Ra \in \mathbb{R} does the following homogeneous linear system have a nontrivial (nonzero) solution?

x1−x3=0−2x1+ax2−x3=0a2x1+2ax2−10x3=0\begin{aligned} x_1 - x_3 &= 0 \quad\\ -2x_1 + ax_2 - x_3 &= 0 \quad\\ a^2x_1 + 2ax_2 - 10x_3 &= 0 \quad \end{aligned}
Show solutionHide solution x1−x3=0−2x1+ax2−x3=0a2x1+2ax2−10x3=0}⇒(10−10−2a−10a22a−100)\left. \begin{aligned} x_1 - x_3 &= 0 \quad\\ -2x_1 + ax_2 - x_3 &= 0 \quad\\ a^2x_1 + 2ax_2 - 10x_3 &= 0 \quad \end{aligned} \right\} \quad \Rightarrow \quad \left(\begin{array}{ccc|c} 1 & 0 & -1 & 0\\ -2 & a & -1 & 0\\ a^2 & 2a & -10 & 0 \end{array}\right)(10−10−2a−10a22a−100)⇝(10−1−2a−1a22a−10)⇝(ii)−l21⋅(i)(10−10a−3a22a−10)\left(\begin{array}{ccc|c} 1 & 0 & -1 & 0\\ -2 & a & -1 & 0\\ a^2 & 2a & -10 & 0 \end{array}\right) \leadsto \begin{pmatrix} 1 & 0 & -1\\ -2 & a & -1\\ a^2 & 2a & -10 \end{pmatrix} \stackrel{(ii) - l_{21} \cdot (i)}{\leadsto} \begin{pmatrix} 1 & 0 & -1\\ 0 & a & -3\\ a^2 & 2a & -10 \end{pmatrix}⇝(iii)−l31⋅(i)(10−10a−302aa2−10)⇝(iii)−l32⋅(ii)(10−10a−300a2−4)\stackrel{(iii) - l_{31} \cdot (i)}{\leadsto} \begin{pmatrix} 1 & 0 & -1\\ 0 & a & -3\\ 0 & 2a & a^2-10 \end{pmatrix} \stackrel{(iii) - l_{32} \cdot (ii)}{\leadsto} \begin{pmatrix} 1 & 0 & -1\\ 0 & a & -3\\ 0 & 0 & a^2-4 \end{pmatrix}

Case 1: x3≠0x_3 \neq 0

The 3rd row gives us

(a2−4)x3=0⇒a2−4=0⇔a=±2(a^2-4)x_3 = 0 \quad \Rightarrow \quad a^2-4 = 0 \quad \Leftrightarrow \quad a = \pm 2

We choose x3=:s, s∈R∖{0}x_3 =: s, \, s \in \mathbb{R} \setminus \{0\} as a free parameter. Back substitution in the 2nd row gives

ax2−3s=0⇔ax2=3s⇔x2=3saax_2 - 3s = 0 \quad \Leftrightarrow \quad ax_2 = 3s \quad \Leftrightarrow \quad x_2 = \frac{3s}{a}

Back substitution in the 1st row gives

x1−s=0⇔x1=sx_1 -s = 0 \quad \Leftrightarrow \quad x_1 = s

So we have already arrived at the solution for this case:

L={(s3sas)∣s∈R∖{0},a=±2}\mathbb{L} = \left\{ \left. \begin{pmatrix} s\\ \frac{3s}{a}\\ s \end{pmatrix} \right| s \in \mathbb{R} \setminus \{0\}, a = \pm 2 \right\}

Case 2: x3=0x_3 = 0

Then the 3rd row says nothing about a. So we have to fall back on the 2nd row.

ax2−3x3=0⇒ax2−3⋅0=0⇒ax2=0⇒a=0 ∨ x2=0ax_2 -3x_3 = 0 \quad \Rightarrow \quad ax_2 - 3 \cdot 0 = 0 \quad \Rightarrow \quad ax_2 = 0 \quad \Rightarrow \quad a = 0\, \vee \, x_2 = 0

(a) a = 0, x2≠0x_2 \neq 0:

We choose x2=t, t∈R∖{0}x_2 = t, \, t \in \mathbb{R} \setminus \{0\} as a free parameter. Back substitution in the 1st row gives x1=0x_1 = 0. So we obtain the solution:

L={(0t0)∣t∈R∖{0},a=0}\mathbb{L} = \left\{ \left. \begin{pmatrix} 0\\ t\\ 0 \end{pmatrix} \right| t \in \mathbb{R} \setminus \{0\}, a = 0\right\}

(b) x2=0x_2 = 0: Then the 1st row gives: x1=0x_1 = 0 This case only yields the trivial solution (000)\begin{pmatrix} 0 \\ 0\\ 0 \end{pmatrix} and can be excluded.

Altogether, we obtain nontrivial solutions for a∈{−2,0,2}a \in \{-2, 0, 2\}.

Matrices and Vectors in Rn\mathbb{R}^n and Cn\mathbb{C}^n

Definition

The elements circled in the following figure are called pivot elements, or pivots for short.

Row echelon form with circled pivot elements
Definition pivoting

Pivot in the current column jj, i.e. determine the index ip∈{j,j+1,...,m}i_p \in \{j,j+1, ..., m\} with ∣aipj∣=max⁡i∈{j,j+1,...,m}∣aij∣|a_{i_pj}| =\max \limits _{i \in \{j,j+1, ..., m\}} |a_{ij}|.

Definition

In the row echelon form (REF) of the system, the number r∈Nr \in \mathbb{N} of pivot elements is called the rank of the matrix A ∈Rm×n\in \mathbb{R}^{m \times n} and of the linear system, i.e.

rank(A):=r=^ # pivot elements.\text{rank}(A) := r \mathrel{\hat{=}} \, \# \text{ pivot elements}.
Remark

Let the matrix A ∈Rm×n\in \mathbb{R}^{m \times n} have rank r∈Nr \in \mathbb{N}, then

  1. r≤min{m,n}r \leq \text{min}\{m,n\},
  2. n−r=^#n-r \mathrel{\hat{=}} \# free parameters, where nn is the number of unknowns.
Example on (ii)

m<n:m<n:

A=(300−201012002−1)⇝rank(A)=3A = \begin{pmatrix} 3 & 0 & 0 & -2\\ 0 & 1 & 0 & 12\\ 0 & 0 & 2 & -1 \end{pmatrix} \quad\quad \leadsto \quad\quad \text{rank}(A) = 3

Here you can see that the rank cannot be more than 33, since the maximum possible number of pivot elements is 33.

m>n:m>n:

B=(10−202500−12000)⇝rank(B)=3B = \begin{pmatrix} 1 & 0 & -2\\ 0 & 2 & 5\\ 0 & 0 & -12\\ 0 & 0 & 0 \end{pmatrix} \quad\quad \leadsto \quad\quad \text{rank}(B) = 3

In this case the last row is linearly dependent, i.e. using the first three rows we can turn the last one into a zero row. So here, too, the maximum possible number of pivot elements is 33.

Remark arithmetic rules

Let A∈Em×nA \in \mathbb{E}^{m \times n} and let B,C∈En×nB, C \in \mathbb{E}^{n \times n} with E∈{R,C}\mathbb{E} \in \{\mathbb{R}, \mathbb{C}\}.

  1. rank(ATA^T) = rank(AA) = rank(AHA^H)
  2. rank(BB) + rank(CC) −n≤-n \leq rank(BCBC) ≤\leq min{\{rank(BB), rank(CC)}\}
Definition

Let the following linear system be given:

Row echelon form with pivot elements and right-hand side c

In the case m>rm>r, the conditions necessary for a solution to exist

cr+1=cr+2=...=cm=0c_{r+1} = c_{r+2} = ... = c_m = 0

are the compatibility conditions of the linear system.

Definition matrix

A ∈Rm×n\in \mathbb{R}^{m \times n}

A=(a11a12⋯a1na21a22⋯a2n⋮⋮am1am2⋯amn)m=^rowsn=^columnsA = \begin{pmatrix} a_{11} & a_{12} & \cdots & a_{1n}\\ a_{21} & a_{22} & \cdots & a_{2n}\\ \vdots & & & \vdots\\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{pmatrix} \quad \quad \begin{array}{c} m \mathrel{\hat{=}} \text{rows}\\ n \mathrel{\hat{=}} \text{columns} \end{array}
Remark

If m=nm=n, the matrix A is called square.

Remark computing with matrices

Let α∈R\alpha \in \mathbb{R} be a scalar (number), let A,B ∈Rm×n\in \mathbb{R}^{m \times n} and C ∈Rn×p\in \mathbb{R}^{n \times p} be matrices, then

  • Addition: (A±B)ij=(A)ij±(B)ij(A \pm B)_{ij} = (A)_{ij} \pm (B)_{ij}

  • Matrix multiplication: (AC)ij=∑k=1n(A)ik⋅(C)kj(AC)_{ij} = \displaystyle\sum_{k=1}^n (A)_{ik} \cdot (C)_{kj}

    The resulting matrix ACAC is an m×pm \times p matrix.

    A=(a11⋯a1n⋮⋮ai1⋯ain⋮⋮am1⋯amn),C=(c11⋯c1j⋯c1p⋮⋮⋮cn1⋯cnj⋯cnp)A = \begin{pmatrix} a_{11} & \cdots & a_{1n}\\ \vdots & & \vdots\\ a_{i1} & \cdots & a_{in}\\ \vdots & & \vdots\\ a_{m1} & \cdots & a_{mn} \end{pmatrix}, \quad \quad C = \begin{pmatrix} c_{11} & \cdots & c_{1j} & \cdots & c_{1p}\\ \vdots & & \vdots & & \vdots\\ c_{n1} & \cdots & c_{nj} & \cdots & c_{np} \end{pmatrix} AC=((AC)ij=ai1c1j+⋯+aincnj)AC = \begin{pmatrix} &&&\\ & (AC)_{ij} = a_{i1} c_{1j} + \cdots + a_{in} c_{nj} &\\ &&&\\ &&& \end{pmatrix}
  • Reminder: scalar product (dot product)

    a=(a1⋮an),b=(b1⋮bn)a⋅b=a1b1+⋯+anbna = \begin{pmatrix} a_1\\ \vdots\\ a_n \end{pmatrix}, \quad \quad b = \begin{pmatrix} b_1\\ \vdots\\ b_n \end{pmatrix} \quad \quad a \cdot b = a_1 b_1 + \cdots + a_n b_n
Example 3

Compute ABAB for the given matrices.

A=(2−35102),B=(0511−20)A = \begin{pmatrix} 2 & -3 & 5\\ 1 & 0 & 2 \end{pmatrix}, \quad \quad B = \begin{pmatrix} 0 & 5\\ 1 & 1\\ -2 & 0 \end{pmatrix}
Show solutionHide solution AB=(2⋅0+−3⋅1+5⋅−22⋅5+−3⋅1+5⋅01⋅0+0⋅1+2⋅−21⋅5+0⋅1+2⋅0)=(−137−45)AB = \begin{pmatrix} 2 \cdot 0 + -3 \cdot 1 + 5 \cdot -2 & 2 \cdot 5 + -3 \cdot 1 + 5 \cdot 0\\ 1 \cdot 0 + 0 \cdot 1 + 2 \cdot -2 & 1 \cdot 5 + 0 \cdot 1 + 2 \cdot 0 \end{pmatrix} = \begin{pmatrix} -13 & 7\\ -4 & 5 \end{pmatrix}

Matlab:

Now let us check the whole thing with Matlab. We are in the Command Window:

% create the matrices A and B
>> A = [2 -3 5; 1 0 2];
>> B = [0 5; 1 1; -2 0];
% carry out the multiplication
>> A*B
ans =
	-13	7
	-4	5

Let us play a little more with Matlab so that you know all the functions you need to check for yourself whether you made a mistake. Suppose you want to compute (AB)T=BTAT(AB)^T=B^T A^T without transposing the matrices by hand:

% create the matrices A and B
>> A = [2 -3 5; 1 0 2];
>> B = [0 5; 1 1; -2 0];
% carry out the multiplication
>> (A*B)'
ans =
	-13	-4
	7	5
>> B'*A'
ans =
	-13	-4
	7	5
% create a 3-dim. identity matrix
>> einheitsmatrix = eye(3);
Remark

The usual arithmetic rules (associativity, distributivity) hold for matrix multiplication. EXCEPT commutativity !!! (AB≠BA)(AB \boldsymbol{\neq} BA) !!!!!

Definition

Let AA be a real m×nm \times n matrix. The n×mn \times m matrix ATA^T with (AT)ij=Aji(A^T)_{ij} = A_{ji} is called the transpose of AA.

Definition

Let AA be a complex m×nm \times n matrix. The n×mn \times m matrix AHA^H with AH=(A‾)T=AT‾A^H = (\overline{A})^T = \overline{A^T} is called the Hermitian or conjugate transpose of AA.

Remark property of the transpose and Hermitian

Let A,B∈En×nA,B \in \mathbb{E}^{n \times n}, then (AB)H=BHAH(AB)^{H} = B^{H}A^{H} (and (AB)T=BTAT(AB)^{T} = B^{T}A^{T}).

Example 4

Compute AHA^H of the given matrix:

A=(3+2i−5i15−7i00.5i)A = \begin{pmatrix} 3+2i & -5\\ i & 15 -7i\\ 0 & 0.5i \end{pmatrix}
Show solutionHide solution A=(3+2i−5i15−7i00.5i)⇒AH=(3−2i−i0−515+7i−0.5i)A = \begin{pmatrix} 3+2i & -5\\ i & 15 -7i\\ 0 & 0.5i \end{pmatrix} \quad\quad \Rightarrow \quad\quad A^H = \begin{pmatrix} 3 \mathbf{-}2i & \boldsymbol{-}i & 0\\ -5 & 15 \boldsymbol{+}7i & \boldsymbol{-}0.5i \end{pmatrix}
Definition

A square matrix A∈En×nA \in \mathbb{E}^{n \times n} is called nilpotent if one of its powers gives the zero matrix:

Ak=0  for the smallest k∈N.A^k = \boldsymbol{0}\, \text{ for the smallest } k \in \mathbb{N}.
Remark

If the lower triangular part of L∈En×nL \in \mathbb{E}^{n \times n}, including the diagonal, equals zero (strictly upper triangular matrix), then it is a nilpotent matrix.

L=(0∗∗⋮⋱∗0⋯0)⇒Lk=0  for some k∈N.L = \begin{pmatrix} 0 & * & *\\ \vdots & \ddots & *\\ 0 & \cdots & 0 \end{pmatrix} \quad\quad \Rightarrow \quad\quad L^k = \boldsymbol{0}\, \text{ for some } k \in \mathbb{N}.
Example 5
A=(011001000)⇝A3=0A = \begin{pmatrix} 0 & 1 & 1\\ 0 & 0 & 1\\ 0 & 0 & 0 \end{pmatrix} \quad\quad \leadsto \quad\quad A^3 = \boldsymbol{0}B=(5−3215−9610−64)⇝B2=0B = \begin{pmatrix} 5 & -3 & 2\\ 15 & -9 & 6\\ 10 & -6 & 4 \end{pmatrix} \quad\quad \leadsto \quad\quad B^2 = \boldsymbol{0}