# Math 0250 Homework 2

• 0.4 Number 1
Note: Parts c, d, and e require you to separate combined equations into constituent equations with one equal sign each. There are several different correct ways to split them, so you may have correct answers that are different from the ones given.
a
The matrix form of the system is

The coefficient matrix is

and the augmented matrix is

b
The matrix form of the equation is

The coefficient matrix is

and the augmented matrix is

c
The system can be written

The matrix form of the equation is

The coefficient matrix is

and the augmented matrix is

d
The system can be written

The matrix form of the equation is

The coefficient matrix is

and the augmented matrix is

e
The system can be written

The matrix form is

• 0.5 Number 6
The matrix form of the system is

The augmented matrix of the system is

which row reduces to

so the solution is

• 0.5 Number 10
The matrix form of the equation is

which has augmented matrix

Row reduction gives

and the associated system is

Now solve for x1 and x2 in terms of x3:

Setting x3 = t gives the general solution

• 0.7 Number 1
a
b

c

d

e

f

g
• 0.7 Number 4
a
AC+BC gives the same answer by the distributive law.

b

(AB)C gives the same answer, by the associative law.

c

DA+DB gives the same answer by the distributive law.

d

e

f

g

h
C2 is undefined.

i
A+C is undefined.

k
The first two terms of 2AC+DB-4I have sizes and respectively. Since they are of different size, they can't be added.

j
• C1
Here's a transcript of an Octave session to produce the solution. I've put semicolons after most of the input to suppress output of intermediate results.
Octave, version 2.0.9 (i586-pc-linux-gnu).
Copyright (C) 1996, 1997 John W. Eaton.
This is free software with ABSOLUTELY NO WARRANTY.
For details, type warranty'.

octave:1> n = 5;
octave:2> H = hilb(n);
octave:3> B = [1;zeros(n-1,1)];
octave:4> C = rref([H,B]);
octave:5> S1 = C(1:n,n+1);
octave:6> S2 = H\B;
octave:7> [S1,S2]'
ans =

25.000   -300.000   1050.000  -1400.000    630.000
25.000   -300.000   1050.000  -1400.000    630.000

In the above calculation, C is the row reduced augmented matrix. Input line 5 extracts the last column from C and calls it S1. That's the solution obtained from Gaussian elimination (row reduction). Input line 6 calculates the solution by left division'', and labels the result as S2. The last line (the only one that prints its output), puts the two columns S1 and S2 side by side, transposes the result into two rows (that's what the prime does), and prints the two rows.

Notice that the two methods produced exactly the same solution.

• C2
Just repeat the performance from the preceding problem, changing n to 20:
octave:8> n = 20;
octave:9> H = hilb(n);
octave:10> B = [1;zeros(n-1,1)];
octave:11> C = rref([H,B]);
octave:12> S1 = C(1:n,n+1);
octave:13> S2 = H\B;
warning: matrix singular to machine precision, rcond = 2.46047e-19
octave:14> [S1,S2]
ans =

0.0000e+00    1.2170e+02
0.0000e+00   -7.3163e+03
0.0000e+00    1.4064e+05
0.0000e+00   -1.2519e+06
0.0000e+00    5.8963e+06
0.0000e+00   -1.5026e+07
0.0000e+00    1.8221e+07
0.0000e+00   -2.3673e+06
0.0000e+00   -1.3221e+07
0.0000e+00    1.7115e+04
0.0000e+00    1.0905e+07
0.0000e+00    6.2444e+06
0.0000e+00   -5.2245e+06
0.0000e+00   -9.9084e+06
0.0000e+00   -3.5317e+06
0.0000e+00    6.7210e+06
0.0000e+00    9.4337e+06
1.0000e+00   -4.1910e+05
0.0000e+00   -1.2279e+07
0.0000e+00    5.6575e+06

Notice that this time, the two solution methods gave very different results. If you use Matlab instead of Octave, or if you work on a machine that uses a different precision for floating point calculations, you may get different numbers, but you'll still get different answers. Obviously they can't both be right. This illustrates that you can't always believe the results of numerical calculations. The problem here is that the truncation errors have been compounded by repeated calculations until they accumulated to wildly inaccurate answers.
• C3
Here's an accurate solution to the system in the previous problem, displayed alongside the two solutions calculated previously.
octave:15> S3 = invhilb(n)*B;
octave:16> [S1,S2,S3]
ans =

0.0000e+00    1.2170e+02    4.0000e+02
0.0000e+00   -7.3163e+03   -7.9800e+04
0.0000e+00    1.4064e+05    5.2668e+06
0.0000e+00   -1.2519e+06   -1.7161e+08
0.0000e+00    5.8963e+06    3.2949e+09
0.0000e+00   -1.5026e+07   -4.1186e+10
0.0000e+00    1.8221e+07    3.5695e+11
0.0000e+00   -2.3673e+06   -2.2373e+12
0.0000e+00   -1.3221e+07    1.0441e+13
0.0000e+00    1.7115e+04   -3.7007e+13
0.0000e+00    1.0905e+07    1.0093e+14
0.0000e+00    6.2444e+06   -2.1332e+14
0.0000e+00   -5.2245e+06    3.5007e+14
0.0000e+00   -9.9084e+06   -4.4432e+14
0.0000e+00   -3.5317e+06    4.3162e+14
0.0000e+00    6.7210e+06   -3.1473e+14
0.0000e+00    9.4337e+06    1.6662e+14
1.0000e+00   -4.1910e+05   -6.0440e+13
0.0000e+00   -1.2279e+07    1.3431e+13
0.0000e+00    5.6575e+06   -1.3785e+12
`
As you can see, neither of the previous solutions is even close.

Frank Beatrous
1/21/1998