Matematik och Datavetenskap, Chalmers Tekniska Högskola och Göteborgs Universitet

ALA-B, 2003, studio 6.2

Home, w 1, w 2, w 3, w 4, w 5, w 6, w 7. Matlab: analysis, linear algebra.

Linear algebra in Rn, part 1.

In these exercises you should do all computations first by hand and then with Matlab/Octave.

1. Addition and multiplication by a scalar, Ch 42.3. Form the following column vectors in R4: a=[1; 2; 3; 4], b=[4; 3; 2; 1], c=2*a-3*b

2. Scalar product, Ch 42.4-5. Compute the scalar products (a,b), (b,a) and the norms of the vectors a,b,c. Hint: the scalar product (a,b) is easily computed as b'*a. Compute these first by by hand and then with matlab. Compute the angle between a and b.

3. Matrix algebra. Form the matrix A=[a b c]. Compute the type of A and A' (in matlab: size(A)). Compute A*A', A'*A, b*A, b'*A, A*b. (Note: some of these are not defined.) Compute A(:,2) and A(1,:).

4. Subspace of linear combinations, Ch 42.6. Compute

2*a - 4*b + c,
Ax with x=[2;-4;1] and A as above,
A*x with x=[1;0;0], x=[0;1;0], x=[0;0;1].

Note that the first one is equal to the second one. Prove that Ax is a linear combination of a,b,c, namely, Ax=x_1a+x_2b+x_3c.

Define V=S(a,b,c)=the space of linear combinations of a,b,c, as in Ch 42.6. Show that if u,v belong to V and x is a number, then u+v belongs to V and xu belongs to V. This means that V is a subspace of R4.

Does v=[1; 1; 1; 1] belong to V?

Hint: solve Ax=v. By hand: Gauss elimination. In matlab: the staircase (echelon) matrix is computed by the function rref(A). To solve Ax=v, add the column v to A, B=[A v], and do rref(B).

Answer: x=[.2;.2;0]+t*[-2;3;1], so that v=(.2-2*t)*a + (.2+3*t)*b + t*c, where t is an arbitrary number.

Does v=[1; 1; 1; 0] belong to V? Answer: no, Ax=v has no solution.

5. Linear independence, ch 42.8-9. Check if the vectors a,b,c are linearly independent: solve the equation x_1a+x_2b+x_3c=0, which can be written Ax=0. Use the Gauss elimination method by hand. In matlab the staircase (echelon) matrix is computed by the function rref(A).

6. Basis, ch 42.9. It turns out that we can eliminate one of the vectors, e.g., c and the remaining vectors a,b are linearly independent and they span the whole subspace V. This means that they are a basis for V. What is the dimension of V?

Express c uniquely as a linear combination of the basis vectors a,b. Hint: solve Bx=c by Gauss elimination, where the matrix B=[a b].

Express v=[1; 1; 1; 1] uniquely as a linear combination of the basis vectors a,b.

/stig


Last modified: Mon Dec 1 15:43:15 MET 2003