Exercise 3.3 Solutions

2.

A=(({{3, -2, 1, -1}, {0, 4, -1, 2}, {0, 0, 2, 3}, {0, 0, 0, 5}}))

B=(({{8}, {-3}, {11}, {15}}))

X=(({{(Subscript[x, 1])}, {(Subscript[x, 2])}, {(Subscript[x, 3])}, {(Subscript[x, 4])}}))

BackSubDetails[A, B, 4]

Det[A]

5.

A=(({{2, 0, 0, 0}, {-1, 4, 0, 0}, {3, -2, -1, 0}, {1, -2, 6, 3}}))

B=(({{6}, {5}, {4}, {2}}))

ForeSub[A, B, 3]

Det[A]

7.

(∑_(k = 1)^(N - 1))k

Mathematica Functions Used in this Notebook

$Post=If[MatrixQ[#],MatrixForm[#] ,#]&;

\(\(\(BackSubDetails[\ a0_, b0_, 
          n_\ ] := 
Module[\ {\ a = a0, b = b0, i, j, x, 
            X\ }, 
x\  = \ 
            Table["x"\_i, {i, 1, n}]; \ 
X\  = \ 
            Table["x"\_i, {i, 1, n}]; \ 
For[\ i = n, \ 
            1 ≤ i, \ \(i--\), 
Print[
              Flatten[Chop[
                      a\_\(\([[\)\(i\)\(]]\)\)] . X] == 
                b\_\(\([[\)\(i, 1\)\(]]\)\)]; 
If[i < n, 
              Print[Flatten[
                      Chop[a\_\(\([[\)\(i\)\(]]\)\)]] . Flatten[x] == 
                  b\_\(\([[\)\(i, 1\)\(]]\)\)]; 
Print[\(a\_\(\([[\)\(i, i\)\(]]\)\)\) 
                    x\_\(\([[\)\(i\)\(]]\)\) == \((b\_\(\([[\)\(i\)\(]]\)\) - ∑\+\(j = \ i + 1\)\%n\( a\_\(\([[\)\(i, j\)\(]]\)\)\) x\_\(\([[\)\(j\)\(]]\)\))\)\_\(\([[\)\(1\)\(]]\)\)];]; 
x\_\(\([[\)\(i\)\(]]\)\)\  = \ \(b\_\(\([[\)\(i\)\(]]\)\) - ∑\+\(j = \ i + 1\)\%n\( a\_\(\([[\)\(i, j\)\(]]\)\)\) x\_\(\([[\)\(j\)\(]]\)\)\)\/a\_\(\([[\)\(i, i\)\(]]\)\); \ 
Print["x"\_i, " = ", 
              x\_\(\([[\)\(i, 1\)\(]]\)\), "
"]]; \ 
Return[
            x];\ ];\)\(\ \)\)\)

ForeSub[ a0_, b0_, 
          n_ ] := 
Module[ { a = a0,  b = b0,  i, j , 
            x}, 
x  =  
            Table[0, {n}];  
For[ i = 1,  
            i ≤ 
              n,  i++, 
(Subscript[x, [[i]]])  =  (((Subscript[b, [[i]]]) - (∑_(j =  1)^(i - 1))(Subscript[a, [[i, j]]]) (Subscript[x, [[j]]]))/(Subscript[a, [[i, i]]])) ];  
Return[
            x]; ];