Coursera Week 1 - Linear Algebra Matrices And Vectors   2016-09-30


coursera week 1 - matrices and vectors

1. Matrix Elements

$$
A =
\begin{bmatrix}
1 & 2 \\
4 & 5 \\
7 & 8
\end{bmatrix} \tag{fmt.1 R^{32}}
$$

$ A_{ij} = $ “$i, j$ entry” in the $i^{th}$ row, $j^{th}$ column

$ A_{32} = 8 $

2. Vector $A_n$ n*1 matrix

$$
y =
\begin{bmatrix}
460 \\
232 \\
315 \\
178
\end{bmatrix} \tag{fmt.2}
$$

$R^4$ 4 dimensional vector
$y_i = i^{th} element$

2.1 math 1-indexed

$$
y =
\begin{bmatrix}
y1 \\
y2 \\
y3 \\
y4
\end{bmatrix} \tag{fmt.3}
$$

2.2 machine-learning 0-indexed

$$
y =
\begin{bmatrix}
y0 \\
y1 \\
y2 \\
y3
\end{bmatrix} \tag{fmt.4}
$$

3. Matrix Addition

$$ \begin{bmatrix} 1 & 0 \\ 2 & 5 \\ 3 & 1 \end{bmatrix} + \begin{bmatrix} 4 & 0.5 \\ 2 & 5 \\ 0 & 1 \end{bmatrix} =
\begin{bmatrix}
5 & 0.5 \\
4 & 10 \\
3 & 2
\end{bmatrix} $$

4. Scalar Multiplication

$$ 3 \times \begin{bmatrix} 1 & 0 \\ 2 & 5 \\ 3 & 1 \end{bmatrix}
= \begin{bmatrix}
3 & 0 \\
6 & 15 \\
9 & 3
\end{bmatrix}
$$

5. Combination of Operands

$$ 3 \times
\begin{bmatrix}
1 \\
4 \\
2
\end{bmatrix}
+
\begin{bmatrix}
0 \\
0 \\
5
\end{bmatrix} -
\begin{bmatrix}
3 \\
0 \\
2
\end{bmatrix} / 3 =
\begin{bmatrix}
2 \\
12 \\
31/3
\end{bmatrix}
$$

6. Matrix Vector Multiplication

$$
\begin{bmatrix}
1 & 3 \\
4 & 0 \\
2 & 1
\end{bmatrix}
\times
\begin{bmatrix}
1 \\
5
\end{bmatrix} =
\begin{bmatrix}
16 \\
4 \\
7
\end{bmatrix}
$$

Matrix Vector Multiplication Fmt :

Matrix Vector

6.1 House sizes example

$$
h_{\theta} (x) = -40 + 0.25 x
$$

House sizes Price
2104 ?
1416 ?
1534 ?
852 ?

$$ \begin{bmatrix}
1 & 2104 \\
1 & 1416 \\
1 & 1534 \\
1 & 852
\end{bmatrix} \times
\begin{bmatrix}
-40 \\
0.25
\end{bmatrix}
=
\begin{bmatrix}
-40 \times 1 + 0.25 \times 2104 \\
… \\
… \\

\end{bmatrix}
$$

7. Practice Example

$$ \begin{bmatrix}
1 & 3 & 2 \\
4 & 0 & 1
\end{bmatrix}
\begin{bmatrix}
1 & 3 \\
0 & 1 \\
5 & 2
\end{bmatrix} =
\begin{bmatrix}
11 & 10 \\
9 & 14
\end{bmatrix} $$

$ A_{2 \times 3} \times A_{3 \times 2} = A_{2 \times 2} $

Matrix

8. House Example

Matrix

9. Matrix $A \times B \neq B \times A$

But, 结合律,可以的

$ A \times B \times C = (A \times B) \times C = A \times (B \times C) $

10. Identity Matrix

Denoted I (or I_{n*n}).

10.1 $2 \times 2$

$$
\begin{bmatrix}
1 & 0 \\
0 & 1
\end{bmatrix} \tag{fmt.1 R^{32}}
$$

10.2 $3 \times 3$

$$
\begin{bmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{bmatrix} \tag{fmt.1 R^{32}}
$$

$Z \times I = I \times Z = Z$

11. Matrix Inverse

$3 \times 3^{-1} = 1$

Not all numbers have an inverse.

if $A$ is an $m \times m$ matrix, and if it has an inverse

$A \times A^{-1} = A^{-1} \times A = I$

$$
A =
\begin{bmatrix}
3 & 4 \\
2 & 16 \\
\end{bmatrix}
$$

$$
A^{-1} =
\begin{bmatrix}
0.4 & -0.1 \\
-0.05 & 0.075 \\
\end{bmatrix}
$$

$ A \times A^{-1} = I_{2 \times 2} $

$$
I_{2 \times 2} =
\begin{bmatrix}
1 & 0 \\
0 & 1 \\
\end{bmatrix}
$$

12. Matrix Transpose

$$
A =
\begin{bmatrix}
1 & 2 & 0 \\
3 & 5 & 9 \\
\end{bmatrix}
$$

$$
A^T =
\begin{bmatrix}
1 & 3 \\
2 & 5 \\
0 & 9
\end{bmatrix}
$$

Let $A$ be an $m \times n$ matrix, and let $B = A^T$.
Then $B$ is an $n \times m$ matrix, and $B_{ij} = A_{ji}$


分享到:


  如果您觉得这篇文章对您的学习很有帮助, 请您也分享它, 让它能再次帮助到更多的需要学习的人. 您的支持将鼓励我继续创作 !
本文基于署名4.0国际许可协议发布,转载请保留本文署名和文章链接。 如您有任何授权方面的协商,请邮件联系我。

Contents

  1. 1. Matrix Elements
  2. 2. Vector $A_n$ n*1 matrix
    1. 2.1 math 1-indexed
    2. 2.2 machine-learning 0-indexed
  3. 3. Matrix Addition
  4. 4. Scalar Multiplication
  5. 5. Combination of Operands
  6. 6. Matrix Vector Multiplication
    1. 6.1 House sizes example
  7. 7. Practice Example
  8. 8. House Example
  9. 9. Matrix $A \times B \neq B \times A$
  10. 10. Identity Matrix
    1. 10.1 $2 \times 2$
    2. 10.2 $3 \times 3$
  11. 11. Matrix Inverse
  12. 12. Matrix Transpose