# Section 4.9 $\quad$ Rank of a Matrix (continued)

### Example 1

Let $A$ be a $6\times 4$ matrix.
- What is the largest possible value of rank (A)?
- Are rows of $A$ linearly independent?
- Are columns of $A$ linearly independent?<br /><br /><br /><br /><br /><br /><br />

### Example 2

Let $A$ be a $4\times 5$ matrix.
- List all possible values of the rank of $A$.
- If the rank of $A$ is 4, what is the dimension of its column space?
- If the rank of $A$ is 3, what is the dimension of the solution space of $A\mathbf{x}=\mathbf{0}$?<br /><br /><br /><br /><br /><br /><br />

### Example 3

Let
\begin{equation*}
  A =
  \left[
    \begin{array}{cccc}
      1 & 1 & 4 & 1  \\
      0 & 1 & 2 & 1  \\
      0 & 0 & 0 & 1  \\
      1& -1 & 0 & 0  \\
      2 & 1 & 6 & 0  \\
    \end{array}
  \right]
\end{equation*}
Find the rank of $A$ and the dimension of the solution space of $A\mathbf{x}=\mathbf{0}$.


```python
from sympy import *

A = Matrix([[1, 1, 4, 1], [0, 1, 2, 1], [0, 0, 0, 1], [1, -1, 0, 0], [2, 1, 6, 0]]);

A.rank()
```




    3




```python
from sympy import *

A = Matrix([[1, 1, 4, 1], [0, 1, 2, 1], [0, 0, 0, 1], [1, -1, 0, 0], [2, 1, 6, 0]]);
x1, x2, x3, x4 = symbols('x1 x2 x3 x4');
x = Matrix([x1, x2, x3, x4]);

solve(A.dot(x))
```




    [{x2: -2*x3, x1: -2*x3, x4: 0}]



>**Theorem** If $A$ is an $m\times n$ matrix, then<br /><br /><br /><br />

## Properties of Rank

Let $A$ be an $n\times n$ matrix.
- rank(A) = n if and only if $A$ is row equivalent to $\underline{\hspace{.3in}}$.<br /><br />
- $A$ is nonsingular if and only if rank($A$) =  $\underline{\hspace{.3in}}$.<br /><br />
- rank(A) = n if and only if $\det(A)$ $\underline{\hspace{.3in}}$.<br /><br />
- The homogeneous system $A\mathbf{x} = \mathbf{0}$ has a nontrivial solution if and only if rank($A$) $\underline{\hspace{.3in}}$.<br /><br />
- The nonhomogeneous system $A\mathbf{x} = \mathbf{b}$ has a unique solution if and only if rank($A$) $\underline{\hspace{.3in}}$.<br /><br />

### Example 4

Determine whether the homogeneous system has a nontrivial solution.
\begin{equation*}
    \left[
    \begin{array}{cccc}
      1 & 1 & 2 & -1  \\
      1 & 3 & -1& 2  \\
      1 & 1 & 1 & 3  \\
      1 & 2 & 3 & 1  \\
    \end{array}
  \right]
  \left[
    \begin{array}{c}
      x_1 \\ x_2 \\ x_3 \\ x_4  \\
    \end{array}
  \right] =
  \left[
    \begin{array}{c}
      0 \\ 0 \\ 0 \\ 0  \\
    \end{array}
  \right]
\end{equation*}


```python
from sympy import *

A = Matrix([[1, 1, 2, -1], [1, 3, -1, 2], [1, 1, 1, 3], [1, 2, 3, 1]]);

A.rank()
```




    4



## Application to Nonhomogeneous System $A\mathbf{x}=\mathbf{b}$

>**Theorem** The linear system $A\mathbf{x} = \mathbf{b}$ has a solution if and only if<br /><br /><br /><br />

### Example 5

Determine whether the nonhomogeneous system has a solution.
\begin{equation*}
    \left[
    \begin{array}{ccc}
      1 & 2 & 3   \\
      1 & -3 &4  \\
      2 & -1 &7  \\
    \end{array}
  \right]
  \left[
    \begin{array}{c}
      x_1 \\ x_2 \\ x_3  \\
    \end{array}
  \right] =
  \left[
    \begin{array}{c}
      4 \\ 5 \\ 6 \\
    \end{array}
  \right]
\end{equation*}


```python
from sympy import *

A = Matrix([[1, 2, 3], [1, -3, 4], [2, -1, 7]]);
x1, x2, x3 = symbols('x1 x2 x3');
x = Matrix([x1, x2, x3]);

solve(Matrix(A.dot(x)) - Matrix([4, 5, 6]))
```




    []



**Remark** For the nonhomogeneous system $A\mathbf{x}= \mathbf{b}$, where $A$ is an $n\times n$ matrix,
- If $rank(A) = n$,<br /><br />
- If $rank(A) < n$, and $rank(A) = rank([A~|~\mathbf{b}])$,<br /><br />
- If $rank(A) < n$, and $rank(A) \neq rank([A~|~\mathbf{b}])$,<br /><br />

f7eac384460f51f30ac2e655ed1ef77c0a54f7c4
ipynb
Jupyter Notebook
Jupyter_Notes/Lecture24_Sec4-9_RankMatrixPart2.ipynb
xiuquan0418/MAT341
2fb7ec4e5f0771f10719cb5e4a00a7ab07c49b59
MIT
Jupyter_Notes/Lecture24_Sec4-9_RankMatrixPart2.ipynb
xiuquan0418/MAT341
2fb7ec4e5f0771f10719cb5e4a00a7ab07c49b59
MIT
Jupyter_Notes/Lecture24_Sec4-9_RankMatrixPart2.ipynb
xiuquan0418/MAT341
2fb7ec4e5f0771f10719cb5e4a00a7ab07c49b59
MIT
Qwen/Qwen-72B
1. YES
2. YES