Search for notes by fellow students, in your own course and all over the country.

Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.

My Basket

You have nothing in your shopping cart yet.

Title: TMC1874 Mathematics For Computing tutorial 5 solution
Description: Tutorial Solution Chapter 5: Inner Product Spaces

Document Preview

Extracts from the notes are below, to see the PDF you'll receive please use the links above


TMC1874 Mathematics For Computing

Tutorial Solution
Chapter 5: Inner Product Spaces

1
...

(a)

1
−1

0
0

(b)

(c)

3
2

Solution

(a)
(b)
(c)

12 + (−1)2 =

2

02 + (0)2 = 0
32 + (2)2 =

13

2
...

(a) u =

1
0

,v =

2
1

(b) u =

0
0

,v =

3
−1

Solution

(a)
(b)

u−v =

(1 − 2)2 + (0 − 1)2 =

u−v =

=

(0 − 3)2 + (0 + 1)2

2
10

3
...

(a) u =

1
2

,v =

4
−5

(b) u =

1
2

,v =

8
−5

Solution
The distance between u and v:
(a)
(b)

u−v =

(1 − 4)2 + (2 + 5)2 =

58

u−v =

=

98

(1 − 8)2 + (2 + 5)2

The cosine of the angle θ between u and v is given by
cos θ =

W
...
Tiong

·

u v
u v

Page 1 of 13

TMC1874 Mathematics For Computing

(a) cos θ =
(b) cos θ =

(1)(4) + (2)(−5)

12 + 22 +

=

42 + (−5)2

(1)(8) + (2)(−5)

12 + 22 +

=

82 + (−5)2

−6

5 41
−2

5 89


2
4
...


2

c + 5 = 9,

5
...
Compute (u, v)
...
Let the inner product space of continuous functions on [0,1] defined as
1

( f , g) =

f (t)g(t) dt
...
K
...

0

Page 2 of 13

TMC1874 Mathematics For Computing

1

(b) ( f , g) =

0

(t)(e t ) dt = −

1
0

te t dt = (te t − e t )|1 = (e − e) − (0 − 1) = 1
...
Let V be the inner product space defined as
1

(p(t), q(t)) =

p(t)q(t) dt
...

(a) p(t) = 1, q(t) = 2t + 1
2

3

(b) p(t) = t , q(t) = 2t −

(c) p(t) = sin t, q(t) = cos t

4
3t

Solution
The cosine of the angle is given by
cos θ =

(u, v)

...


0
1

(p(t), p(t)) =

dt = 1
...

3

3
13

(b)
1

(p(t), q(t)) =

∴ cos θ =

W
...
Tiong

4
(t2 )(2t3 − t) dt = 0
...

p(t) q(t)

Page 3 of 13

TMC1874 Mathematics For Computing

(c)
1

(p(t), q(t)) =

(sin t)(cos t) dt =

0
1

(p(t), p(t)) =

0
1

(q(t), q(t)) =

∴ cos θ =

0

sin2 dt =
cos2 dt =

1
0
1

1
1
1
sin2 t = sin2 1
...

2 4

=

1 1
+ sin 2
...


8
...

0

Compute the distance between the given vectors
(b) t2 , t3

(a) sin t, cos t

Solution

(a)
1

d(sin t, cos t) = sin t − cos t

=

0
1

=

0

1/2

(sin t − cos t)2 dt

1/2,

(sin2 t − 2 sin t cos t + cos2 t) dt
1/2

1

=
=
=

0

,

(1 − 2 sin t cos t) dt

(t − sin2 t)

,

1 1/2
,
0

1 − sin2 1
...

105

9
...

W
...
Tiong

Page 4 of 13

TMC1874 Mathematics For Computing







(a) 






1

1
  − 2
2  
0 ,
0
 
1  
1
 

2

2

Solution



Let v1 = 








0 


, 1 




0 







1




0
2 
2 



0  , v2 = 
0  , v3 =  1 
...

2
2
2
1

Hence the given vectors are orthogonal
...


2
1

2

2
)(−

1
2

2

)(

) + (0)(0) + (

2

1
2

)(

1
2

1/2

)

= 1,

Therefore, the given vectors are orthonormal
...
Then

3

3

(v1 , v2 ) = (

W
...
Tiong

2

3

)(−

1
3

)+(

1
3

)(

2
3

) = 0
...
Next,
2

v1

=

(v1 , v1 ) = (

v2

=

(v2 , v2 ) = (−

3

)(

1
3

2
3
)(−

1

)+(
1
3

3

1

)(

)+(

3

2
3

)(

1/2

)

=

2
3

5
,
3

1/2

)

=

5

...


 
 

1
0
0 

(c)  −1  ,  1  ,  0 


0
1
1

Solution







1
0
0
Let v1 =  −1  , v2 =  1  , v3 =  0 
...


So the vectors are not orthogonal and thus they cannot be orthonormal
...




2
−1
10
...
For what values of a
3
4
are u and v orthogonal?


Solution
If u and v orthogonal, then (u, v) = 0
...


For the following questions, the Euclidean spaces Rn and
mathb f R n have the standard inner products on them
...
K
...

0

Page 6 of 13

TMC1874 Mathematics For Computing

2
1

,

2
1

11
...
Then

...



...

Solution

w1
w2

=

v1
=
v1

=

v2
=
v2

1
(2)(2) + (1)(1)

2
1

1
(−2)(−2) + (4)(4)

Hence the orthonormal basis is

2
5
1
5

,

=
−2
4

1

2
1

5

1

=

−1
5
2
5

5

=
−1
2

2
5
1
5

=

−1
5
2
5


...


12
...
Use the Gram-Schmidt process to obtain an orthonormal basis for W
...
K
...
Then

1]
...

−1

5 11]}
...


13
...
Find an orthonormal basis
for W
...
Then
(i) Let v1 = u1 = t
...
K
...


Page 8 of 13

TMC1874 Mathematics For Computing

Hence the orthogonal basis is t, 1 − 3 t
...


Therefore, the orthonormal basis is { 3t, 2 − 3t}
14
...



2
1
3
1
Solution 




2
1
Note that  2  = 2  1 
...
Thus we need to omit
2
1


2
 2  and let
2

 
 

0
1 
 1
S = { u1 , u2 , u3 } =  1  ,  0  ,  2 
...
Then we have




 

1
0
1
0
a1  1  + a2  0  + a3  2  =  0 
...

− − − −→
− R 3 + R 1 →R 1
0 0 1 0

1
 1
1


0
0
1

1
2
3

0
0
1

1
1
−2



0
1
R 2 ↔R 3
0 −− −  0
− −→
0
0

0
1
0

1
−2
1


0
0 
0

Since the rref of the matrix is I 3
...
Next, apply
Gram-Schmidt process to find the orthogonal basis
...
K
...

1



 
  1 




−3
0
1
1
0
(u2 , u1 )
 0  − (1)(0)+(1)(0)+(1)(1)  1  =  0  − 1  1  =  − 1 
...
Next, find the orthonormal
Hence, the orthogonal basis is {
2
1
2
0
basis


1


1
 13 
1 
v1
1  =  3 ,
=
w1 =


v1
3 1
1
3




− 1
−1
6

v2
1 
1 
−1  =  − 6  ,
w2 =
=


v2
6
2
2
6

 1  
− 22
−2
1  1  
v3
2 
...



0 

2
2
2
2

15
...
K
...

0

Page 10 of 13

TMC1874 Mathematics For Computing

Solution
First, we need to find a basis for the solution space of the homogeneous system
...


So every solution has the form



−3r
−3
x =  4r  = r  4 
...
To find orthonormal basis,
1


w1

=

u
=
u




−3

1 
4 =

26
1


3
26
4
26
4
26





...




3
16
...
Find a basis for W ⊥
...
Then (u, w) = 3a + b − 2c = 0 =⇒ a = − 1 b + 2 c
...

b
u=
c
0
1


W
...
Tiong

Page 11 of 13

TMC1874 Mathematics For Computing

Therefore, the set
 1   2 
 −3

3
S =  1 , 0 


0
1

spans W ⊥
...


17
...


Find a basis for W ⊥
...
Since the vector u must be orthogonal to each of the vectors w1 , w2 , w3 , w4 , w5 , we have a system of homogeneous linear
equations
(u, w1 ) = 2a 1 − a 2 + a 3 + 3a 4 = 0,
(u, w2 ) =

a 1 + 2a 2 + a 4 − 2a 5 = 0,

(u, w3 ) = 4a 1 + 3a 2 + a 3 + 5a 4 − 4a 5 = 0,
(u, w4 ) = 3a 1 + a 2 + 2a 3 − 1a 4 + a 5 = 0,

(u, w5 ) = 2a 1 − a 2 + 2a 3 − 2a 4 + 3a 5 = 0
...



2
1
4
3
2

1
0
1
2
2

3
1
5
−1
−2

0
−2
−4
1
3

0
0
0
0
0





−1
2
3
1
−1

1
0
0
0
0

2
−5
−5
−5
−5

0
1
1
2
2

1
1
1
−4
−4

−2
4
4
7
7

0
0
0
0
0

















W
...
Tiong







 R 1 ↔R 2 
− −→
−− − 





1
2
4
3
2


 − R 2 + R 3 →R 3 
 − 1 R 2 →R 2 


5
− − − −→
−− − − − 
 − R 4 + R 5 →R 5 
 − R 2 + R 4 →R 4 

2
−1
3
1
−1
1
0
0
0
0

0
1
1
2
2
2
1
0
0
0

1
3
5
−1
−2

−2
0
−4
1
3

0
0
0
0
0

0

1

−1
5
0
1
0

−1
5
0
−5
0

−2
−4
5
0
3
0



 −2 R 1 + R 2 → R 2

 −4 R 1 + R 3 → R 3
−−−−−
 −− − − −→
 −3 R 1 + R 4 → R 4
 −2 R 1 + R 5 → R 5

0
0
0
0
0





 R 3 ↔R 4
− −→
−− −



Page 12 of 13

TMC1874 Mathematics For Computing



1
0
0
0
0

2
1
0
0
0

0

1

−1
5
1
0
0

−1
5
−5
0
0



1
0
0
0
0

0
1
0
0
0

0
0
1
0
0















− 17
5
−6
5
−5
0
0

−2
−4
5
3
0
0
−8
5
−1
5
3
0
0

0
0
0
0
0
0
0
0
0
0







 1 R 3 + R 2 →R 2 
 5

− − − −→
−− − − − 





1
0
0
0
0

2
1
0
0
0

0
0
1
0
0

1
−6
5
−5
0
0

−2
−1
5
3
0
0

0
0
0
0
0







 −2 R 2 + R 1 → R 1
−−−−−
 −− − − −→










So the solution is
a5

=

a4

=

a3

s,
r,

= 5r − 3s,
6
1
=
r + s,
5
5
17
8
=
r + s
...

5
5
5
5
Since they are not multiples of each other, they are linearly independent and thus form
a basis for W ⊥
...
K
Title: TMC1874 Mathematics For Computing tutorial 5 solution
Description: Tutorial Solution Chapter 5: Inner Product Spaces