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

23
ENGG2013 Unit 4 Checking out at sushi bar Jan, 2011.
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    217
  • download

    2

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

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

ENGG2013Unit 4 Checking out at sushi bar

Jan, 2011.

Page 2: ENGG2013 Unit 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”.

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

Illustration

kshum ENGG2013 3

x

y

(0,0)

(5,3)

5

3

(4,4)

(1,-1)

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

Notation using column vector

kshum ENGG2013 4

x

y

5

3

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

Notation from Physics

kshum ENGG2013 5

x

y

zhas the same meaning as

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

Interpretation of vector (I)

kshum ENGG2013 6

y

(5,3)

5

3

location

or

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

Interpretation of vector (2)

kshum ENGG2013 7

y

(0,0)

(5,3)

5

3

an arrow from the origin

or

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

Interpretation of vector (3)

kshum ENGG2013 8

y

(0,0)

(5,3)

5

3

Any arrow in the same directionwith the same length

or

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

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

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

Equality for vectors...

• … is just equality in each component• Examples

kshum ENGG2013 10

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

Vector addition …

• … is just component-wise addition

kshum ENGG2013 11

But has no meaning.

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

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

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

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

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

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.

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

Simple properties

kshum ENGG2013 15

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

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

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

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

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

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

Example

kshum ENGG2013 18

is un-defined.

2x4 3x1

2x4 4x12x1

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

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

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

Nutrition problem

kshum ENGG2013 20

In matrix notation:

Amounts offood A, B,C and D

Requirementsof the fournutrients

(protein)(carbohydrate)

(vitamin A)

(vitamin C)

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

Vector equation

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

kshum ENGG2013 21

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

The nutrition problem asvector equation

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

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

Four different perspectives

kshum ENGG2013 23

A system of linear equations Ax = b

Augmented matrixVector equation