ENGG2013 Unit 4 Checking out at sushi bar Jan, 2011.

Post on 21-Dec-2015

218 views 2 download

Tags:

Transcript of ENGG2013 Unit 4 Checking out at sushi bar Jan, 2011.

ENGG2013Unit 4 Checking out at sushi bar

Jan, 2011.

Row and Column Vectors

• column vector

• row vector

• n-dimensionalcolumn vector

kshum ENGG2013 2

n

A list of n numbers written vertically

Convention: a vector isby default a column vectorin ENGG2013.

Convention: The componentsin a vector are sometimecalled “scalar”.

Illustration

kshum ENGG2013 3

x

y

(0,0)

(5,3)

5

3

(4,4)

(1,-1)

Notation using column vector

kshum ENGG2013 4

x

y

5

3

Notation from Physics

kshum ENGG2013 5

x

y

zhas the same meaning as

Interpretation of vector (I)

kshum ENGG2013 6

y

(5,3)

5

3

location

or

Interpretation of vector (2)

kshum ENGG2013 7

y

(0,0)

(5,3)

5

3

an arrow from the origin

or

Interpretation of vector (3)

kshum ENGG2013 8

y

(0,0)

(5,3)

5

3

Any arrow in the same directionwith the same length

or

Mathematical Notation

• The set of all 2-D vectors with real numbers as components is denoted by

• The set of all 3-D vectors with real numbers as components is denoted by

• The set of all n-D vectors with real numbers as components:

kshum ENGG2013 9

Equality for vectors...

• … is just equality in each component• Examples

kshum ENGG2013 10

Vector addition …

• … is just component-wise addition

kshum ENGG2013 11

But has no meaning.

Scalar Multiplication

• Multiply each component by the scalar constant.• Interpreted as lengthening, or shortening the

vector, but keeping the same direction.

kshum ENGG2013 12

x

y

z

Dot product

• A.k.a. scalar product, or inner product.• For 2-D vector,

• It measures the “angle” between two vectors.– The dot product of two vectors is zero if the two

vectors are perpendicular

kshum ENGG2013 13

Dot product in general

• For n-dimensional vectors in general, we define the dot product as

• Example

kshum ENGG2013 14

Two n-dim vectors aresaid to be perpendicular,or orthogonal, if their dot productis equal to 0.

Simple properties

kshum ENGG2013 15

For any two vectors u, v and w of the same dimension, and constants c and d.

Matrix-vector multiplication

• Given an mn matrix A, and an n-dimensional vector x, the product of A and x

is an m-dimensional vector defined as

kshum ENGG2013 16

For double subscripts,the first subscript is therow index and the secondis the column index

Just compute dot products m times

kshum ENGG2013 17

Dot product of the first row in the matrix and the column vector

Dot product of the second row in the matrix and the column vector

Dot product of the last row in the matrix and the column vector

Example

kshum ENGG2013 18

is un-defined.

2x4 3x1

2x4 4x12x1

Checking out in a sushi bar• Four prices

– Red plate: $10– Blue plate: $20– Green plate: $35– Pink plate: $50

kshum ENGG2013 19

Customer A

Customer B

R B G P

Nutrition problem

kshum ENGG2013 20

In matrix notation:

Amounts offood A, B,C and D

Requirementsof the fournutrients

(protein)(carbohydrate)

(vitamin A)

(vitamin C)

Vector equation

• Equation involving vectors.• E.g. Find a and b such that

kshum ENGG2013 21

The nutrition problem asvector equation

• Just another way to write the same thing.kshum ENGG2013 22

Four different perspectives

kshum ENGG2013 23

A system of linear equations Ax = b

Augmented matrixVector equation