MAT1041 · Week 6 · - Vectors in R^n

Vectors in Rⁿ and vector spaces

You learn vector operations in Rⁿ, linear combinations, length and the dot product, then the ten axioms of a vector space and how to check whether a set (with standard or nonstandard operations) is a vector space.

vector in Rⁿn-tuplevector additionscalar multiplicationlinear combinationzero vectoradditive inversenorm (length)unit vectordot productorthogonalvector spaceaxiomsclosureMn,nPn

So far we have worked with matrices as tables of numbers. This week we move to geometry and abstraction. First vectors in Rn\mathbb{R}^n: the nn-dimensional version of the plane and space vectors you know. Then the big idea: the vector space. Any collection of objects that can be added and multiplied by numbers and that obeys certain rules (matrices, polynomials, functions) behaves like Rn\mathbb{R}^n. Everything in the second half of the semester (subspace, basis, dimension, linear transformation) is built on this definition.

Golden rules:

  1. In Rn\mathbb{R}^n every operation is done component by component.
  2. The question “is it a linear combination?” is really a question about a system: do Gaussian elimination.
  3. To show something is not a vector space, one concrete example where a single axiom fails is enough.
  4. With nonstandard operations, compute the zero vector; don’t assume it is (0,0)(0, 0).

Vectors in Rⁿ

Rn\mathbb{R}^n is the set of ordered lists of nn real numbers: v=(v1,v2,…,vn)\mathbf{v} = (v_1, v_2, \dots, v_n). They can be written as rows or columns; in this course, when used with systems, columns are preferred.

The operations are componentwise:

u+v=(u1+v1,…,un+vn),cu=(cu1,…,cun).\mathbf{u} + \mathbf{v} = (u_1 + v_1, \dots, u_n + v_n), \qquad c\mathbf{u} = (cu_1, \dots, cu_n).

For u=(1,−2,3,0)\mathbf{u} = (1, -2, 3, 0), v=(2,1,−1,4)\mathbf{v} = (2, 1, -1, 4):

u+v=(3,−1,2,4),3u−2v=(3−4, −6−2, 9+2, 0−8)=(−1,−8,11,−8).\mathbf{u} + \mathbf{v} = (3, -1, 2, 4), \qquad 3\mathbf{u} - 2\mathbf{v} = (3 - 4,\ -6 - 2,\ 9 + 2,\ 0 - 8) = (-1, -8, 11, -8).

The zero vector is 0=(0,…,0)\mathbf{0} = (0, \dots, 0), and the additive inverse of u\mathbf{u} is −u=(−u1,…,−un)-\mathbf{u} = (-u_1, \dots, -u_n).

Linear combinations

If w\mathbf{w} can be written as w=c1v1+c2v2+⋯+ckvk\mathbf{w} = c_1\mathbf{v}_1 + c_2\mathbf{v}_2 + \dots + c_k\mathbf{v}_k, it is a linear combination of the vi\mathbf{v}_i. To find it, treat the coefficients as unknowns and solve the system. The vectors become columns:

Example. Is (4,1,5)(4, 1, 5) a combination of (1,0,1)(1, 0, 1) and (1,1,2)(1, 1, 2)?

a[101]+b[112]=[415]⟶[114011125]→R3←R3−R1[114011011]→R3←R3−R2[114011000]a\begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix} + b\begin{bmatrix} 1 \\ 1 \\ 2 \end{bmatrix} = \begin{bmatrix} 4 \\ 1 \\ 5 \end{bmatrix} \quad\longrightarrow\quad \left[\begin{array}{cc|c} 1 & 1 & 4 \\ 0 & 1 & 1 \\ 1 & 2 & 5 \end{array}\right] \xrightarrow{R_3 \leftarrow R_3 - R_1} \left[\begin{array}{cc|c} 1 & 1 & 4 \\ 0 & 1 & 1 \\ 0 & 1 & 1 \end{array}\right] \xrightarrow{R_3 \leftarrow R_3 - R_2} \left[\begin{array}{cc|c} 1 & 1 & 4 \\ 0 & 1 & 1 \\ 0 & 0 & 0 \end{array}\right]

b=1b = 1, a=3a = 3. Yes: (4,1,5)=3(1,0,1)+1(1,1,2)(4, 1, 5) = 3(1, 0, 1) + 1(1, 1, 2). If we had asked the same question for (4,1,7)(4, 1, 7), the last row would have been [0 0∣2][0\ 0 \mid 2]: not a combination.

Length and dot product

You will need these concepts in week 14 (orthogonal diagonalization), so meet them now:

ConceptFormulaExample u=(1,−2,3,0)\mathbf{u} = (1, -2, 3, 0), v=(2,1,−1,4)\mathbf{v} = (2, 1, -1, 4)
Dot productu⋅v=∑uivi\mathbf{u} \cdot \mathbf{v} = \sum u_iv_i2−2−3+0=−32 - 2 - 3 + 0 = -3
Norm (length)∥u∥=u⋅u\|\mathbf{u}\| = \sqrt{\mathbf{u} \cdot \mathbf{u}}1+4+9=14\sqrt{1 + 4 + 9} = \sqrt{14}
Unit vectoru/∥u∥\mathbf{u}/\|\mathbf{u}\|114(1,−2,3,0)\frac{1}{\sqrt{14}}(1, -2, 3, 0)
Anglecos⁡θ=u⋅v∥u∥∥v∥\cos\theta = \dfrac{\mathbf{u} \cdot \mathbf{v}}{\|\mathbf{u}\|\|\mathbf{v}\|}
Orthogonalu⋅v=0\mathbf{u} \cdot \mathbf{v} = 0

Definition of a vector space

Let VV be a nonempty set with an addition and a scalar multiplication defined on it. If the following ten axioms hold for all u,v,w∈V\mathbf{u}, \mathbf{v}, \mathbf{w} \in V and all c,d∈Rc, d \in \mathbb{R}, then VV is a vector space:

#AxiomName
1u+v∈V\mathbf{u} + \mathbf{v} \in Vclosure under addition
2u+v=v+u\mathbf{u} + \mathbf{v} = \mathbf{v} + \mathbf{u}commutativity
3u+(v+w)=(u+v)+w\mathbf{u} + (\mathbf{v} + \mathbf{w}) = (\mathbf{u} + \mathbf{v}) + \mathbf{w}associativity
4there is a 0∈V\mathbf{0} \in V with u+0=u\mathbf{u} + \mathbf{0} = \mathbf{u}zero vector
5for every u\mathbf{u} there is −u∈V-\mathbf{u} \in V with u+(−u)=0\mathbf{u} + (-\mathbf{u}) = \mathbf{0}inverse
6cu∈Vc\mathbf{u} \in Vclosure under scalar multiplication
7c(u+v)=cu+cvc(\mathbf{u} + \mathbf{v}) = c\mathbf{u} + c\mathbf{v}distributivity
8(c+d)u=cu+du(c + d)\mathbf{u} = c\mathbf{u} + d\mathbf{u}distributivity
9c(du)=(cd)uc(d\mathbf{u}) = (cd)\mathbf{u}associativity
101u=u1\mathbf{u} = \mathbf{u}identity

The word “vector” no longer means an arrow: every element of VV is a vector, and it can be a matrix or a polynomial.

Standard examples

SpaceElementsZero vector
Rn\mathbb{R}^nnn-tuples(0,…,0)(0, \dots, 0)
Mm,nM_{m,n}m×nm \times n matriceszero matrix
PnP_npolynomials of degree at most nnzero polynomial
PPall polynomialszero polynomial
C(−∞,∞)C(-\infty, \infty)all continuous functionsf(x)=0f(x) = 0

In all of them the operations are the usual addition and multiplication by numbers. The axioms follow from the rules of the real numbers.

Sets that are not vector spaces

Usually closure (1 or 6) or the zero vector (4) fails:

  • Polynomials of degree exactly 2. x2+(−x2+x)=xx^2 + (-x^2 + x) = x, of degree 1. Not closed under addition.
  • Vectors in R2\mathbb{R}^2 whose first coordinate is nonnegative {(x,y):x≥0}\{(x, y): x \ge 0\}. (−1)(1,0)=(−1,0)(-1)(1, 0) = (-1, 0) is not in the set.
  • Vectors with integer coordinates. 12(1,0)\frac12(1, 0) is not in the set.
  • {(x,y):y=x+1}\{(x, y): y = x + 1\}. (0,0)(0, 0) is not in the set, so there is no zero vector.

Nonstandard operations

On the exam, a familiar set is sometimes given strange operations. Strategy:

  1. Check closure.
  2. Find the zero vector by setting up an equation: u⊕z=u\mathbf{u} \oplus \mathbf{z} = \mathbf{u}.
  3. Find the inverse: u⊕u′=z\mathbf{u} \oplus \mathbf{u}' = \mathbf{z}.
  4. Try the scalar axioms (7-10) with concrete numbers. If one fails, stop.

Example. R2\mathbb{R}^2, standard addition, but c⊙(x,y)=(cx,0)c \odot (x, y) = (cx, 0). Axiom 10: 1⊙(1,1)=(1,0)≠(1,1)1 \odot (1, 1) = (1, 0) \neq (1, 1). Not a vector space. That the other nine axioms hold changes nothing.

PITFALL · assuming the zero vector is (0, 0). With the operation (x1,y1)⊕(x2,y2)=(x1+x2+1,y1+y2+1)(x_1, y_1) \oplus (x_2, y_2) = (x_1 + x_2 + 1, y_1 + y_2 + 1), (3,5)⊕(0,0)=(4,6)≠(3,5)(3, 5) \oplus (0, 0) = (4, 6) \neq (3, 5). The zero vector is (−1,−1)(-1, -1) (Q8). Compute before saying “there is no zero vector”.

Properties that follow from the axioms

In every vector space, whatever the operations are:

0v=0,c0=0,(−1)v=−v,cv=0⇒c=0 or v=0.0\mathbf{v} = \mathbf{0}, \qquad c\mathbf{0} = \mathbf{0}, \qquad (-1)\mathbf{v} = -\mathbf{v}, \qquad c\mathbf{v} = \mathbf{0} \Rightarrow c = 0 \text{ or } \mathbf{v} = \mathbf{0}.

Also the zero vector is unique and the inverse of every vector is unique. These are proved from the axioms in a few lines (Q11).

Before the midterm: weeks 1-6 in one table

TopicOne sentenceWeek
Gauss / Gauss-Jordanreduce [A∣b][A \mid \mathbf{b}] to REF / RREF; [0⋯0∣c≠0][0 \cdots 0 \mid c \neq 0] = no solution1
Parameter kklast row f(k)z=g(k)f(k)z = g(k); examine the roots of f=0f = 0 separately1
Matrix product(m×n)(n×p)(m \times n)(n \times p); AB≠BAAB \neq BA; (AB)T=BTAT(AB)^T = B^TA^T2
Inverse[A∣I]→[I∣A−1][A \mid I] \to [I \mid A^{-1}]; AX=B⇒X=A−1BAX = B \Rightarrow X = A^{-1}B3
Determinantmake it triangular with additions; swap ×(−1)\times(-1), scaling ×c\times c4
Propertiesdet⁡(cA)=cndet⁡A\det(cA) = c^n\det A, det⁡(AB)=det⁡Adet⁡B\det(AB) = \det A\det B5
Adjoint, Crameradj⁡A=[Cij]T\operatorname{adj}A = [C_{ij}]^T; xi=det⁡Ai/det⁡Ax_i = \det A_i/\det A5
Vector space10 axioms; if not, a single counterexample6
Subspace (next week)is 0\mathbf{0} in it, is it closed under addition and scalars7

Common mistakes

WrongRight
Looking for a linear combination by trial and errorSet up a system for the coefficients, do Gauss
Writing the vectors as rows of the augmented matrixVectors become columns
Taking the zero vector to be (0,0)(0,0) with nonstandard operationsSolve the equation u⊕z=u\mathbf{u} \oplus \mathbf{z} = \mathbf{u}
Saying “vector space” because one axiom holdsAll ten axioms are needed
Trying to write a general argument for “it is not”One numerical counterexample is enough
Thinking P2P_2 is “degree exactly 2”Degree at most 2
Thinking ∥v∥\|\mathbf{v}\| is the sum of the componentsSquare root of the sum of squares

Test yourself

Exam-style questions. Solve them on paper first, then reveal the answer.

Question 1easy

Let u=(1,−2,3)\mathbf{u} = (1, -2, 3) and v=(4,0,−1)\mathbf{v} = (4, 0, -1). Compute 2u−3v2\mathbf{u} - 3\mathbf{v}.

Show answer
(−10,−4,9)(-10, -4, 9)

2u=(2,−4,6)2\mathbf{u} = (2, -4, 6), 3v=(12,0,−3)3\mathbf{v} = (12, 0, -3).
Difference: (2−12,−4−0,6−(−3))=(−10,−4,9)(2 - 12, -4 - 0, 6 - (-3)) = (-10, -4, 9).

Question 2easy

Let u=(1,3,−1,2)\mathbf{u} = (1, 3, -1, 2) and v=(3,1,1,0)\mathbf{v} = (3, 1, 1, 0). Solve 2x+u=3v2\mathbf{x} + \mathbf{u} = 3\mathbf{v} for x\mathbf{x}.

Show answer
(4,0,2,−1)(4, 0, 2, -1)

Solve it like an equation with numbers: x=12(3v−u)\mathbf{x} = \frac12(3\mathbf{v} - \mathbf{u}).3v−u=(9−1,3−3,3+1,0−2)=(8,0,4,−2)3\mathbf{v} - \mathbf{u} = (9 - 1, 3 - 3, 3 + 1, 0 - 2) = (8, 0, 4, -2). Half of it is (4,0,2,−1)(4, 0, 2, -1).

Question 3medium

Write w=(3,1,−4)\mathbf{w} = (3, 1, -4) as a linear combination of u=(1,1,0)\mathbf{u} = (1, 1, 0) and v=(0,1,2)\mathbf{v} = (0, 1, 2).

Show answer
w=3u−2v\mathbf{w} = 3\mathbf{u} - 2\mathbf{v}

au+bv=(a,a+b,2b)=(3,1,−4)a\mathbf{u} + b\mathbf{v} = (a, a + b, 2b) = (3, 1, -4).
Component 1 gives a=3a = 3, component 3 gives b=−2b = -2. Check component 2: 3−2=13 - 2 = 1. Consistent.

Question 4medium

Is (1,2,4)(1, 2, 4) a linear combination of (1,0,1)(1, 0, 1) and (0,1,1)(0, 1, 1)?

Show answer
No

a(1,0,1)+b(0,1,1)=(a,b,a+b)a(1, 0, 1) + b(0, 1, 1) = (a, b, a + b). The first two components give a=1a = 1, b=2b = 2, but then the third component is 3≠43 \neq 4.
With the augmented matrix: a row [0 0∣1][0\ 0 \mid 1] appears, the system is inconsistent.

Question 5medium

Find ∥v∥\|\mathbf{v}\| and the unit vector in the direction of v=(2,−1,2)\mathbf{v} = (2, -1, 2).

Show answer
∥v∥=3\|\mathbf{v}\| = 3, (23,−13,23)\left(\tfrac23, -\tfrac13, \tfrac23\right)

∥v∥=4+1+4=9=3\|\mathbf{v}\| = \sqrt{4 + 1 + 4} = \sqrt9 = 3.
The unit vector is v∥v∥=13(2,−1,2)\frac{\mathbf{v}}{\|\mathbf{v}\|} = \frac13(2, -1, 2). Check: 4+1+49=1\frac{4 + 1 + 4}{9} = 1.

Question 6medium

Find the angle between u=(1,1,0)\mathbf{u} = (1, 1, 0) and v=(1,0,1)\mathbf{v} = (1, 0, 1).

Show answer
60∘60^\circ (π/3\pi/3)

u⋅v=1+0+0=1\mathbf{u} \cdot \mathbf{v} = 1 + 0 + 0 = 1, ∥u∥=∥v∥=2\|\mathbf{u}\| = \|\mathbf{v}\| = \sqrt2.cos⁡θ=122=12\cos\theta = \frac{1}{\sqrt2\sqrt2} = \frac12, θ=60∘\theta = 60^\circ.

Question 7medium

Is R2\mathbb{R}^2 with standard addition and the scalar multiplication c⊙(x,y)=(cx,0)c \odot (x, y) = (cx, 0) a vector space? If not, name an axiom that fails.

Show answer
No: 1⊙u=u1 \odot \mathbf{u} = \mathbf{u} fails

1⊙(1,1)=(1,0)≠(1,1)1 \odot (1, 1) = (1, 0) \neq (1, 1). The axiom "1u=u1\mathbf{u} = \mathbf{u}" fails.
The axioms about addition hold (standard addition); the failure of a single axiom is enough.

Question 8hard

On R2\mathbb{R}^2 define (x1,y1)⊕(x2,y2)=(x1+x2+1, y1+y2+1)(x_1, y_1) \oplus (x_2, y_2) = (x_1 + x_2 + 1,\ y_1 + y_2 + 1). What is the zero vector for ⊕\oplus, and what is the additive inverse of (x,y)(x, y)?

Show answer
Zero vector (−1,−1)(-1, -1); inverse (−x−2,−y−2)(-x - 2, -y - 2)

Zero vector z=(a,b)\mathbf{z} = (a, b): (x+a+1,y+b+1)=(x,y)(x + a + 1, y + b + 1) = (x, y) for every (x,y)(x, y). a=b=−1a = b = -1.
Inverse (p,q)(p, q): (x+p+1,y+q+1)=(−1,−1)(x + p + 1, y + q + 1) = (-1, -1), so p=−x−2p = -x - 2, q=−y−2q = -y - 2.
Trap: the zero vector here is not (0,0)(0, 0). Check: (3,5)⊕(−1,−1)=(3,5)(3, 5) \oplus (-1, -1) = (3, 5).

Question 9medium

Is the set of all polynomials of degree exactly 2 (with standard operations) a vector space?

Show answer
No

It is not closed under addition: x2x^2 and −x2+1-x^2 + 1 have degree 2, but their sum is 11, of degree 0.
Also the zero polynomial is not in the set. In contrast, polynomials of degree at most 2 (P2P_2) form a vector space.

Question 10hard

Let VV be the set of positive real numbers with x⊕y=xyx \oplus y = xy and c⊙x=xcc \odot x = x^c. Is VV a vector space? If so, give its zero vector and the inverse of xx.

Show answer
Yes; zero vector 11, inverse 1/x1/x

Closure: the product of positive numbers and xcx^c are positive. The zero vector is 11: x⊕1=xx \oplus 1 = x. The inverse is 1/x1/x: x⊕1x=1x \oplus \frac1x = 1.
The scalar axioms are the exponent rules: c⊙(x⊕y)=(xy)c=xcycc \odot (x \oplus y) = (xy)^c = x^cy^c, (c+d)⊙x=xc+d=xcxd(c + d) \odot x = x^{c+d} = x^cx^d, 1⊙x=x1 \odot x = x.
All ten axioms hold.

Question 11easy

True or false: In every vector space, 0v=00\mathbf{v} = \mathbf{0} for every vector v\mathbf{v}.

Show answer
True

0v=(0+0)v=0v+0v0\mathbf{v} = (0 + 0)\mathbf{v} = 0\mathbf{v} + 0\mathbf{v}. Add the inverse of 0v0\mathbf{v} to both sides: 0=0v\mathbf{0} = 0\mathbf{v}.
This is a theorem that follows from the axioms; it holds in every vector space.

Question 12medium

Find scalars a,b,ca, b, c with a(1,0,1)+b(1,1,0)+c(0,1,1)=(2,3,5)a(1, 0, 1) + b(1, 1, 0) + c(0, 1, 1) = (2, 3, 5).

Show answer
a=2, b=0, c=3a = 2,\ b = 0,\ c = 3

Equations: a+b=2a + b = 2, b+c=3b + c = 3, a+c=5a + c = 5. Add the three: 2(a+b+c)=102(a + b + c) = 10, a+b+c=5a + b + c = 5.c=5−2=3c = 5 - 2 = 3, a=5−3=2a = 5 - 3 = 2, b=5−5=0b = 5 - 5 = 0.

Verification: Vector operations, dot products and squared norms were computed exactly in node with BigInt fractions; the linear combination questions were solved with the exact RREF; in the nonstandard-operation questions the zero vector, the inverse vector and the axioms were tested numerically at sample points (verify/MAT1041/06.mjs).

Review card

Rⁿ: ordered n-tuples (x1,...,xn). Addition and cu componentwise. Linear combination: w = c1v1 + ... + ckvk. Does it exist? → solve the system [v1 ... vk | w]. Norm: ||v|| = √(v·v). Unit vector: v/||v||. Dot product: u·v = u1v1 + ... + unvn. cos θ = u·v / (||u|| ||v||). u·v = 0 → orthogonal. VECTOR SPACE: addition and scalar multiplication + 10 axioms. Closure: u+v ∈ V, cu ∈ V. Addition: commutative, associative, a zero vector exists, every u has an inverse. Scalar: c(u+v)=cu+cv, (c+d)u=cu+du, c(du)=(cd)u, 1u=u. Examples: Rⁿ, M_{m,n}, P_n (degree ≤ n), C(-∞,∞). Not: polynomials of degree EXACTLY n, vectors with positive coordinates (with standard operations). Nonstandard operations: COMPUTE the zero vector, it may not be (0,0). Theorems: 0v = 0, c0 = 0, (-1)v = -v. To say "not a vector space" ONE concrete counterexample is enough.