---
# System prepended metadata

title: 'Week 1: Vectors and Matrices'

---

# Week 1: Vectors and Matrices  

## Dot Product  

The dot product of two vectors $\mathbf{u}$ and $\mathbf{v}$ is calculated as:  
$$
\mathbf{u} \cdot \mathbf{v} = \|\mathbf{u}\| \|\mathbf{v}\| \cos \theta
$$  
where $\theta$ is the angle between them.  

### Example  
Let $\mathbf{u} = (2, 3)$ and $\mathbf{v} = (4, 1)$:  
$$
\mathbf{u} \cdot \mathbf{v} = 2(4) + 3(1) = 11
$$  

---

## Magnitude and Direction  

- **Magnitude:**  
  $$
  \|\mathbf{v}\| = \sqrt{x^2 + y^2}
  $$  

- **Direction:**  
  $$
  \theta = \arctan\left(\frac{y}{x}\right)
  $$  

---

## Trigonometric Definitions  

### Polar and Cartesian Coordinates  
- **From Cartesian to Polar:**  
  $$
  r = \sqrt{x^2 + y^2}, \quad \theta = \arctan\left(\frac{y}{x}\right)
  $$  

- **From Polar to Cartesian:**  
  $$
  x = r \cos \theta, \quad y = r \sin \theta
  $$  

---

## Solving Linear Equations  

### Geometric Interpretation  
Solving a system of linear equations involves finding the intersection of their corresponding lines (in 2D) or planes (in 3D).  

### Matrix Example  
For $\mathbf{A} \mathbf{x} = \mathbf{b}$, where:  
$$
\mathbf{A} = 
\begin{bmatrix} 
2 & 1 \\ 
1 & -1 
\end{bmatrix}, \quad 
\mathbf{b} = 
\begin{bmatrix} 
3 \\ 
0 
\end{bmatrix}
$$  
Solve via elimination or substitution to find $\mathbf{x}$.  

---

## Row Reduction  

### Example: Gaussian Elimination  
Given matrix:  
$$
\mathbf{A} = 
\begin{bmatrix} 
1 & 2 & -1 \\ 
2 & -3 & 4 \\ 
-1 & 1 & 3 
\end{bmatrix}
$$  
Perform row reduction to reach row echelon form:  
$$
\begin{bmatrix} 
1 & 2 & -1 \\ 
0 & -7 & 6 \\ 
0 & 0 & -2 
\end{bmatrix}
$$  

---

## Linear Combinations  

A **linear combination** involves scaling and summing vectors:  
$$
c_1 \mathbf{v}_1 + c_2 \mathbf{v}_2 + \dots
$$  

### Example  
Let $\mathbf{v}_1 = (1, 0)$ and $\mathbf{v}_2 = (0, 1)$:  
$$
3\mathbf{v}_1 + 2\mathbf{v}_2 = (3, 2)
$$  

---

## Linear (In)dependence and Span  

- **Linear Dependence:** Vectors are dependent if one can be written as a combination of others.  
- **Span:** The set of all vectors that can be formed as linear combinations of a given set.  

---

## Matrix Operations  

### Matrix-Vector Multiplication  
Matrix-vector multiplication applies a transformation.  

### Example  
$$
\mathbf{A} = 
\begin{bmatrix} 
1 & 2 \\ 
3 & 4 
\end{bmatrix}, \quad 
\mathbf{v} = 
\begin{bmatrix} 
5 \\ 
6 
\end{bmatrix}
$$  
$$
\mathbf{A} \mathbf{v} = 
\begin{bmatrix} 
1(5) + 2(6) \\ 
3(5) + 4(6) 
\end{bmatrix} = 
\begin{bmatrix} 
17 \\ 
39 
\end{bmatrix}
$$  
