###### tags: `Linear Algebra` `LA01`
# L04 Norm and Distance
---
## From Last week
- Inner Product of Vectors
- Application of Inner product, Net Present Value
- Sentiment Analysis
- How to wrangling with text data in Python
---
## This week
- Norm of vector
- Distance of vectors
- Triangle Innequality
- Knn intro
---
### 1. Norm
A Euclidean Norm of a vector is defined as: $$||x|| = \sqrt{x_1^2 + x_2^2 + \dots + x_n^2} = \sqrt{x^Tx}$$
he right part of the equation is in the form of inner product.
Recalls that :
$$a^T b = a_1b_1 + a_2b_2 + \dots + a_nb_n$$
----
----
### 1.1 Actually,
**Norm** is a more formal and abstruct concept, In our module, we only consider **Euclidean Norm**, which is simply, the **Length** of the vector.
:bulb: *Quick Quiz*: What is the norm of the vector $\begin{bmatrix} 1\\1\end{bmatrix}$ ?
---
### 2. Properties of norm
Some Important properties of the Euclidean norm are given below, given x adn y are vectors with same dimensions, $\beta$ is a scalar.
- Euclidean Norm is always non-negative, and $\begin{Vmatrix}\beta x\end{Vmatrix}=|\beta|\begin{Vmatrix}x\end{Vmatrix}$
- Triangle inequality. $\begin{Vmatrix}x + y\end{Vmatrix}\le\begin{Vmatrix}x\end{Vmatrix} + \begin{Vmatrix}y\end{Vmatrix}$
- Definiteness. $\begin{Vmatrix}x\end{Vmatrix} = 0$ only if $x = 0$
---
### 3. Distance
With help from the Norm(Length), it will be easy for us to define "Distance of two vectors":
$$dist(a, b) = \begin{Vmatrix}a - b\end{Vmatrix}$$
---

---
### 3.1 Triangle Inequality
Triangle Inequality in the form of distance, let
- $dist(a,b) = \begin{Vmatrix}a - b\end{Vmatrix}$,
- $dist(b,c) = \begin{Vmatrix}b - c\end{Vmatrix}$,
- $dist(a,c) = \begin{Vmatrix}a - c\end{Vmatrix}$, then,
$$\begin{Vmatrix}a - c\end{Vmatrix} \le \begin{Vmatrix}a - b\end{Vmatrix} + \begin{Vmatrix}b - c\end{Vmatrix}$$
---

---
### Nearest Neighbor
---

---
### Thank you! :sheep:
Python Time!
{"metaMigratedAt":"2023-06-17T04:38:54.516Z","metaMigratedFrom":"YAML","title":"LA01_L04","breaks":true,"description":"Norm and Distance.","contributors":"[{\"id\":\"d8479402-2b3f-4751-92f6-b67f55f4b94f\",\"add\":2318,\"del\":50}]"}