You are on page 1of 4

Answers - Maths for Machine Learning 1

1. If f (x; y; z) = 4x2 +y 2 +5z 2 …nd the point on the plane 2x+3y+4z = 12 at


which f (x; y; z) has its least value. Hint: use the method of Lagrange
multipliers
We wish to …nd the minimum of f (x; y; z) = 4x2 + y 2 + 5z 2 subject to the
constraint g (x; y; z) = 2x + 3y + 4z 12 = 0:
Consider

rf (x; y; z) = rg (x; y; z)
r 4x2 + y 2 + 5z 2 = r (2x + 3y + 4z 12)

then
8xi + 2yj+10zk = (2i + 3j+4k) :
i.e.
8x = 2 ; 2y = 3 ; 10z = 4 :
Solving these three equations for gives
2 5
= 4x = y = z:
3 2
These conditions imply
8
y = 6x and z = x:
5
Substituting in 2x + 3y + 4z 12 = 0 we obtain
32
2x + 18x + x 12 = 0;
5
or
5 30 8
x= ; y= ; z= :
11 11 11
It follows that the minimum occurs at that point.
2. V is the vector space of all real functions f (x) de…ned on 0 x 1:
Which of the following sets are subspaces of V ?
2.i. all f (x) such that f (0) = 0: U1 non-empty * x 2 U1 : U1 subspace if
closed under addition and scalar multiplication
a. f (x) ; g (x) 2 U1 ) f (0) = g (0) = 0
h (x) = f (x) + g (x)
h (0) = f (0) + g (0) = 0 + 0 = 0
) h (x) 2 U1

1
b. f (x) 2 U1 f (0) = 0
f (x)jx=0 = f (0) = 0
) f (x) 2 U1

So U1 closed under addition and scalar multiplication. Hence U1 is a subspace

2.ii. all f (x) such that f (x) = f (1 x) :

U2 = f f (x)j f (x) = f (1 x)g

U2 non-empty *
2
1
f (x) = x 2 U2
2
U2 closed under addition and scalar multiplication
So U2 is also a subspace

2.iii. all f (x) such that f (0) > 0:

U3 = f f (x)j f (0) > 0g

U3 non-empty (f (x) = ex 2 U3 ).
U3 closed under addition but not closed under scalar multiplication:

f (x) 2 U3 ) f (x) > 0


f (x) 2
= U3 when <0

*
f (x) < 0
) U3 NOT a subspace

3. Consider the vector space V = R2 over F = R: De…ne

U = f(x; y) = x; y 2 [0; 1)g

as the subset consisting of vectors whose components are 0; i.e. the


…rst quadrant, all co-ordinates (x; y) 0: Is U a subspace of V ?
Now suppose W = f( a; b) ja; b 2 [0; 1)g V; i.e. the third quadrant.
De…ne a new subset of V such that S = U + W V: Is S a subspace of
V?
Solution: Consider the vector space V = R2 over F = R: Then de…ne
U = f(x; y) = x; y 2 [0; 1)g is the subset consisting of vectors whose
components are 0; i.e. the …rst quadrant, all co-ordinates (x; y) 0:
Now 0 2 U and U is closed under vector addition (x + y) 2 U: What
about closure under scalar multiplication? Suppose u = (1; 1) 2 U and
c = 1 2 R; then cu = ( 1; 1) 2 = U ) scalar multiplication fails. Hence
U is not a subspace of R2 :

2
Now suppose W = f( a; b) = a; b 2 [0; 1)g V; i.e. the third
quadrant. De…ne a new subset of V such that S = U + W V: We see
that for any vector w in S; kw 2 S where k 2 R; so closure under scalar
multiplication. However now addition fails because (2; 1) + ( 1; 3) =
(1; 2) which is in neither quadrant.
So the smallest subspace containing the 1st quadrant is the whole space
R2 :
4. Test the vectors

u1 = (1; 1; 2; 2) ; u2 = (0; 4; 1; 3) ; u3 = (2; 6; 3; 1)

for linear independence.


2 3 2 3 2 3 2 3
1 0 2 0
617 6 47 6 67 607
c1 6 7 6
4 2 5 + c2 4
7 + c3 6 7=6 7
15 4 3 5 405
2 3 1 0
2 3
c1 + 0c2 + 2c3 =0 1 0 2 0
c1 + 4c2 + 6c3 =0 6
6 1 4 6 0 7
7
2c2 c2 + 3c3 =0 4 2 1 3 0 5
2c1 + 3c2 c3 =0 2 3 1 0
2 R2 !R2 R1 32 R3 !R3 +R4 3
1 0 2 0 1 0 2 0
6 0 4 4 0 76 0 4 4 0 7
6 76 7
4 2 1 3 0 4
5 0 2 2 0 5
2 3 1 0 2 3 1 0
1
R3 !R3 2 R2 R2 ! 41 R2
2 32 3
1 0 2 0 1 0 2 0
6 0 4 4 0 76 0 1 1 0 7
6 76 7
4 0 0 0 0 54 0 0 0 0 5
2 3 1 0 2 3 1 0
2 R4 !R4 +2R1 32 R4 $R3 32 R3 !R3 3R2 3
1 0 2 0 1 0 2 0 1 0 2 0
6 0 1 1 0 76 0 1 1 0 76 0 1 1 0 7
6 76 76 7
4 0 0 0 0 4
5 0 3 3 0 4
5 0 0 0 0 5
0 3 3 0 0 0 0 0 0 0 0 0
c1 + 2c3 =0
) c1 = 2c3 ; c2 = c3
c2 + c3 =0
c3 is a free variable, let c3 = 1; then c1 = 2; c2 = 1: c1 ; c2 ; c3 are not
all zero. ) u1 ; u2 ; u3 are not linearly independent

3
5. Verify the Cayley-Hamilton Theorem for the matrix
0 1
1 1 1
A=@ 0 1 1 A
0 0 1
3
The characteristic polynomial is cA ( ) = ( 1) : Applying the Cayley-
Hamilton Theorem, we have that
3
0 = (A I3 )

so the matrix satis…es its characteristic polynomial.


6. Consider the mapping f : R3 ! R2 given by

f (x; y; z) = (2y + z; 3x + 5y + z) :

Show that f is a linear mapping.


Obtain the associated matrix A with respect to the standard basis:

f (1; 0; 0) = (0; 3)
f (0; 1; 0) = (2; 5)
f (0; 0; 1) = (1; 1)
0 2 1
A[f ] =
3 5 1

7. A mapping is de…ned by g : R2 ! R

g (x; y) = (x + 2y + 2) :

Is g a linear mapping? No. 0 is not preserved.

g (0; 0) = 2:

You might also like