Page 1
Math19b Spring 2011
Midterm Review
March 21, 2011
Tuesday, March 22, 2011
Page 2
Probability Spaces
Bayes Formula
Random variables
Combinatorics
Expectation, Variance, Covariance
Binomial Distribution
Part I: Probability
Tuesday, March 22, 2011
Page 3
Probability Space
Ω
Α
P[A] probability of event A
Ω lab
A eventB
C
Tuesday, March 22, 2011
Page 4
Finite Probability Space
P[A] =
Ω finite
| Ω||A|good cases
all casesTuesday, March 22, 2011
Page 5
Conditional Probability
P[A B]
P[A|B] =
P[B]
Ω B
A
Tuesday, March 22, 2011
Page 6
Bayes Formula
P[B | A]P[A|B] =
P[B|A] +
P[A]
P[B|A ]
.c
Tuesday, March 22, 2011
Page 7
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
Page 8
Blackboard problem.
Tuesday, March 22, 2011
Page 9
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
Page 10
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
Page 11
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
Page 12
Independent Events
P[A B] =P[A] P[B]
Α
B
Tuesday, March 22, 2011
Page 13
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
Page 14
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
Page 15
Binomial distribution
pk(1-p)n-k
P[X=k] =
Probability of k hits
nk( )
Tuesday, March 22, 2011
Page 16
p=1/4
Tuesday, March 22, 2011
Page 17
Tuesday, March 22, 2011
Page 18
p=1/2
Tuesday, March 22, 2011
Page 19
Tuesday, March 22, 2011
Page 20
p=3/4
Tuesday, March 22, 2011
Page 21
Tuesday, March 22, 2011
Page 22
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
Page 23
Pythagoras
Var[X+Y] = Var[X] + Var[Y]+2 Cov[X,Y]
Tuesday, March 22, 2011
Page 24
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
Page 25
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
Page 26
1. Matrices
Tuesday, March 22, 2011
Page 27
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
Page 28
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
Page 29
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
Page 30
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
Page 31
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
Page 32
Ax =
x1
x
x1 += x2
v1 v2 vm
v1
v2
xm vm
2
xm
Column picture
+.... +
Tuesday, March 22, 2011
Page 33
x1 +=
12
34
56
x1x2
x3
12
34
+ x2
56
+ x3
78
x4
78
+ x4
Example
Tuesday, March 22, 2011
Page 34
Ax=
A x = 0A x = b
Row picture
Tuesday, March 22, 2011
Page 35
1246
1468
to find all vectors perpendicular to these
two vectors:
Example
Tuesday, March 22, 2011
Page 36
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
Page 37
=
nxm mxp
nxp
.
Matrix multiplication
Tuesday, March 22, 2011
Page 38
=
1x8 8x1.1 2 3 4 5 6 7 8 1
1111111
36
1x1
Example
Tuesday, March 22, 2011
Page 39
=
8x1
. 1
11111111
1x8
1 2 3 4 5 6 7 8
8x8
Example
Tuesday, March 22, 2011
Page 40
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
Page 41
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
Page 42
Not invertible in general
0 0
0 1
0 1
0 0
1 1
1 1
Tuesday, March 22, 2011
Page 43
(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
Page 44
2. Linear Equations
Tuesday, March 22, 2011
Page 45
Linear Equations2 x + y + 5 z + w = 3 2 x + 2 z - 2 w = 6
Tuesday, March 22, 2011
Page 46
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
Page 47
Linear Equations
x
y
z=
3
6
2 1 5
2 20
1
-2
w
Tuesday, March 22, 2011
Page 48
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
Page 49
rowreduction
Tuesday, March 22, 2011
Page 50
2 1 5
2 20
3
6
1
-2
rowreduction
Tuesday, March 22, 2011
Page 51
2 1 5
2 20
3
6
1
-2
1 0 1
2 51
3
3
-1
1
rowreduction
Tuesday, March 22, 2011
Page 52
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
Page 53
1 0 1
0 31
3
-3
-1
5
s t
Tuesday, March 22, 2011
Page 54
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
Page 55
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
Page 56
Scale a
row
Swap two rows
Subtractrow fromother row
S S S
Gauss-Jordan Elimination
Tuesday, March 22, 2011
Page 57
rref death of milkshake
Tuesday, March 22, 2011
Page 58
Number of Solutions
Tuesday, March 22, 2011
Page 59
Number of Solutions
B=[A|b] = m
A bTuesday, March 22, 2011
Page 60
one solution
consistentrank(A)=m
Number of Solutions
B=[A|b] = m
A bTuesday, March 22, 2011
Page 61
zero solutionsinconsistentrank(B)>rank(A)
one solution
consistentrank(A)=m
Number of Solutions
B=[A|b] = m
A bTuesday, March 22, 2011
Page 62
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
Page 63
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
Page 64
Row reduced properties
0 1 4
0 00
0
1
Tuesday, March 22, 2011
Page 65
Row reduced propertiesFirst
nonzerorow
element is 1
0 1 4
0 00
0
1
Tuesday, March 22, 2011
Page 66
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
Page 67
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
Page 68
110 8 8 8
800
0008 8
000
00
0
row reduced?
Tuesday, March 22, 2011
Page 69
10 0 0 8
880
0
0 0000
00
8
000
0000 00
11
1 8row reduced?
Tuesday, March 22, 2011
Page 70
21 11
invert this matrixwith row reduction
Tuesday, March 22, 2011
Page 71
3. Linear Transformations
Look at the image of the basis vectors.
Tuesday, March 22, 2011
Page 72
Rotations
Reflections
Projections
Shears
Dilations
Combinations
Tuesday, March 22, 2011
Page 73
Tuesday, March 22, 2011
Page 74
Tuesday, March 22, 2011
Page 75
Tuesday, March 22, 2011
Page 76
Tuesday, March 22, 2011
Page 77
Tuesday, March 22, 2011
Page 78
-
Tuesday, March 22, 2011
Page 79
Basis
Tuesday, March 22, 2011
Page 80
im(A)
im(A) = { Ax | x in V }
ker(A) = { x | Ax =0 }
ker(A)
Tuesday, March 22, 2011
Page 81
vv
1
2 v3
Basis: linearly independent and spanning
Tuesday, March 22, 2011
Page 82
When do we have a basis?Tuesday, March 22, 2011
Page 83
vv v
1
23
v v v1 2 3
A =
look at the matrix A
trivial kernelTuesday, March 22, 2011
Page 84
vv v
1
23
v v v1 2 3
A =
V is in the image of A
Tuesday, March 22, 2011
Page 85
Standard BasisTuesday, March 22, 2011
Page 86
1000
0100
0010
0001
e1
e2
e3
e4
Standard Basis
Tuesday, March 22, 2011
Page 87
2111
1211
1121
1112
v1
v2
v3 v4
Is this a basis? Tuesday, March 22, 2011
Page 88
dim(im(A)) + dim(ker(A)) = m
m
nPivot or
not pivot, that ishere the question
Rank-Nullety Theorem
Tuesday, March 22, 2011
Page 89
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
Page 90
11
0 0 0 10001
0100
0
1 00101 0 0 0 1
Tuesday, March 22, 2011
Page 91
Coordinates
Tuesday, March 22, 2011
Page 92
A vector gets coordinates if a
basis is fixed
2111
2120{ }
Tuesday, March 22, 2011
Page 93
[v] = S v-1
B
Coordinates in Basis B
S = v v2 v n v1
Tuesday, March 22, 2011
Page 94
B = S A S-1
Tuesday, March 22, 2011
Page 95
1000
1100
1110
1111
{ },,,B=What are the B
coordinates of v =
1234
Tuesday, March 22, 2011
Page 96
1000
1100
1110
1111
S=1000
-1100
0-110
00-11
S=-1
Tuesday, March 22, 2011
Page 97
1000
-1100
0-110
00-11
Sv=-1 1
234
=-1-1-14
Tuesday, March 22, 2011
Page 98
1 24 6
0 1-1 2
Write A in the basis B
{ },B=
A=
Tuesday, March 22, 2011
Page 99
Problem
Find the matrix A of the reflection at the line
[-1,1,1]
Tuesday, March 22, 2011
Page 100
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
Page 101
Linear Spaces
Tuesday, March 22, 2011
Page 102
R 2
R 1R 0
R 3
ker(A), im(A)
Tuesday, March 22, 2011
Page 103
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
Page 104
4 0
0
8878
vectors functions
RandomVariablesVectors
Tuesday, March 22, 2011
Page 105
linear independence
independent random variables
Tuesday, March 22, 2011
Page 106
The end
Dave Eggar, Floating, Album: Left of BlueTuesday, March 22, 2011