Académique Documents
Professionnel Documents
Culture Documents
Web page:
http://www.doc.ic.ac.uk/ jb/teaching/145/
Search engines
Google and the PageRank algorithm
Computer graphics
near photo realism from wireframe and
vector representation
Imperial College
Imperial College
BBC News:
Education
Imperial College
IEEE Research
Awards
Imperial College
Imperial College
Computing
Physics
BBC News:
Education
Imperial College Imperial College
Physics
IEEE Research
Awards
Imperial College
Key points of
model are defined
through vectors
Vectors define po-
sition relative to an
origin
0 1
2
B C
B 5 C
B C is a 4-dimensional integer vector
7 A
0
(comes from set ZZ or ZZ ZZ ZZ ZZ )
4
v
u 3
q uX
jp~j = p21 + p22 + p23 = t
p2i
i=1
0 1
B
3
C p p p
e.g. 4 A = 32 + 4 2 + 5 2 = 50 = 5 2
5
y
z y
x
jp~j
x p1
For a vector, p~ = (p ; p ; p ):
1 2 3
jj
os(x ) = p1 = p
~
os( ) = p =jp
y ~j
2
os( ) = p =jp
z ~j
3
So if p~ = (p ; p ; p
1 2 3 ) and ~q = (q ; q ; q
1 2 3 ) then:
p
~+~
q = (p1 + q1 ; p2 + q2 ; p3 + q3 )
6
~b
*
~a
- x
~a + ~b
METHODS [10/06] – p. 24/129
Vector addition
y
6
6 ~b
~
*
~a
- do it x
~a + ~b = ~
METHODS [10/06] – p. 24/129
Scalar Multiplication
A scalar is just a number, e.g. 3. Unlike a
vector, it has no direction.
Multiplication of a vector p~ by a scalar
means that each element of the vector is
multiplied by the scalar
So if p~ = (p ; p ; p
1 2 3 ) then:
~
p = (p1 ; p2 ; p3 )
~~
p q = 0 if p
~ and ~
q are perpendicular (at right
angles)
Commutative: p~ ~q = ~q p~
Linearity: p~ (~q) = (p~ ~q)
Distributive over addition:
p
~ (~
q +~
r) = p
~ ~
q+p
~ ~
r
~a
-
n
^
-
~a n
^
n
^ is a unit vector, i.e. n
^ =1jj
~a n jj
^ = ~a
os represents the amount of ~a
that points in the n
^ direction
QQQs
3
QQ
A ray of light strikes a reflective surface...
Question: in what direction does the reflection
travel?
Q Qs
~
s
QQ63n
^
~
r
Q
Qk
Q
~
s
Q Qs
QQ63
~
s
n
^
~
r
Q
Qk
Q
~
s
Q Qs
~
s 3
QQ6 n
^
~
r
Q
Qk
Q
~
s
Q Qs
~
s 3
QQ6 n
^
~
r
^ is a unit vector, so jn
But n ^j 2
=1
) = ~r n^ ~s n^
...and ~r n
^ = ~sn ^
) = 2~s n^
Q
Qk
Q
~
s
Q Qs
~
s 3
QQ6 n
^
~
r
r = ~a + d~
~
where:
n
^ is the unit vector perpendicular to the
plane
jmj is the distance from the plane to the
origin (at its closest point)
If the 3 equations:
contradict each other then the lines do not intersect
produce a single solution then the lines do intersect
are all the same (or multiples of each other) then the lines
are identical (and always intersect)
With ~r n
^ =~an ~ n
^ + t(d ^ ) — what are we
trying to find?
We are trying to find a specific value of t
that corresponds to the point of intersection
Since ~r n
^ = s at intersection, we get:
t= s ~a n^
d~ n
^
~0
r = ~a +
s ~a n
^
d~
d~ n^
#
# a
a aaa
# # a
# # q n
#
HHH
^1
6q
n
^2
HH
H
Problem: find the line that represents the
intersection of two planes
Plane 2: ~r n
^ =s
2 2
Line: ~s = ((y j + 4~
5)=2)~i + y~ k
) ~s = 5
2
~i + 4~
k + y (
1~
2
i + ~j )
) ~a ~b =
(a2 b3 a3 b2 )~i (a1 b3 a3 b1 )~j + (a1 b2 a2 b1 )~
k
Useful for: e.g. given 2 lines in a plane, write
down the equation of the plane
If p~ is parallel to ~q then p~ ~q = ~0
where ~0 = 0~i + 0~j + 0~k
NOT commutative: ~a ~b 6= ~b ~a
In fact: ~a ~b = ~b ~a
NOT associative: (~a ~b) ~
6= ~a (~b ~
)
Left distributive: ~a (~b + ~
) = ~a ~b + ~a ~
Right distributive: (~b + ~
) ~a = ~b ~a + ~
~a
Useful results:
solution of linear systems
Google’s PageRank algorithm
3 i 0 1
6I 0 1 1
! B
1 0
C
1 A
0 0 0
1 i
- i2
Yesterday
Sun 0:6 0:4
Rain 0:25 0:75
In general: A + 0 = A and 0 + A = A
METHODS [10/06] – p. 59/129
Matrix Identities
For 2 2 matrices,
!
the multiplicative identity,
1 0
I = :
0 1
! ! !
1
3
2
3
1 0
0 1
=
1
3
2
3
A = A
(A + B ) = A + B
(AB )C = A(BC )
(A + B )C = AC + BC ; C (A + B ) = CA + CB
-
x0 x
Initially: x = r
os and y = r sin
) x0 = x
os y sin
Similarly: y 0 = x sin + y
os
0 1
Thus R =
os sin
A
sin
os
Example:
! ! !
1 2 5 6 19 22
=
3 4 7 8 43 50
! ! !
5 7 1 3 19 43
=
6 8 2 4 22 50
) jAj = 13 + ( 2 24) = 61
r r
( 2) := ( 2) r
( 1) :
0 1 0 1
6 10 302
A! 6 10 302
A
6 2 142 0 8 160
r r
( 2) := ( 2) ( = 8) :
0 1 0 1
6 10 302
A! 6 10 302
A
0 8 160 0 1 20
r r = :
( 1) := ( 1) 6
0 1 0 1
6 0 102
A! 1 0 17
A
0 1 20 0 1 20
0
0 1 0 1
1 1
2.
B
0 b A !
C B
0 1 AC
0 0 0
0 1 0 1
1 1
3.
B
0 1 A !
C B
0 1 AC
0 0
0 0 1
METHODS [10/06] – p. 88/129
Gaussian Elimination: 3 3
0 1 0 1
1 1 0
1 A ! A
B C B C
4. 0 0 1 0
0 0 1 0 0 1
0 1 0 1
1 0 1 0 0
1 0 A ! A
B C B C
5. 0 0 1 0
0 0 1 0 0 1
* represents an unknown entry
A~
v = ~
v
( )
Using jA j
I = 0, we get:
! !
4 1 1 0
= 0
2 3 0 1
!
)
4
2 3
1
= 0
v1 + v 2 = 0 (1:a)
2v1 2v2 = 0 (1:b)
) 2v + v = 0 (and 2v
1 2 1 + v 2 = 0)
) v = 2v
2 1
!
1
Thus second eigenvector is ~v = v1
2
!
1
...or just ~v =
2
Try: y = emx
) 2me + e = 0
mx mx
) e (2m + 1) = 0
mx
) e = 0 or m =
mx 1
2
emx
6 0 for any x; m. Therefore m =
=
1
2
dy
For example:
dx
+ 2xy = x
( )
R x dx x2
Multiply throughout by IF: e 2
=e
) x2 dy
e dx + 2xe y =x2
xe x2
) d
dx
x2
(e y ) = xe x2
)e x2 1 x
y = 2e
2
+C So, y = Ce x2
+
1
2
Try: y = emx
) m e + 5me + 6e = 0
2 mx mx mx
) e (m + 5m + 6) = 0
mx 2
) e (m + 3)(m + 2) = 0
mx
m= 3; 2
i.e. two possible solutions
General solution to ():
x x
y = Ae 2
+ Be
3
Try: y = emx
)me 2 mx
6memx + 9emx = 0
) e (m
mx 2
6m + 9) = 0
) e (m
mx
3)2 = 0
m = 3 (twice)
General solution to () for repeated roots:
y = (Ax + B )e3x
dx
dy2
dx
=
y1 + dy2
!
y1
If we let ~y = , we can rewrite this as:
y2
! ! ! !
y1
a b y1 d~
y a b
d
dx
dy2
= or = ~
y
dx
d y2 dx
d
x
d~
y x
Try ~y =~
ve so, = ~
ve
dx
d~
y
But also = A~
y, so A~v ex v ex
= ~
dx
Now solution of () can be derived from an
eigenvector solution of A~v = ~v
For n eigenvectors ~v ; : : : ; ~vn and corresp.
1
y=B~ 1 1 vn e x n
dx
dy2
dx
= 5y1 + 5y2
!
~
y 2 8
~
y
d
So dx
=
5 5
2 7 30 = ( 10)( + 3) = 0
Giving: ! !
1 8
1 = 10; ~
v1 = ; 2 = 3; ~
v2 =
1 5
Solution of ODEs:
! !
1 x 8 x
~
y = B1 e 10
+ B2 e 3
1 5
METHODS [10/06] – p. 115/129
Partial Derivatives
Used in (amongst others):
Computational Techniques (2nd Year)
Optimisation (3rd Year)
Computational Finance (3rd Year)
200
150
100
50
20
15
0 10
5
10 5
15
20 0
20
15
10 Æy
Æx
5
0
0 1 2 3 4 5
Take f (x) = xn
We want to show that:
df n
= nx
1
dx
f f (x+Æx) f (x)
= limÆx!0
d
dx Æx
n
(x+Æx) xn
= limÆx!0
P n
Æx
n i
( i )xn i Æx xn
i=0
= limÆx!0
P n n
Æx
( i )xn i Æx
i
i=1
= limÆx!0 Æx
Pn i
n n i
= limÆx!0 x Æx 1
(
i=1 i )
n
X
n n n
1)
= limÆx!0 (( 1 ) x xn i Æxi
1
+ i
i
|
=2 {z }
! 0 as Æx!0
n! n
= 1!(n 1)!
x 1
= nxn 1
Parabaloid
200
150
100
50
10
5
-10 0
-5
0 -5
5
10 -10
f (x; y ) = x2 + y 2
200
Section through parabaloid
150
100
50
0
-10 -5 0 5 10
So if f (x; y ) = x 2
+ 2y where x = sin t and
y =
os t then:
f
= 2x
os t 2 sin t = 2 sin t(
os t
d
dt
1)
f (x) dx
dx
dx