Math19b Spring 2011 Midterm Review - Harvard … · Math19b Spring 2011 Midterm Review March 21,...

106
Math19b Spring 2011 Midterm Review March 21, 2011 Tuesday, March 22, 2011

Transcript of Math19b Spring 2011 Midterm Review - Harvard … · Math19b Spring 2011 Midterm Review March 21,...

Math19b Spring 2011

Midterm Review

March 21, 2011

Tuesday, March 22, 2011

Probability Spaces

Bayes Formula

Random variables

Combinatorics

Expectation, Variance, Covariance

Binomial Distribution

Part I: Probability

Tuesday, March 22, 2011

Probability Space

Ω

Α

P[A] probability of event A

Ω lab

A eventB

C

Tuesday, March 22, 2011

Finite Probability Space

P[A] =

Ω finite

| Ω||A|good cases

all casesTuesday, March 22, 2011

Conditional Probability

P[A B]

P[A|B] =

P[B]

Ω B

A

Tuesday, March 22, 2011

Bayes Formula

P[B | A]P[A|B] =

P[B|A] +

P[A]

P[B|A ]

.c

Tuesday, March 22, 2011

Example: We throw 9 dice. What is the probability that the first dice is 6 if we know that in total 5 times 6 has turned up?

Tuesday, March 22, 2011

Blackboard problem.

Tuesday, March 22, 2011

A={first dice =6}B={5 dice are 6}

P[A|B] unknown

P[B|A] and P[B|A ]c

are knownP[A] is known

Tuesday, March 22, 2011

Example (from lecture) A dice shows k eyes. Throw k coins. All show head. What is the probability that the dice had 6

Tuesday, March 22, 2011

B= { all head} A = { die = k }k

P[A | B] = 6

P[B | A ] P[A ] 6 6

P[B]

P[B] = P[B | A ] P[A ] k k

∑k

Tuesday, March 22, 2011

Independent Events

P[A B] =P[A] P[B]

Α

B

Tuesday, March 22, 2011

Random Variable

2415

X=

E[X]=(2+4+1+5)/4=3

Var[X]=E[X ]- E[X] =(4+16+1+25)/4-9

22

Tuesday, March 22, 2011

Independent vectorsindependent random variables

1111

X=

21-1-2

Y=

22-2-2

Z=

Two of them are independent random variables. Which ones?

Tuesday, March 22, 2011

Binomial distribution

pk(1-p)n-k

P[X=k] =

Probability of k hits

nk( )

Tuesday, March 22, 2011

p=1/4

Tuesday, March 22, 2011

Tuesday, March 22, 2011

p=1/2

Tuesday, March 22, 2011

Tuesday, March 22, 2011

p=3/4

Tuesday, March 22, 2011

Tuesday, March 22, 2011

Expectation Variance

•E[X] = ∑ x P[X=x] Expectation

•Var[X] = E[X ] - E[X] Variance

•σ[X] = √Var[X] Standard deviation

•Cov[X,Y] = E[X Y] - E[X] E[Y] Covariance

•Cor[X,Y]=Cov[X,Y]/(σ[X] σ[Y]) Correlation

Tuesday, March 22, 2011

Pythagoras

Var[X+Y] = Var[X] + Var[Y]+2 Cov[X,Y]

Tuesday, March 22, 2011

Example

X(k) = 2 if prime, else 0

throw a dice

Y(k) = 3 if k +1, else 0

Find, E[X],E[Y],Var[X],Var[Y],Cov[X,Y]

2

Tuesday, March 22, 2011

Matrices and Matrix Algebra

Solving Systems of Linear Equations

Linear Transformations

Basis of image and kernel

Change of Coordinates, Similarity

Part II: Linear Algebra

Tuesday, March 22, 2011

1. Matrices

Tuesday, March 22, 2011

3 1 4 5 1

1

2

1

1 1 2 2

1 4 1 1

1 4 5 -3

m=5

n=4

n x m matrix

Tuesday, March 22, 2011

3 1 4 5 1

1

2

1

1 1 2 2

1 4 1 1

1 4 5 -3

m=5

n=4

n x m matrix

Tuesday, March 22, 2011

3 1 4 5 1

1

2

1

1 1 2 2

1 4 1 1

1 4 5 -3

m=5

n=4

n x m matrix

Tuesday, March 22, 2011

3 1 4 5 1

1

2

1

1 1 2 2

1 4 1 1

1 4 5 -3

m=5

n=4

n x m matrix

Tuesday, March 22, 2011

3 1 4 5 1

1

2

1

1 1 2 2

1 4 1 1

1 4 5 -3

m=5

n=4

n x m matrix

Tuesday, March 22, 2011

Ax =

x1

x

x1 += x2

v1 v2 vm

v1

v2

xm vm

2

xm

Column picture

+.... +

Tuesday, March 22, 2011

x1 +=

12

34

56

x1x2

x3

12

34

+ x2

56

+ x3

78

x4

78

+ x4

Example

Tuesday, March 22, 2011

Ax=

A x = 0A x = b

Row picture

Tuesday, March 22, 2011

1246

1468

to find all vectors perpendicular to these

two vectors:

Example

Tuesday, March 22, 2011

1246

1468

to find all vectors perpendicular to these

two vectors:

1 2 4 6

1 4 6 8

solve A x = 0, where A contains the vectors as rows.

x

A x =

Example

Tuesday, March 22, 2011

=

nxm mxp

nxp

.

Matrix multiplication

Tuesday, March 22, 2011

=

1x8 8x1.1 2 3 4 5 6 7 8 1

1111111

36

1x1

Example

Tuesday, March 22, 2011

=

8x1

. 1

11111111

1x8

1 2 3 4 5 6 7 8

8x8

Example

Tuesday, March 22, 2011

0 -1

1 0

1

0

-1 0

0 -1 1

2 1

1 3

2

1

0 1 1

-1 -2

2 1

0

2

-1 -2 0

=

Matrix Algebra

nxn nxn

nxnTuesday, March 22, 2011

rotate reflect

reflect rotate

Not Commutative

0 -1

1 0

0 -1

1 0

0 1

1 0

0 1

1 0

-1 0

0 1=

=1 0

0 -1

Tuesday, March 22, 2011

Not invertible in general

0 0

0 1

0 1

0 0

1 1

1 1

Tuesday, March 22, 2011

(A-B) (A+B) = A - B

B = S A S implies A = S B S

A X B = A -B implies X = B - A

2 2

-1 -1

-1 -1

Blackboard Problems:True or False:

A and B=S A S-1

are similar

Tuesday, March 22, 2011

2. Linear Equations

Tuesday, March 22, 2011

Linear Equations2 x + y + 5 z + w = 3 2 x + 2 z - 2 w = 6

Tuesday, March 22, 2011

Linear Equations2 x + y + 5 z + w = 3 2 x + 2 z - 2 w = 6 x

y

z=

3

6

2 1 5

2 20

1

-2

w

Tuesday, March 22, 2011

Linear Equations

x

y

z=

3

6

2 1 5

2 20

1

-2

w

Tuesday, March 22, 2011

Linear Equations

x

y

z=

3

6

2 1 5

2 20

1

-2

w

2 1 5

2 20

1

-2

3

6

Tuesday, March 22, 2011

rowreduction

Tuesday, March 22, 2011

2 1 5

2 20

3

6

1

-2

rowreduction

Tuesday, March 22, 2011

2 1 5

2 20

3

6

1

-2

1 0 1

2 51

3

3

-1

1

rowreduction

Tuesday, March 22, 2011

2 1 5

2 20

3

6

1

-2

1 0 1

2 51

3

3

-1

1

1 0 1

0 31

3

-3

-1

5

rowreduction

Tuesday, March 22, 2011

1 0 1

0 31

3

-3

-1

5

s t

Tuesday, March 22, 2011

1 0 1

0 31

3

-3

-1

5

s t

x + s - t = 3

y+3s+5t=-3z=sw=t

Tuesday, March 22, 2011

1 0 1

0 31

3

-3

-1

5

s t

x + s - t = 3

y+3s+5t=-3z=sw=t

x

y

z

w

s

-1

-3

1

0

+ t

1

5

0

1

+

3

-3

0

0

=

Tuesday, March 22, 2011

Scale a

row

Swap two rows

Subtractrow fromother row

S S S

Gauss-Jordan Elimination

Tuesday, March 22, 2011

rref death of milkshake

Tuesday, March 22, 2011

Number of Solutions

Tuesday, March 22, 2011

Number of Solutions

B=[A|b] = m

A bTuesday, March 22, 2011

one solution

consistentrank(A)=m

Number of Solutions

B=[A|b] = m

A bTuesday, March 22, 2011

zero solutionsinconsistentrank(B)>rank(A)

one solution

consistentrank(A)=m

Number of Solutions

B=[A|b] = m

A bTuesday, March 22, 2011

zero solutionsinconsistentrank(B)>rank(A)

one solution

consistentrank(A)=m

Number of Solutionsinfinitely many

consistentrank(A)=rank(B)

< m

B=[A|b] = m

A bTuesday, March 22, 2011

1 1

1 2 3

11000

1 6 2

00

0 0 0 0 0

0 1

1

000

0

00

1 0 0

10000 010

10000 100

00000 000

How many solutions?augmented matrix

Tuesday, March 22, 2011

Row reduced properties

0 1 4

0 00

0

1

Tuesday, March 22, 2011

Row reduced propertiesFirst

nonzerorow

element is 1

0 1 4

0 00

0

1

Tuesday, March 22, 2011

Row reduced propertiesFirst

nonzerorow

element is 1

Columnwith

leading 1 has no other

nonzero entry

0 1 4

0 00

0

1

Tuesday, March 22, 2011

Row reduced propertiesFirst

nonzerorow

element is 1

Columnwith

leading 1 has no other

nonzero entry

Row aboverow withleading 1

has leading 1to the left

0 1 4

0 00

0

1

Tuesday, March 22, 2011

110 8 8 8

800

0008 8

000

00

0

row reduced?

Tuesday, March 22, 2011

10 0 0 8

880

0

0 0000

00

8

000

0000 00

11

1 8row reduced?

Tuesday, March 22, 2011

21 11

invert this matrixwith row reduction

Tuesday, March 22, 2011

3. Linear Transformations

Look at the image of the basis vectors.

Tuesday, March 22, 2011

Rotations

Reflections

Projections

Shears

Dilations

Combinations

Tuesday, March 22, 2011

Tuesday, March 22, 2011

Tuesday, March 22, 2011

Tuesday, March 22, 2011

Tuesday, March 22, 2011

Tuesday, March 22, 2011

-

Tuesday, March 22, 2011

Basis

Tuesday, March 22, 2011

im(A)

im(A) = { Ax | x in V }

ker(A) = { x | Ax =0 }

ker(A)

Tuesday, March 22, 2011

vv

1

2 v3

Basis: linearly independent and spanning

Tuesday, March 22, 2011

When do we have a basis?Tuesday, March 22, 2011

vv v

1

23

v v v1 2 3

A =

look at the matrix A

trivial kernelTuesday, March 22, 2011

vv v

1

23

v v v1 2 3

A =

V is in the image of A

Tuesday, March 22, 2011

Standard BasisTuesday, March 22, 2011

1000

0100

0010

0001

e1

e2

e3

e4

Standard Basis

Tuesday, March 22, 2011

2111

1211

1121

1112

v1

v2

v3 v4

Is this a basis? Tuesday, March 22, 2011

dim(im(A)) + dim(ker(A)) = m

m

nPivot or

not pivot, that ishere the question

Rank-Nullety Theorem

Tuesday, March 22, 2011

The basis is the set of pivot columns.

The basis is obtained by solving the linear system in row reduced

echelon form and taking free variables.

Kernel computation

Image computation

Tuesday, March 22, 2011

11

0 0 0 10001

0100

0

1 00101 0 0 0 1

Tuesday, March 22, 2011

Coordinates

Tuesday, March 22, 2011

A vector gets coordinates if a

basis is fixed

2111

2120{ }

Tuesday, March 22, 2011

[v] = S v-1

B

Coordinates in Basis B

S = v v2 v n v1

Tuesday, March 22, 2011

B = S A S-1

Tuesday, March 22, 2011

1000

1100

1110

1111

{ },,,B=What are the B

coordinates of v =

1234

Tuesday, March 22, 2011

1000

1100

1110

1111

S=1000

-1100

0-110

00-11

S=-1

Tuesday, March 22, 2011

1000

-1100

0-110

00-11

Sv=-1 1

234

=-1-1-14

Tuesday, March 22, 2011

1 24 6

0 1-1 2

Write A in the basis B

{ },B=

A=

Tuesday, March 22, 2011

Problem

Find the matrix A of the reflection at the line

[-1,1,1]

Tuesday, March 22, 2011

B = S A S -1

The only matrix similar to the identity matrix is the identity matrix itself.

B = S A S -1 nn

The matrices A,B describe the same transformation!

Similarity

Tuesday, March 22, 2011

Linear Spaces

Tuesday, March 22, 2011

R 2

R 1R 0

R 3

ker(A), im(A)

Tuesday, March 22, 2011

0

-4

-2

0

2

4

5

7

1 2 3 4 5 6 7 84 51-1-2

-4

-2

0

2

4

5

7

1 2 3 4 5 6 7 8

1237

Tuesday, March 22, 2011

4 0

0

8878

vectors functions

RandomVariablesVectors

Tuesday, March 22, 2011

linear independence

independent random variables

Tuesday, March 22, 2011

The end

Dave Eggar, Floating, Album: Left of BlueTuesday, March 22, 2011