---
title: Independence, basis and dimension
heading: How many numbers does it really take?
eyebrow: A7 · Lesson 18 · Basis and dimension
xp: 40
---

::: hook
A three-phase power system has three phase voltages, but a balanced system's three always add to zero. Know two and you know the third. So three-phase signals really live in a two-dimensional space, and motor drives exploit that: they convert the three phases into two coordinates (the Clarke transform) and control those instead. Deciding how many numbers a set of vectors really needs is the question of **independence**, and the answer, the **dimension**, is one of the most useful numbers in linear algebra.
:::

::: play
- The two arrows $\mathbf{v}$ and $\mathbf{w}$ are a **basis**: every point is $c\mathbf{v} + d\mathbf{w}$ for exactly one pair $(c, d)$.
- The target is fixed at $(2, 1)$. The readouts give its coordinates $c$ and $d$ in this basis, and the dashed arrows show $c\mathbf{v}$ and $d\mathbf{w}$ adding up to it.
- Turn $\mathbf{w}$ toward $\mathbf{v}$. What happens to the coordinates as the two directions nearly line up?
:::
:::

```sim plot
view: complex
range: 2.5
slider: al = 0..180 step 1 = 10 °
slider: be = 0..180 step 1 = 80 °
arrow: 1∠al | label: v
arrow: 1∠be | color: ch2 | label: w
arrow: ((2*sin(be°) - cos(be°))/sin(be° - al°))*(1∠al) | dashed | label: cv
arrow: ((cos(al°) - 2*sin(al°))/sin(be° - al°))*(1∠be) | from: ((2*sin(be°) - cos(be°))/sin(be° - al°))*(1∠al) | dashed | color: ch2 | label: dw
dot: 2 + j | label: target
readout: c = (2*sin(be°) - cos(be°))/sin(be° - al°) | digits: 3
readout: d = (cos(al°) - 2*sin(al°))/sin(be° - al°) | digits: 3
```

::: predict
## Are $(1, 2, 3)$, $(4, 5, 6)$ and $(7, 8, 9)$ independent?

- [ ] Yes: none is a multiple of another
- [x] No: $(1, 2, 3) - 2(4, 5, 6) + (7, 8, 9) = \mathbf{0}$
- [ ] Yes: there are three of them in 3D
- [ ] It depends on the order

::: reveal
No. Not being multiples of each other isn't enough: the third is a combination of the first two, $(7, 8, 9) = 2(4, 5, 6) - (1, 2, 3)$. All three lie in one plane, so they span only a 2D space.
:::
:::

::: nameit
## Independence

Vectors $\mathbf{v}_1, \ldots, \mathbf{v}_n$ are **linearly independent** if the only combination giving zero is the trivial one:

$$c_1\mathbf{v}_1 + \cdots + c_n\mathbf{v}_n = \mathbf{0} \implies \text{all } c_i = 0$$

Otherwise they're **dependent**, and at least one is a combination of the others. Test: put them as the columns of a matrix $A$. They're independent exactly when $N(A) = \{\mathbf{0}\}$, that is, when the rank equals the number of vectors. For $n$ vectors in $\mathbb{R}^n$, that's $\det A \ne 0$.

More than $n$ vectors in $\mathbb{R}^n$ are always dependent.

## Basis and dimension

A **basis** of a space is a set of vectors that is independent and spans the space. Every vector then has **unique coordinates** in that basis. Every basis of a space has the same number of vectors, the **dimension**.

| Space | A basis | Dimension |
|---|---|---|
| $\mathbb{R}^n$ | the columns of $I$ | $n$ |
| Sinusoids at one frequency | $\cos\omega t$, $\sin\omega t$ | 2 |
| Polynomials of degree $\le n$ | $1, x, \ldots, x^n$ | $n + 1$ |
| Column space of $A$ | the pivot columns of $A$ | $r$ |
| Null space of $A$ | the special solutions | $n - r$ |

## Three-phase signals

Balanced phase voltages satisfy $v_a + v_b + v_c = 0$: the three are dependent, and the signals live in a plane. The **Clarke transform** picks a basis for that plane:

$$v_\alpha = v_a \qquad v_\beta = \frac{v_b - v_c}{\sqrt 3}$$

For a balanced set, $v_\alpha = V\cos\theta$ and $v_\beta = V\sin\theta$: a single vector of fixed length turning steadily. S11 and S12 build motor control on this.
:::

::: example
## Show the three columns of $A = \begin{bmatrix}1 & 4 & 7\\2 & 5 & 8\\3 & 6 & 9\end{bmatrix}$ are dependent, and find the dimension of their span.

::: solution
1. **Eliminate below the first pivot.** Row 2 minus 2 × row 1 is $(0, -3, -6)$; row 3 minus 3 × row 1 is $(0, -6, -12)$.
2. **The next step.** That new row 3 is twice the new row 2, so one more step leaves a zero row: the rank is 2.
3. **Conclude.** Two pivots for three columns: dependent, spanning a 2D plane. The null space vector $(1, -2, 1)$ is the combination found above.

**Answer:** the columns are dependent, with null space vector $(1, -2, 1)$, and their span is a plane of dimension 2.
:::
:::

::: example
## Check that the Clarke transform turns a balanced three-phase set into one rotating vector.

::: solution
1. **The balanced set.** Take $v_a = \cos\theta$, $v_b = \cos(\theta - 120°)$, $v_c = \cos(\theta + 120°)$.
2. **Subtract the last two.**
   $$\begin{aligned} v_b - v_c &= 2\sin\theta\sin 120° \\ &= \sqrt{3}\sin\theta \end{aligned}$$
3. **The two Clarke components.** So $v_\beta = \sin\theta$ and $v_\alpha = \cos\theta$: a unit vector at angle $\theta$, turning once per cycle.

**Answer:** the transform gives $v_\alpha = \cos\theta$ and $v_\beta = \sin\theta$, one unit vector turning once per cycle.
:::
:::

::: example
## Do $(1, 0, 1)$, $(0, 1, 1)$ and $(1, 1, 0)$ form a basis of $\mathbb{R}^3$? If so, find the coordinates of $(2, 2, 2)$.

::: solution
1. **Test independence.** Put them in the columns of a matrix. Its determinant is $-2$, which isn't zero, so the columns are independent.
2. **Basis.** Three independent vectors in $\mathbb{R}^3$ are a basis.
3. **Set up the coordinates.** Solve
   $$\begin{aligned} &c_1(1, 0, 1) + c_2(0, 1, 1) \\ &\quad + c_3(1, 1, 0) = (2, 2, 2) \end{aligned}$$
4. **Spot the solution.** Adding the three vectors gives $(2, 2, 2)$, so $c = (1, 1, 1)$.

**Answer:** yes, they form a basis, and $(2, 2, 2)$ has coordinates $(1, 1, 1)$ in it.
:::
:::

::: check
given: b1 = 2 | 5 | -1; b2 = 4 | 1
answer: (b2 - b1)/2

## Write $(\given{b1}, \given{b2}) = c(1, 1) + d(0, 2)$. What is $d$?

::: right
Right. The first component gives $c = \given{b1}$; the second gives $\given{b1} + 2d = \given{b2}$, so $d$ = {answer}.
:::

::: misses
- [b2/2] The first basis vector contributes $c = \given{b1}$ to the second component too.
- [b1] That's $c$.
- [any] Not yet. Match components: $c = b_1$, then $c + 2d = b_2$.
:::
:::

::: check
given: a = 1 | 2; b = 3 | 5
answer: a + b

## For which $k$ are $(1, 0, \given{a})$, $(0, 1, \given{b})$ and $(1, 1, k)$ dependent?

::: right
Right. The third is the sum of the first two exactly when $k = a + b$ = {answer}; the determinant is $k - a - b$.
:::

::: misses
- [a*b] Add the first two vectors: their third components add.
- [any] Not yet. Is $(1, 1, k)$ the sum of the first two?
:::
:::

::: check
kind: choice

## Four vectors in $\mathbb{R}^3$:

- [x] Are always dependent
- [ ] Are always independent
- [ ] Are independent if none is a multiple of another
- [ ] Always span $\mathbb{R}^3$

::: right
Right. $\mathbb{R}^3$ has dimension 3, so at most three vectors can be independent.
:::

::: misses
- [3] That isn't enough even for three vectors.
- [4] They might all lie in one plane.
- [any] How many independent directions does $\mathbb{R}^3$ have?
:::
:::

::: check
given: n = 3 | 5 | 9
answer: n + 1

## What is the dimension of the space of polynomials of degree at most {n}?

::: right
Right. The basis $1, x, \ldots, x^{\given{n}}$ has {answer} members.
:::

::: misses
- [n] Count the constant term, 1.
- [any] Not yet. Count $1, x, x^2, \ldots, x^n$.
:::
:::

::: check
given: va = 120 | -80; vb = -170 | 100
answer: -va - vb
unit: V

## A balanced three-phase system has $v_a$ = {va} V and $v_b$ = {vb} V at some instant. What is $v_c$?

::: right
Right. $v_a + v_b + v_c = 0$, so $v_c$ = {answer}.
:::

::: misses
- [va + vb] The three sum to zero, so $v_c$ is minus the other two.
- [any] Not yet. Use $v_a + v_b + v_c = 0$.
:::
:::

::: check
given: va = 1 | -0.5; vb = 0.5 | -1
answer: (va + 2*vb)/sqrt(3)
tolerance: 0.5%

## A balanced three-phase set has $v_a$ = {va} and $v_b$ = {vb}. What is the Clarke coordinate $v_\beta = \frac{v_b - v_c}{\sqrt 3}$?

::: right
Right. $v_c = -v_a - v_b$, so $v_\beta = \frac{v_a + 2v_b}{\sqrt 3}$ = {answer}.
:::

::: misses
- [(vb - va)/sqrt(3)] Use $v_c$, found from $v_a + v_b + v_c = 0$.
- [any] Not yet. Find $v_c$ first.
:::
:::

::: check
kind: parts
given: a = 2 | 3; b = 1 | 5

## Find the coordinates of $(\given{a}, \given{b})$ in the basis $(1, 2)$, $(1, -1)$.

::: part
answer: (a + b)/3
tolerance: 0.5%

### What is the first coordinate?

::: misses
- [any] $c_1 + c_2 = a$ and $2c_1 - c_2 = b$; add them.
:::
:::

::: part
answer: (2*a - b)/3
tolerance: 0.5%

### What is the second coordinate?

::: misses
- [any] $c_2 = a - c_1$.
:::
:::
:::

::: check
kind: derivation
vars: k = 0.5..5

## Test $(1, k)$ and $(k, 4)$ for independence.

::: step
answer: 4 - k^2

### What is the determinant of the matrix with these columns?
:::

::: step
answer: -k

### In the basis $(1, k)$, $(0, 1)$, what is the second coordinate of $(1, 0)$?
:::

::: right
Right. The two vectors are dependent only at $k = 2$, where the determinant vanishes.
:::
:::

::: explain
## Why do coordinates in a basis come out unique, and why must the basis vectors be independent for that?

::: model
Suppose a vector had two sets of coordinates, $\sum c_i\mathbf{v}_i = \sum d_i\mathbf{v}_i$. Subtracting gives $\sum(c_i - d_i)\mathbf{v}_i = \mathbf{0}$. If the basis vectors are independent, the only way that combination can be zero is with every $c_i - d_i = 0$, so the two sets were the same. If they were dependent, there'd be a nonzero combination giving zero, and adding it would change the coordinates without changing the vector, so coordinates wouldn't be unique.
:::
:::

::: practice

::: check
given: b1 = 3 | 6; b2 = 1 | 8
answer: b1

## Write $(\given{b1}, \given{b2}) = c(1, 1) + d(0, 2)$. What is $c$?

::: misses
- [(b2 - b1)/2] That's $d$.
- [any] Only the first basis vector has a first component.
:::
:::

::: check
given: p = 2 | 3; q = 4 | 9
answer: q/p

## For which $k$ are $(1, k)$ and $(\given{p}, \given{q})$ dependent?

::: misses
- [p/q] The second must be $p$ times the first.
- [any] Make one a multiple of the other.
:::
:::

::: check
given: m = 3 | 4; n = 5 | 6
answer: m

## An {m} × {n} matrix has independent rows. What is its rank?

::: misses
- [n] Independent rows give one pivot each.
- [any] One pivot per independent row.
:::
:::
:::
