Beyond Vectors - speech.ee.ntu.edu.tw

44
Beyond Vectors Hung-yi Lee

Transcript of Beyond Vectors - speech.ee.ntu.edu.tw

Beyond VectorsHung-yi Lee

Introduction

โ€ข Many things can be considered as โ€œvectorsโ€.

โ€ข E.g. a function can be regarded as a vector

โ€ข We can apply the concept we learned on those โ€œvectorsโ€.

โ€ข Linear combination

โ€ข Span

โ€ข Basis

โ€ข Orthogonal โ€ฆโ€ฆ

โ€ข Reference: Chapter 6

Are they vectors?

Are they vectors?

โ€ข A matrix

โ€ข A linear transform

โ€ข A polynomial

๐ด =1 23 4

๐‘ ๐‘ฅ = ๐‘Ž0 + ๐‘Ž1๐‘ฅ +โ‹ฏ+ ๐‘Ž๐‘›๐‘ฅ๐‘›

1234

๐‘Ž0๐‘Ž1โ‹ฎ๐‘Ž๐‘›

Are they vectors?

โ€ข Any function is a vector?

๐‘“ ๐‘ก = ๐‘’๐‘ก ๐‘ฃ =โ‹ฎ?

โ‹ฎ

๐‘” ๐‘ก = ๐‘ก2 โˆ’ 1

๐‘ฃ + ๐‘”

๐‘” =โ‹ฎ?

โ‹ฎ

h ๐‘ก = ๐‘’๐‘ก + ๐‘ก2 โˆ’ 1

What is the zero vector?

What is a vector?

โ€ข If a set of objects V is a vector space, then the objects are โ€œvectorsโ€.

โ€ข Vector space:

โ€ข There are operations called โ€œadditionโ€ and โ€œscalar multiplicationโ€.

โ€ข u, v and w are in V, and a and b are scalars. u+v and au are unique elements of V

โ€ข The following axioms hold:

โ€ข u + v = v + u, (u +v) + w = u +(v + w)

โ€ข There is a โ€œzero vectorโ€ 0 in V such that u + 0 = u

โ€ข There is โ€“u in V such that u +(-u) = 0

โ€ข 1u = u, (ab)u = a(bu), a(u+v) = au +av, (a+b)u = au +bu

unique

Rn is a vector space

Objects in Different Vector Spaces

In Vector Space R1

In Vector Space R2

1 2 3

(1,0) (2,0) (3,0)

Objects in Different Vector Spaces

๐‘“ ๐‘ก = 1 ๐‘” ๐‘ก = ๐‘ก + 1 โ„Ž ๐‘ก = ๐‘ก2 + ๐‘ก + 1

All the polynomials with degree less than or equal to 2 as a vector space

All functions as a vector space

100

110

111

Vectors with infinite dimensions

Subspaces

Review: Subspace

โ€ข A vector set V is called a subspace if it has the following three properties:

โ€ข 1. The zero vector 0 belongs to V

โ€ข 2. If u and w belong to V, then u+w belongs to V

โ€ข 3. If u belongs to V, and c is a scalar, then cubelongs to V

Closed under (vector) addition

Closed under scalar multiplication

Are they subspaces?

โ€ข All the functions pass 0 at t0

โ€ข All the matrices whose trace equal to zero

โ€ข All the matrices of the form

โ€ข All the continuous functions

โ€ข All the polynomials with degree n

โ€ข All the polynomials with degree less than or equal to n

๐‘Ž ๐‘Ž + ๐‘๐‘ 0

P: all polynomials, Pn: all polynomials with degree less than or equal to n

Linear Combinationand Span

Linear Combination and Span

โ€ข Matrices

๐‘† =1 00 โˆ’1

,0 10 0

,0 01 0

Linear combination with coefficient a, b, c

๐‘Ž1 00 โˆ’1

+ ๐‘0 10 0

+ ๐‘0 01 0

=๐‘Ž ๐‘๐‘ โˆ’๐‘Ž

What is Span S?

All 2x2 matrices whose trace equal to zero

Linear Combination and Span

โ€ข Polynomials

๐‘† = 1, ๐‘ฅ, ๐‘ฅ2, ๐‘ฅ3

Is ๐‘“ ๐‘ฅ = 2 + 3๐‘ฅ โˆ’ ๐‘ฅ2 linear combination of the โ€œvectorsโ€ in S?

๐‘“ ๐‘ฅ = 2 โˆ™ 1 + 3 โˆ™ ๐‘ฅ + โˆ’1 โˆ™ ๐‘ฅ2

๐‘†๐‘๐‘Ž๐‘› 1, ๐‘ฅ, ๐‘ฅ2, ๐‘ฅ3

๐‘†๐‘๐‘Ž๐‘› 1, ๐‘ฅ,โ‹ฏ , ๐‘ฅ๐‘›, โ‹ฏ

= ๐‘ƒ3

= ๐‘ƒ

Linear Transformation

Linear transformation

โ€ข A mapping (function) T is called linear if for all โ€œvectorsโ€ u, v and scalars c:

โ€ข Preserving vector addition:

โ€ข Preserving vector multiplication:

๐‘‡ ๐‘ข + ๐‘ฃ = ๐‘‡ ๐‘ข + ๐‘‡ ๐‘ฃ

๐‘‡ ๐‘๐‘ข = ๐‘๐‘‡ ๐‘ข

Is matrix transpose linear?

Input: m x n matrices, output: n x m matrices

Linear transformation

โ€ข Derivative:

โ€ข Integral from a to b

Derivativefunction f function fโ€™e.g. x2 e.g. 2x

Integralfunction f

scalar

e.g. x2

e.g. 1

3๐‘3 โˆ’ ๐‘Ž3

เถฑ๐‘Ž

๐‘

๐‘“ ๐‘ก ๐‘‘๐‘ก

(from a to b)

linear?

linear?

Null Space and Range

โ€ข Null Space

โ€ข The null space of T is the set of all vectors such that T(v)=0

โ€ข What is the null space of matrix transpose?

โ€ข Range

โ€ข The range of T is the set of all images of T.

โ€ข That is, the set of all vectors T(v) for all v in the domain

โ€ข What is the range of matrix transpose?

One-to-one and Onto

โ€ข U: Mmnโ†’Mnm defined by U(A) = AT. โ€ข Is U one-to-one?

โ€ข Is U onto?

โ€ข D: P3 โ†’ P3 defined by D( f ) = f โ€ข Is D one-to-one?

โ€ข Is D onto?

yes

yes

no

no

Isomorphism (ๅŒๆง‹)

Biology Graph

Chemistry

Isomorphism

โ€ข Let V and W be vector space.

โ€ข A linear transformation T: Vโ†’W is called an isomorphism if it is one-to-one and onto

โ€ข Invertible linear transform

โ€ข W and V are isomorphic.

W V

Example 1: U: Mmnโ†’Mnm defined by U(A) = AT.

Example 2: T: P2โ†’ R3

๐‘‡ ๐‘Ž + ๐‘๐‘ฅ +๐‘

2๐‘ฅ2 =

๐‘Ž๐‘๐‘

Basis

A basis for subspace V is a linearly independent generation set of V.

Independent

โ€ข Example

โ€ข Example

S = {x2 - 3x + 2, 3x2 โˆ’ 5x, 2x โˆ’ 3} is a subset of P2.

Is it linearly independent?

No

implies that a = b = c = 0

is a subset of 2x2 matrices.

Yes

Is it linearly independent?

Independent

โ€ข Example

โ€ข Example

icixi = 0 implies ci = 0 for all i.

The infinite vector set {1, x, x2, , xn, }

Is it linearly independent?

Yes

S = {et, e2t, e3t} Is it linearly independent?

aet + be2t + ce3t = 0 a + b + c = 0

aet + 2be2t + 3ce3t = 0

aet + 4be2t + 9ce3t = 0

a + 2b + 3c = 0

a + 4b + 9c = 0

Yes

If {v1, v2, โ€ฆโ€ฆ, vk} are L.I., and T is an isomorphism, {T(v1), T(v2), โ€ฆโ€ฆ, T(vk)} are L.I.

Basis

โ€ข Example

โ€ข Example

For the subspace of all 2 x 2 matrices,

S = {1, x, x2, , xn, } is a basis of P.

The basis is

Dim = 4

Dim = inf

Vector Representation of Object

โ€ข Coordinate Transformation

basis

Pn: Basis: {1, x, x2, , xn}

๐‘ ๐‘ฅ = ๐‘Ž0 + ๐‘Ž1๐‘ฅ +โ‹ฏ+ ๐‘Ž๐‘›๐‘ฅ๐‘›

๐‘Ž0๐‘Ž1โ‹ฎ๐‘Ž๐‘›

Matrix Representation of Linear Operatorโ€ข Example:

โ€ข D (derivative): P2 โ†’ P2 Represent it as a matrix

polynomial polynomial

vector vector

Derivative

Multiply a matrix

2 โˆ’ 3๐‘ฅ + 5๐‘ฅ2 โˆ’3 + 10๐‘ฅ

2โˆ’35

โˆ’3100

Matrix Representation of Linear Operatorโ€ข Example:

โ€ข D (derivative): P2 โ†’ P2 Represent it as a matrix

polynomial polynomial

vector vector

Multiply a matrix

Derivative

100

010

001

1

๐‘ฅ

๐‘ฅ2

0

1

2๐‘ฅ

000

100

020

0 1 00 0 20 0 0

Matrix Representation of Linear Operatorโ€ข Example:

โ€ข D (derivative): P2 โ†’ P2 Represent it as a matrix

polynomial polynomial

vector vector

Multiply a matrix

Derivative

0 1 00 0 20 0 0

5 โˆ’ 4๐‘ฅ + 3๐‘ฅ2 โˆ’4 + 6๐‘ฅ

5โˆ’43

โˆ’460

0 1 00 0 20 0 0

5โˆ’43

Not invertible

Matrix Representation of Linear Operatorโ€ข Example:

โ€ข D (derivative): Function set F โ†’ Function set F

โ€ข Basis of F is ๐‘’๐‘ก cos ๐‘ก , ๐‘’๐‘ก sin ๐‘ก

Function in F Function in F

vector vector

Multiply a matrix

Derivative

1 1โˆ’1 1

10

01

1โˆ’1

11

invertible

Matrix Representation of Linear Operator

Function in F Function in F

vector vector

Multiply a matrix

Derivative

1 1โˆ’1 1

โˆ’1/21/2

01

Basis of F is ๐‘’๐‘ก cos ๐‘ก , ๐‘’๐‘ก sin ๐‘ก

1/2 โˆ’1/21/2 1/2

Antiderivative

Eigenvalue and Eigenvector

๐‘‡ ๐‘ฃ = ๐œ†๐‘ฃ, ๐‘ฃ โ‰  0, v is eigenvector, ๐œ† is eigenvalue

Eigenvalue and Eigenvector

โ€ข Consider derivative (linear transformation, input & output are functions)

โ€ข Consider Transpose (also linear transformation, input & output are functions)

Is ๐‘“ ๐‘ก = ๐‘’๐‘Ž๐‘ก an โ€œeigenvectorโ€? What is the โ€œeigenvalueโ€?

Every scalar is an eigenvalue of derivative.

Symmetric:

Skew-symmetric:

๐ด๐‘‡ = ๐ด

๐ด๐‘‡ = โˆ’๐ด

Is ๐œ† = 1 an eigenvalue?

Symmetric matrices form the eigenspace

Skew-symmetric matrices form the eigenspace.

Is ๐œ† = โˆ’1 an eigenvalue?

2x2 matrices 2x2 matrices

vector

transpose

Consider Transpose of 2x2 matrices

1000

1 00 0

1 00 0

1000

What are the eigenvalues?

0100

0010

0001

0010

0100

0001

vector

Eigenvalue and Eigenvector

โ€ข Consider Transpose of 2x2 matrices

๐‘Ž ๐‘๐‘ ๐‘

0 ๐‘Žโˆ’๐‘Ž 0

Matrix representation

of transpose

Characteristic polynomial

๐‘ก โˆ’ 1 3 ๐‘ก + 1

๐œ† = 1 ๐œ† = โˆ’1

Symmetric matrices Skew-symmetric matrices

Dim=3 Dim=1

Inner Product

Inner Product

Inner Productโ€œvectorโ€ v

โ€œvectorโ€ uscalar

๐‘ข, ๐‘ฃ

For any vectors u, v and w, and any scalar a, the following axioms hold:

1. ๐‘ข, ๐‘ข > 0 if ๐‘ข โ‰  0

2. ๐‘ข, ๐‘ฃ = ๐‘ฃ, ๐‘ข 4. ๐‘Ž๐‘ข, ๐‘ฃ = ๐‘Ž ๐‘ข, ๐‘ฃ

3. ๐‘ข + ๐‘ฃ,๐‘ค = ๐‘ข,๐‘ค + ๐‘ฃ,๐‘ค

Dot product is a special case of inner product

Can you define other inner product for normal vectors?

Norm (length):

Orthogonal: Inner product is zero

๐‘ฃ = ๐‘ฃ, ๐‘ฃ

Inner Product

โ€ข Inner Product of Matrix

Frobeniusinner product

๐ด, ๐ต = ๐‘ก๐‘Ÿ๐‘Ž๐‘๐‘’ ๐ด๐ต๐‘‡

= ๐‘ก๐‘Ÿ๐‘Ž๐‘๐‘’ ๐ต๐ด๐‘‡

Element-wise multiplication

๐ด =1 23 4

๐ด = 12 + 22 + 32 + 42

Inner Product

โ€ข Inner product for general functions

Is ๐‘” ๐‘ฅ = 1 and โ„Ž ๐‘ฅ = ๐‘ฅ orthogonal?

Can it be inner product for general functions?

1. ๐‘ข, ๐‘ข > 0 if ๐‘ข โ‰  0

2. ๐‘ข, ๐‘ฃ = ๐‘ฃ, ๐‘ข

4. ๐‘Ž๐‘ข, ๐‘ฃ = ๐‘Ž ๐‘ข, ๐‘ฃ

3. ๐‘ข + ๐‘ฃ,๐‘ค = ๐‘ข,๐‘ค + ๐‘ฃ,๐‘ค

Orthogonal/Orthonormal Basis

โ€ข Let u be any vector, and w is the orthogonal projection of u on subspace W.

โ€ข Let ๐‘† = ๐‘ฃ1, ๐‘ฃ2, โ‹ฏ , ๐‘ฃ๐‘˜ be an orthogonal basis of W.

โ€ข Let ๐‘† = ๐‘ฃ1, ๐‘ฃ2, โ‹ฏ , ๐‘ฃ๐‘˜ be an orthonormal basis of W.

๐‘ค = ๐‘1๐‘ฃ1 + ๐‘2๐‘ฃ2 +โ‹ฏ+ ๐‘๐‘˜๐‘ฃ๐‘˜

๐‘ข โˆ™ ๐‘ฃ1๐‘ฃ1

2

๐‘ข โˆ™ ๐‘ฃ2๐‘ฃ2

2

๐‘ข โˆ™ ๐‘ฃ๐‘˜๐‘ฃ๐‘˜

2

๐‘ค = ๐‘1๐‘ฃ1 + ๐‘2๐‘ฃ2 +โ‹ฏ+ ๐‘๐‘˜๐‘ฃ๐‘˜

๐‘ข โˆ™ ๐‘ฃ1 ๐‘ข โˆ™ ๐‘ฃ2 ๐‘ข โˆ™ ๐‘ฃ๐‘˜

Orthogonal Basis

Let ๐‘ข1, ๐‘ข2, โ‹ฏ , ๐‘ข๐‘˜ be a basis of a subspace V. How to transform ๐‘ข1, ๐‘ข2, โ‹ฏ , ๐‘ข๐‘˜ into an orthogonal basis ๐‘ฃ1, ๐‘ฃ2, โ‹ฏ , ๐‘ฃ๐‘˜ ?

Then ๐‘ฃ1, ๐‘ฃ2, โ‹ฏ , ๐‘ฃ๐‘˜ is an orthogonal basis for W

After normalization, you can get orthonormal basis.

Gram-Schmidt Process

Orthogonal/Orthonormal Basis

โ€ข Find orthogonal/orthonormal basis for P2

โ€ข Define an inner product of P2 by

โ€ข Find a basis {1, x, x2}๐‘ข1, ๐‘ข2, ๐‘ข3

๐‘ฃ1, ๐‘ฃ2, ๐‘ฃ3

Orthogonal/Orthonormal Basis

โ€ข Find orthogonal/orthonormal basis for P2

โ€ข Define an inner product of P2 by

โ€ข Get an orthogonal basis {1, x, x2-1/3}

Orthonormal Basis

Orthonormal Basis