An algebra problem by Rocco Dalto

Algebra Level 4

Let f : A 2 X 2 R 4 f: \mathbb A_{2 X 2} \rightarrow \mathbb R^4 be linear transform defined by:

f ( x 1 x 2 x 3 x 4 ) = ( x 1 x 2 + 2 x 3 + 4 x 4 2 x 1 x 2 + 4 x 3 + 3 x 4 4 x 1 3 x 2 + 2 x 3 + x 4 5 x 1 x 2 + 2 x 3 + 2 x 4 ) f( \begin{vmatrix}{x_{1}} && {x_{2}} \\ {x_{3}} && {x_{4}}\end{vmatrix}) = \left( \begin{array}{cccc} x_{1} - x_{2} + 2 * x_{3} + 4 * x_{4} \\ 2 * x_{1} - x_{2} + 4 * x_{3} + 3 * x_{4} \\ 4 * x_{1} - 3 * x_{2} + 2 * x_{3} + x_{4} \\ 5 * x_{1} - x_{2} + 2 * x_{3} + 2 * x_{4} \\ \end{array} \right)

Let A = { 1 2 3 4 , 2 1 5 3 , 4 2 1 7 , 7 6 4 3 } A = \{ \begin{vmatrix}{1} && {2} \\ {3} && {4}\end{vmatrix}, \begin{vmatrix}{-2} && {1} \\ {5} && {3}\end{vmatrix}, \begin{vmatrix}{4} && {-2} \\ {1} && {7}\end{vmatrix}, \begin{vmatrix}{7} && {6} \\ {4} && {3}\end{vmatrix} \} be a basis for A 2 X 2 \mathbb A_{2 X 2}

and,

B = { ( 2 1 4 3 ) , ( 5 2 1 4 ) , ( 1 1 1 2 ) , ( 2 0 1 1 ) } B = \{ \left( \begin{array}{cccc} 2 \\ -1 \\ 4 \\ 3 \\ \end{array} \right), \left( \begin{array}{cccc} 5 \\ 2 \\ 1 \\ 4 \\ \end{array} \right), \left( \begin{array}{cccc} 1 \\ -1 \\ 1 \\ 2 \\ \end{array} \right), \left( \begin{array}{cccc} 2 \\ 0 \\ 1 \\ -1 \\ \end{array} \right) \} be a basis for R 4 \mathbb R^4

If M = [ a i j ] 4 x 4 M = [a_{ij}]_{4 \: x \: 4} represents the linear transform above find S = i = 1 4 j = 1 4 a i j . \displaystyle S = \sum_{i = 1}^{4} \sum_{j = 1}^{4} a_{i j}.

Express the result to four decimal places.

If your interested you can write a program(in any language) for the General Case below and use it to find the above result.

General Case:(For program)

For this case I wrote the matrix in an unconventional manner.

Let f : A n X n R n 2 f: \mathbb A_{n X n} \rightarrow \mathbb R^{n^2} be linear transform defined by:

f ( x 1 x 2 . . . x n x n + 1 x n + 2 . . . x 2 n . . . . . . . . . x ( j 1 ) n + 1 x ( j 1 ) n + 2 . . . x j n . . . . . . . . . x ( n 1 ) n + 1 x ( n 1 ) n + 2 . . . x n 2 ) = ( C 11 x 1 + C 12 x 2 + . . . + C 1 n 2 x n 2 C 21 x 1 + C 22 x 2 + . . . + C 2 n 2 x n 2 . . . C j 1 x 1 + C j 2 x 2 + . . . + C j n 2 x n 2 . . . C n 2 1 x 1 + C n 2 2 x 2 + . . . + C n 2 n 2 x n 2 ) f( \begin{vmatrix}{x_{1}} && {x_{2}} && {...} && {x_{n}} \\ {x_{n + 1}} && {x_{n + 2}} && {...} && {x_{2 * n}} \\ {...} && {...} && {...} \\ {x_{(j - 1) * n + 1}} && {x_{(j - 1) * n + 2}} && {...} && {x_{j * n}} \\ {...} && {...} && {...} \\ {x_{(n - 1) * n + 1}} && {x_{(n - 1) * n + 2}} && {...} && {x_{n^2}} \\ \end{vmatrix}) = \left( \begin{array}{cccc} C_{11} * x_{1} + C_{12} * x_{2} + ... + C_{1 * n^2} * x_{n^2} \\ C_{21} * x_{1} + C_{22} * x_{2} + ... + C_{2 * n^2} * x_{n^2} \\ ... \\ C_{j1} * x_{1} + C_{j2} * x_{2} + ... + C_{j * n^2} * x_{n^2} \\ ... \\ C_{n^21} * x_{1} + C_{n^22} * x_{2} + ... + C_{n^2n^2} * x_{n^2} \\ \end{array} \right)

Let V q = x 1 q x 2 q . . . x n q x ( n + 1 ) q x ( n + 2 ) q . . . x ( 2 n ) q . . . . . . . . . x ( ( j 1 ) n + 1 ) q x ( ( j 1 ) n + 2 ) q . . . x ( j n ) q . . . . . . . . . x ( ( n 1 ) n + 1 ) q x ( ( n 1 ) n + 2 ) q . . . x ( n 2 ) q V_{q} = \begin{vmatrix}{x_{1q}} && {x_{2q}} && {...} && {x_{nq}} \\ {x_{(n + 1)q}} && {x_{(n + 2)q}} && {...} && {x_{(2 * n)q}} \\ {...} && {...} && {...} \\ {x_{((j - 1) * n + 1)q}} && {x_{((j - 1) * n + 2)q}} && {...} && {x_{(j * n)q}} \\ {...} && {...} && {...} \\ {x_{((n - 1) * n + 1)q}} && {x_{((n - 1) * n + 2)q}} && {...} && {x_{(n^2)q}} \\ \end{vmatrix}

and A = { V q ( 1 < = q < = n 2 ) } A = \{V_{q}|(1 <= q <= n^2)\} be a basis for A n X n \mathbb A_{n X n} .

Let W q = ( a 1 q a 2 q . . . a j q . . . a ( n 2 ) q ) W_{q} = \left( \begin{array}{cccccc} a_{1q} \\ a_{2q} \\ ... \\ a_{jq} \\ ... \\ a_{(n^2)q} \\ \end{array} \right)

and B = { W q ( 1 < = q < = n 2 ) } B = \{W_{q}|(1 <= q <= n^2)\} be a basis for R n 2 \mathbb R^{n^2} .

Write a program in any language to find the matrix M = [ a i j ] n 2 x n 2 M = [a_{ij}]_{n^2 \: x \:n^2} representation of the general linear transform above and the sum S = i = 1 n 2 j = 1 n 2 a i j \displaystyle S = \sum_{i = 1}^{n^2} \sum_{j = 1}^{n^2} a_{i j} .

Make certain A A and B B are bases for A n X n \mathbb A_{n X n} and R n 2 \mathbb R^{n^2} .

You can use the program written to find the matrix M = [ a i j ] 4 x 4 M = [a_{ij}]_{4 \: x \: 4} that represents the linear transform above and output S = i = 1 4 j = 1 4 a i j \displaystyle S = \sum_{i = 1}^{4} \sum_{j = 1}^{4} a_{i j} .

Let X = 3 2 5 7 X = \begin{vmatrix}{3} && {-2} \\ {5} && {7}\end{vmatrix}

To check the matrix M = [ a i j ] 4 x 4 M = [a_{ij}]_{4 \: x \: 4} found, first find [ f ( X ) ] B [f(X)]_B without using the matrix M = [ a i j ] 4 x 4 M = [a_{ij}]_{4 \: x \: 4} , then find [ f ( X ) ] B [f(X)]_B using the matrix M = [ a i j ] 4 x 4 M = [a_{ij}]_{4 \: x \: 4} .


The answer is -44.0678.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Rocco Dalto
Apr 25, 2017

After doing the problem I supply the program I wrote for the general case which generated the output for this specific problem.

Since f : A 2 X 2 R 4 f: \mathbb A_{2 X 2} \rightarrow \mathbb R^{4} is a linear transform, for each integer j ( 1 < = j < = 4 ) j \ni (1 <= j <= 4)

f ( x 1 j x 2 j x 3 j x 4 j ) = α 1 j ( 2 1 4 3 ) + α 2 j ( 5 2 1 4 ) + α 3 j ( 1 1 1 2 ) + α 4 j ( 2 0 1 1 ) = f( \begin{vmatrix}{x_{1j}} && {x_{2j}} \\ {x_{3j}} && {x_{4j}}\end{vmatrix}) = \alpha_{1j} * \left( \begin{array}{cccc} 2 \\ -1 \\ 4 \\ 3 \\ \end{array} \right) + \alpha_{2j} * \left( \begin{array}{cccc} 5 \\ 2 \\ 1 \\ 4 \\ \end{array} \right) + \alpha_{3j} * \left( \begin{array}{cccc} 1 \\ -1 \\ 1 \\ 2 \\ \end{array} \right) + \alpha_{4j} * \left( \begin{array}{cccc} 2 \\ 0 \\ 1 \\ -1 \\ \end{array} \right) = [ 2 5 1 2 1 2 1 0 4 1 1 1 3 4 2 1 ] α 1 j α 2 j α 3 j α 4 j \begin{bmatrix}{2} && {5} && {1} && {2} \\ {-1} && {2} && {-1} && {0} \\ {4} && {1} && {1} && {1} \\ {3} && {4} && {2} && {-1}\end{bmatrix} * \begin{vmatrix}{\alpha_{1j}} \\{\alpha_{2j}} \\ {\alpha_{3j}} \\ {\alpha_{4j}}\end{vmatrix}

where,

f ( 1 2 3 4 ) = ( 21 24 8 17 ) f( \begin{vmatrix}{1} && {2} \\ {3} && {4}\end{vmatrix}) = \left( \begin{array}{cccc} 21 \\ 24 \\ 8 \\ 17 \\ \end{array} \right)

f ( 2 1 5 3 ) = ( 19 24 2 5 ) f( \begin{vmatrix}{-2} && {1} \\ {5} && {3}\end{vmatrix}) = \left( \begin{array}{cccc} 19 \\ 24 \\ 2 \\ 5 \\ \end{array} \right)

f ( 4 2 1 7 ) = ( 36 35 31 38 ) f( \begin{vmatrix}{4} && {-2} \\ {1} && {7}\end{vmatrix}) = \left( \begin{array}{cccc} 36 \\ 35 \\ 31 \\ 38 \\ \end{array} \right)

f ( 7 6 4 3 ) = ( 21 33 21 43 ) f( \begin{vmatrix}{7} && {6} \\ {4} && {3}\end{vmatrix}) = \left( \begin{array}{cccc} 21 \\ 33 \\ 21 \\ 43 \\ \end{array} \right)

Using the above we can set up the augmented matrix below to solve for the

four 4 X 4 systems of equations.

[ 2.0000 5.0000 1.0000 2.0000 21.0000 19.0000 36.0000 21.0000 1.0000 2.0000 1.0000 0.0000 24.0000 24.0000 35.0000 33.0000 4.0000 1.0000 1.0000 1.0000 8.0000 2.0000 31.0000 21.0000 3.0000 4.0000 2.0000 1.0000 17.0000 5.0000 38.0000 43.0000 ] \left[ \begin{array}{cccc|cccc} 2.0000 & 5.0000 & 1.0000 & 2.0000 & 21.0000 & 19.0000 & 36.0000 & 21.0000\\ -1.0000 & 2.0000 & -1.0000 & 0.0000 & 24.0000 & 24.0000 & 35.0000 & 33.0000\\ 4.0000 & 1.0000 & 1.0000 & 1.0000 & 8.0000 & 2.0000 & 31.0000 & 21.0000\\ 3.0000 & 4.0000 & 2.0000 & -1.0000 & 17.0000 & 5.0000 & 38.0000 & 43.0000\\ \ \end{array} \right]

0.5000 R o w 1 0.5000 * Row_{1} \rightarrow

[ 1.0000 2.5000 0.5000 1.0000 10.5000 9.5000 18.0000 10.5000 1.0000 2.0000 1.0000 0.0000 24.0000 24.0000 35.0000 33.0000 4.0000 1.0000 1.0000 1.0000 8.0000 2.0000 31.0000 21.0000 3.0000 4.0000 2.0000 1.0000 17.0000 5.0000 38.0000 43.0000 ] \left[ \begin{array}{cccc|cccc} 1.0000 & 2.5000 & 0.5000 & 1.0000 & 10.5000 & 9.5000 & 18.0000 & 10.5000 \\ -1.0000 & 2.0000 & -1.0000 & 0.0000 & 24.0000 & 24.0000 & 35.0000 & 33.0000\\ 4.0000 & 1.0000 & 1.0000 & 1.0000 & 8.0000 & 2.0000 & 31.0000 & 21.0000\\ 3.0000 & 4.0000 & 2.0000 & -1.0000 & 17.0000 & 5.0000 & 38.0000 & 43.0000\\ \ \end{array} \right]

1.0000 R O W 1 + R O W 2 1.0000 * ROW_{1} + ROW_{2}

4.0000 R O W 1 + R O W 3 -4.0000 * ROW_{1} + ROW_{3}

3.0000 R O W 1 + R O W 4 -3.0000 * ROW_{1} + ROW_{4} \rightarrow

[ 1.0000 2.5000 0.5000 1.0000 10.5000 9.5000 18.0000 10.5000 0.0000 4.5000 0.5000 1.0000 34.5000 33.5000 53.0000 43.5000 0.0000 9.0000 1.0000 3.0000 34.0000 36.0000 41.0000 21.0000 0.0000 3.5000 0.5000 4.0000 14.5000 23.5000 16.0000 11.5000 ] \left[ \begin{array}{cccc|cccc} 1.0000 & 2.5000 & 0.5000 & 1.0000 & 10.5000 & 9.5000 & 18.0000 & 10.5000 \\ 0.0000 & 4.5000 & -0.5000 & 1.0000 & 34.5000 & 33.5000 & 53.0000 & 43.5000 \\ 0.0000 & -9.0000 & -1.0000 & -3.0000 & -34.0000 & -36.0000 & -41.0000 & -21.0000 \\ 0.0000 & -3.5000 & 0.5000 & -4.0000 & -14.5000 & -23.5000 & -16.0000 & 11.5000 \\ \ \end{array} \right]

0.2222 R o w 2 0.2222 * Row_{2} \rightarrow

[ 1.0000 2.5000 0.5000 1.0000 10.5000 9.5000 18.0000 10.5000 0.0000 1.0000 0.1111 0.2222 7.6667 7.4444 11.7778 9.6667 0.0000 9.0000 1.0000 3.0000 34.0000 36.0000 41.0000 21.0000 0.0000 3.5000 0.5000 4.0000 14.5000 23.5000 16.0000 11.5000 ] \left[ \begin{array}{cccc|cccc} 1.0000 & 2.5000 & 0.5000 & 1.0000 & 10.5000 & 9.5000 & 18.0000 & 10.5000\\ 0.0000 & 1.0000 & -0.1111 & 0.2222 & 7.6667 & 7.4444 & 11.7778 & 9.6667\\ 0.0000 & -9.0000 & -1.0000 & -3.0000 & -34.0000 & -36.0000 & -41.0000 & -21.0000\\ 0.0000 & -3.5000 & 0.5000 & -4.0000 & -14.5000 & -23.5000 & -16.0000 & 11.5000 \\ \ \end{array} \right]

2.5000 R O W 2 + R O W 1 -2.5000 * ROW_{2} + ROW_{1}

9.0000 R O W 2 + R O W 3 9.0000 * ROW_{2} + ROW_{3}

3.5000 R O W 2 + R O W 4 3.5000 * ROW_{2} + ROW_{4} \rightarrow

[ 1.0000 0.0000 0.7778 0.4444 8.6667 9.1111 11.4444 13.6667 0.0000 1.0000 0.1111 0.2222 7.6667 7.4444 11.7778 9.6667 0.0000 0.0000 2.0000 1.0000 35.0000 31.0000 65.0000 66.0000 0.0000 0.0000 0.1111 3.2222 12.3333 2.5556 25.2222 45.3333 ] \left[ \begin{array}{cccc|cccc} 1.0000 & 0.0000 & 0.7778 & 0.4444 & -8.6667 & -9.1111 & -11.4444 & -13.6667\\ 0.0000 & 1.0000 & -0.1111 & 0.2222 & 7.6667 & 7.4444 & 11.7778 & 9.6667\\ 0.0000 & 0.0000 & -2.0000 & -1.0000 & 35.0000 & 31.0000 & 65.0000 & 66.0000\\ 0.0000 & 0.0000 & 0.1111 & -3.2222 & 12.3333 & 2.5556 & 25.2222 & 45.3333\\ \ \end{array} \right]

0.5000 R o w 3 -0.5000 * Row3 \rightarrow

[ 1.0000 0.0000 0.7778 0.4444 8.6667 9.1111 11.4444 13.6667 0.0000 1.0000 0.1111 0.2222 7.6667 7.4444 11.7778 9.6667 0.0000 0.0000 1.0000 0.5000 17.5000 15.5000 32.5000 33.0000 0.0000 0.0000 0.1111 3.2222 12.3333 2.5556 25.2222 45.3333 ] \left[ \begin{array}{cccc|cccc} 1.0000 & 0.0000 & 0.7778 & 0.4444 & -8.6667 & -9.1111 & -11.4444 & -13.6667\\ 0.0000 & 1.0000 & -0.1111 & 0.2222 & 7.6667 & 7.4444 & 11.7778 & 9.6667\\ 0.0000 & 0.0000 & 1.0000 & 0.5000 & -17.5000 & -15.5000 & -32.5000 & -33.0000\\ 0.0000 & 0.0000 & 0.1111 & -3.2222 & 12.3333 & 2.5556 & 25.2222 & 45.3333\\ \ \end{array} \right]

0.7778 R O W 3 + R O W 1 -0.7778 * ROW_{3} + ROW_{1}

0.1111 R O W 3 + R O W 2 0.1111 * ROW_{3} + ROW_{2}

0.1111 R O W 3 + R O W 4 -0.1111 * ROW_{3} + ROW_{4} \rightarrow

[ 1.0000 0.0000 0.0000 0.0556 4.9444 2.9444 13.8333 12.0000 0.0000 1.0000 0.0000 0.2778 75.7222 5.7222 8.1667 6.0000 0.0000 0.0000 1.0000 0.5000 17.5000 15.5000 32.5000 33.0000 0.0000 0.0000 0.0000 3.2778 14.2778 4.2778 28.8333 49.0000 ] \left[ \begin{array}{cccc|cccc} 1.0000 & 0.0000 & 0.0000 & 0.0556 & 4.9444 & 2.9444 & 13.8333 & 12.0000\\ 0.0000 & 1.0000 & 0.0000 & 0.2778 & 7 5.7222 & 5.7222 & 8.1667 & 6.0000\\ 0.0000 & 0.0000 & 1.0000 & 0.5000 & -17.5000 & -15.5000 & -32.5000 & -33.0000\\ 0.0000 & 0.0000 & 0.0000 & -3.2778 & 14.2778 & 4.2778 & 28.8333 & 49.0000\\ \ \end{array} \right]

0.3051 R o w 4 -0.3051 * Row_{4} \rightarrow

[ 1.0000 0.0000 0.0000 0.0556 4.9444 2.9444 13.8333 12.0000 0.0000 1.0000 0.0000 0.2778 5.7222 5.7222 8.1667 6.0000 0.0000 0.0000 1.0000 0.5000 17.5000 15.5000 32.5000 33.0000 0.0000 0.0000 0.0000 1.0000 4.3559 1.3051 8.7966 14.9492 ] \left[ \begin{array}{cccc|cccc} 1.0000 & 0.0000 & 0.0000 & 0.0556 & 4.9444 & 2.9444 & 13.8333 & 12.0000\\ 0.0000 & 1.0000 & 0.0000 & 0.2778 & 5.7222 & 5.7222 & 8.1667 & 6.0000\\ 0.0000 & 0.0000 & 1.0000 & 0.5000 & -17.5000 & -15.5000 & -32.5000 & -33.0000\\ 0.0000 & 0.0000 & 0.0000 & 1.0000 & -4.3559 & -1.3051 & -8.7966 & -14.9492\\ \ \end{array} \right]

0.0556 R O W 4 + R O W 1 -0.0556 * ROW_{4} + ROW_{1}

0.2778 R O W 4 + R O W 2 -0.2778 * ROW_{4} + ROW_{2}

0.5000 R O W 4 + R O W 3 -0.5000 * ROW_{4} + ROW_{3} \rightarrow

[ 1.0000 0.0000 0.0000 0.0000 5.1864 3.0169 14.3220 12.8305 0.0000 1.0000 0.0000 0.0000 6.9322 6.0847 10.6102 10.1525 0.0000 0.0000 1.0000 0.0000 15.3220 14.8475 28.1017 25.5254 0.0000 0.0000 0.0000 1.0000 4.3559 1.3051 8.7966 14.9492 ] \left[ \begin{array}{cccc|cccc} 1.0000 & 0.0000 & 0.0000 & 0.0000 & 5.1864 & 3.0169 & 14.3220 & 12.8305\\ 0.0000 & 1.0000 & 0.0000 & 0.0000 & 6.9322 & 6.0847 & 10.6102 & 10.1525\\ 0.0000 & 0.0000 & 1.0000 & 0.0000 & -15.3220 & -14.8475 & -28.1017 & -25.5254\\ 0.0000 & 0.0000 & 0.0000 & 1.0000 & -4.3559 & -1.3051 & -8.7966 & -14.9492\\ \ \end{array} \right]

The desired matrix is:

M = [ 5.1864 3.0169 14.3220 12.8305 6.9322 6.0847 10.6102 10.1525 15.3220 14.8475 28.1017 25.5254 4.3559 1.3051 8.7966 14.9492 ] M = \begin{bmatrix}{5.1864} && {3.0169} && {14.3220} && {12.8305} \\ {6.9322} && {6.0847} && {10.6102} && {10.1525} \\ {-15.3220} && {-14.8475} && {-28.1017} && {-25.5254} \\ {-4.3559} && {-1.3051} && {-8.7966} && {-14.9492} \end{bmatrix}

and S = i = 1 4 j = 1 4 a i j = 44.0678 S = \sum_{i = 1}^{4} \sum_{j = 1}^{4} a_{i j} = \boxed{-44.0678} .

Check [ f ( X ) ] B : [f(X)]_{B}:

Without using matrix M : M:

Let X = 3 2 5 7 X = \begin{vmatrix}{3} && {-2} \\ {5} && {7}\end{vmatrix}

\implies

f ( 3 2 5 7 ) = ( 43 49 35 41 ) = α 1 ( 2 1 4 3 ) + α 2 ( 5 2 1 4 ) + α 3 ( 1 1 1 2 ) + α 4 ( 2 0 1 1 ) = f( \begin{vmatrix}{3} && {-2} \\ {5} && {7}\end{vmatrix}) = \left( \begin{array}{cccc} 43 \\ 49 \\ 35 \\ 41 \\ \end{array} \right) = \alpha_{1} * \left( \begin{array}{cccc} 2 \\ -1 \\ 4 \\ 3 \\ \end{array} \right) + \alpha_{2} * \left( \begin{array}{cccc} 5 \\ 2 \\ 1 \\ 4 \\ \end{array} \right) + \alpha_{3} * \left( \begin{array}{cccc} 1 \\ -1 \\ 1 \\ 2 \\ \end{array} \right) + \alpha_{4} * \left( \begin{array}{cccc} 2 \\ 0 \\ 1 \\ -1 \\ \end{array} \right) = [ 2 5 1 2 1 2 1 0 4 1 1 1 3 4 2 1 ] \begin{bmatrix}{2} && {5} && {1} && {2} \\ {-1} && {2} && {-1} && {0} \\ {4} && {1} && {1} && {1} \\ {3} && {4} && {2} && {-1}\end{bmatrix} * α 1 α 2 α 3 α 4 \begin{vmatrix}{\alpha_{1}} \\{\alpha_{2}} \\ {\alpha_{3}} \\ {\alpha_{4}}\end{vmatrix}

Using the above we can set up the augmented matrix:

[ 2.0000 5.0000 1.0000 2.0000 43.0000 1.0000 2.0000 1.0000 0.0000 49.0000 4.0000 1.0000 1.0000 1.0000 35.0000 3.0000 4.0000 2.0000 1.0000 41.0000 ] \left[ \begin{array}{cccc|c} 2.0000 & 5.0000 & 1.0000 & 2.0000 & 43.0000\\ -1.0000 & 2.0000 & -1.0000 & 0.0000 & 49.0000\\ 4.0000 & 1.0000 & 1.0000 & 1.0000 & 35.0000\\ 3.0000 & 4.0000 & 2.0000 & -1.0000 & 41.0000\\ \ \end{array} \right]

Using row operations on the above augmented matrix we obtain:

[ 1.0000 0.0000 0.0000 0.0000 17.9492 0.0000 1.0000 0.0000 0.0000 13.7458 0.0000 0.0000 1.0000 0.0000 39.4576 0.0000 0.0000 0.0000 1.0000 11.0847 ] \left[ \begin{array}{cccc|c} 1.0000 & 0.0000 & 0.0000 & 0.0000 & 17.9492\\ 0.0000 & 1.0000 & 0.0000 & 0.0000 & 13.7458\\ 0.0000 & 0.0000 & 1.0000 & 0.0000 & -39.4576\\ 0.0000 & 0.0000 & 0.0000 & 1.0000 & -11.0847\\ \ \end{array} \right]

\implies

[ f ( X ) ] B = ( 17.9492 13.7458 39.4576 11.0847 ) [f(X)]_{B} = \left( \begin{array}{ccccc} 17.9492\\ 13.7458\\ -39.4576\\ -11.0847\\ \end{array} \right)

Using matrix M M :

Using the set of matrices A A and X = 3 2 5 7 X = \begin{vmatrix}{3} && {-2} \\ {5} && {7}\end{vmatrix} we set up the system:

[ 1.0000 2.0000 4.0000 7.0000 3.0000 2.0000 1.0000 2.0000 6.0000 2.0000 3.0000 5.0000 1.0000 4.0000 5.0000 4.0000 3.0000 7.0000 3.0000 7.0000 ] \left[ \begin{array}{cccc|c} 1.0000 & -2.0000 & 4.0000 & 7.0000 & 3.0000\\ 2.0000 & 1.0000 & -2.0000 & 6.0000 & -2.0000\\ 3.0000 & 5.0000 & 1.0000 & 4.0000 & 5.0000\\ 4.0000 & 3.0000 & 7.0000 & 3.0000 & 7.0000\\ \end{array} \right]

Solving the system we obtain:

[ X ] A = [ 1.8274 1.5112 1.2130 0.4283 ] [X]_A = \left[ \begin{array}{ccccc} -1.8274\\ 1.5112\\ 1.2130\\ 0.4283\\ \end{array} \right]

\implies

[ f ( p ) ] B = M [ X ] A = [ 5.1864 3.0169 14.3220 12.8305 6.9322 6.0847 10.6102 10.1525 15.3220 14.8475 28.1017 25.5254 4.3559 1.3051 8.7966 14.9492 ] [ 1.8274 1.5112 1.2130 0.4283 ] = ( 17.9492 13.7458 39.4576 11.0847 ) [f(p)]_B = M * [X]_A = \begin{bmatrix}{5.1864} && {3.0169} && {14.3220} && {12.8305} \\ {6.9322} && {6.0847} && {10.6102} && {10.1525} \\ {-15.3220} && {-14.8475} && {-28.1017} && {-25.5254} \\ {-4.3559} && {-1.3051} && {-8.7966} && {-14.9492} \end{bmatrix} * \left[ \begin{array}{ccccc} -1.8274\\ 1.5112\\ 1.2130\\ 0.4283\\ \end{array} \right] = \left( \begin{array}{ccccc} 17.9492\\ 13.7458\\ -39.4576\\ -11.0847\\ \end{array} \right)

I wrote the program in Free Pascal.

program matrixrepresentaionoflineartransform_4;

{$R-}

{restricted to f:Rm --> Anxn}

uses crt;

                                {self contained for brillant}

const maxnum = 100;

type matrix = array[1 .. maxnum,1 .. maxnum] of real;

var

coeff,a,b,c,d,sol,prod,e:matrix;

n,l,p,v:integer;

mywork3:text;

deta,detb,product:real;

f:matrix;{for me only-check}

function intpower(base,exponent:integer):longint;

var product,k:longint;

begin{intpower}

product:= 1;

 for k:= 1 to exponent do

      product:= product * base;



 INTpower:= product;

end;{intpower}

procedure Getsize;

begin

writeln('Enter size of matrix');

readln(n);

end;

procedure getcoefficients;

var j,k,p:integer;

begin

for j:= 1 to intpower(n,2) do

begin

write('Enter coefficients of row',j,' :');

for k:= 1 to intpower(n,2) do

begin

read(coeff[j,k]);

end;

end;

end;

procedure Getmatrices;

var j,k,q,p:integer;

sum:real;

myfile:text;

begin

assign(myfile,'holdmatrix3.txt');

rewrite(myfile);

writeln('To Enter ', intpower(n,2), ' basis vectors for A',n,'X',n,' : ');

for q:= 1 to intpower(n,2) do

begin

write('Enter matrix ', q, ' on one line: ');

for k:= 1 to intpower(n,2) do

begin

read(b[k,q]);

end;

end;

for q:= 1 to intpower(n,2) do

begin

for j:= 1 to intpower(n,2) do

begin

sum:= 0;

for k:= 1 to intpower(n,2) do

begin

sum:= sum + coeff[j,k] * b[k,q];

end;

write(myfile,sum);

end;

end;

writeln('Enter basis vectors in R',intpower(n,2),':');

for j:= 1 to intpower(n,2) do

begin

write('Enter enter vector',j,': ');

for k:= 1 to intpower(n,2) do

begin

read(a[k,j]);

end;

writeln;

end;

reset(myfile);

for j:= 1 to intpower(n,2) do

begin

for k:= 1 to intpower(n,2) do

begin

read(myfile,a[k,intpower(n,2) + j]);

end;

end;

writeln;

writeln(' Solve the ',intpower(n,2),' X ',intpower(n,2),' system using the augmented matrix below:');

writeln;

for j:= 1 to intpower(n,2) do

begin

for k:= 1 to 2 * intpower(n,2) do

begin

write(a[j,k]:0:4,' ');

end;

writeln;

end;

close(myfile);

for j:= 1 to intpower(n,2) do

begin

for k:= 1 to 2 * intpower(n,2) do

begin

write(mywork3,a[j,k]:0:4,' ');

end;

writeln(mywork3);

end;

end;

{For check bases} {begin}

procedure hold(var c:matrix; e:matrix; m:integer);

var k,j:integer;

begin

for k:= 1 to m do

begin

for j:= 1 to m do

begin

c[k,j]:= e[k,j];

end;

end;

end;

{Determinants-To check Bases} procedure switch2(var c:matrix; l,p,n:integer);

var q:integer;

z:real;

begin{switch}

for q:= 1 to n do

begin{m}

   z:= c[l,q];

   c[l,q]:= c[p,q];

   c[p,q]:= z;

end;{m}

end;{switch}

procedure safeguard2(var c:matrix; l:integer; var p:integer; n:integer; var v:integer; var product:real);

var q:integer;

begin{safeguard}

v:=0;

if (c[l,l] = 0) then

begin{then}

v:= 1;

q:= l;

while ((q + 1) <= n) and (v = 1) do

begin{loop}

if c[q + 1,l] <> 0 then

begin{then}

        p:= q + 1;

        switch2(c,l,p,n);

        v:= 0;

        PRODUCT:= -1 * PRODUCT;

end;{then}

q:= q + 1;

end;{loop}

end;{then}

end;{safeguard}

procedure operation11(var a:matrix; l,n:integer; var product:real);

var k,q:integer;

x:real;

s:matrix;

begin{operation1}

for q:= 1 to n do

begin{q}

s[l,q]:= a[l,q]/a[l,l];

end;{q}

PRODUCT:= PRODUCT * (1/A[L,L]);

for q:= 1 to n do

begin{q}

a[l,q]:= s[l,q];

end;{q}

    end;{operation1}

procedure operation21(var a:matrix; l,n:integer);

var k,r,q:integer;

x:real;

s:matrix;

begin{op2}

for q:= 1 to n do

begin{q}

if q <> l then

begin{then}

x:= -1 * a[q,l];

for r:= 1 to n do

begin{r}

s[q,r]:= x * a[l,r] + a[q,r];

end;{r}

for r:= 1 to n do

begin{r}

a[q,r]:= s[q,r];

end;{r}

end;{then}

end;{q}

end;{op2}

FUNCTION DETERMINANT(a:matrix; n:integer; PRODUCT:real):real;

var j:integer;

DET,DIAGONAL:real;

begin{DETERMINANT}

DIAGONAL:= 1;

FOR j:= 1 TO N DO

BEGIN{LOOP}

DIAGONAL:= DIAGONAL * (a[j,j]);

END;{LOOP}

IF DIAGONAL = 1 THEN

DET:= 1/PRODUCT

ELSE

DET:= 0;

DETERMINANT:= DET;

END;{DETERMINANT}

{end-check bases}

procedure switch(var c:matrix; l,p:integer);

var q:integer;

z:real;

begin{switch}

for q:= 1 to 2 * intpower(n,2) do

begin{m}

   z:= c[l,q];

   c[l,q]:= c[p,q];

   c[p,q]:= z;

end;{m}

end;{switch}

procedure safeguard(var c:matrix; l:integer; var p:integer; var v:integer);

var q:integer;

begin{safeguard}

v:=0;

if (c[l,l] = 0) then

begin{then}

v:= 1;

q:= l;

while ((q + 1) <= 2 * intpower(n,2)) and (v = 1) do

begin{loop}

if c[q + 1,l] <> 0 then

begin{then}

        p:= q + 1;

        switch(c,l,p);

        v:= 0;

end;{then}

q:= q + 1;

end;{loop}

end;{then}

end;{safeguard}

procedure operation1(var a:matrix; l:integer);

var q,k:integer;

s:matrix;

x:real;

                   {s is each transformed matrix}

begin{op1}

for q:= 1 to 2 * intpower(n,2) do

begin{m}

s[l,q]:= a[l,q]/a[l,l];

end;{m}

x:= 1/(a[l,l]);

for q:= 1 to 2 * intpower(n,2) do

begin{m}

a[l,q]:= s[l,q];

end;{m}

writeln(mywork3, x:0:4,' * Row',l);

writeln(mywork3);

for q:= 1 to intpower(n,2) do

begin

for k:= 1 to 2 * intpower(n,2) do

begin

write(mywork3, a[q,k]:0:4,' ');

end;

writeln(mywork3);

end;

writeln(mywork3);

end;{op1}

procedure operation2(var a:matrix; l:integer);

var q,r,k:integer;

x:real;

s:matrix;

begin{op2}

for q:= 1 to intpower(n,2) do

begin{q}

if q <> l then

begin{then}

x:= a[q,l];

for r:= 1 to 2 * intpower(n,2) do

begin{m}

s[q,r]:= -1 * x * a[l,r] + a[q,r];

end;{m}

for r:= 1 to 2 * intpower(n,2) do

begin{m}

a[q,r]:= s[q,r];

end;{m}

writeln(mywork3, -1 * x:0:4,' * ROW ', l,' + ROW',q);

end;{then}

end;{q}

writeln(mywork3);

for q:= 1 to intpower(n,2) do

begin

for k:= 1 to 2 * intpower(n,2) do

begin

write(mywork3, a[q,k]:0:4,' ');

end;

writeln(mywork3);

end;

writeln(mywork3);

end;{op2}

PROCEDURE SHOWDATA;

VAR J,k:INTEGER;

sum:extended;

myfile2:text;

BEGIN

assign(myfile2,'holdsolution3.txt');

rewrite(myfile2);

writeln;

writeln('Matrix Representation of linear transformation f: A',n,' X ',n,' ---> R',intpower(n,2),' : ');

writeln('------------------------------------------------------------------------------------------------------------');

writeln;

for j:= 1 to intpower(n,2) do

begin

for k:= intpower(n,2) + 1 to 2 * intpower(n,2) do

begin

write(myfile2,a[j,k],' ');

end;

writeln(myfile2);

end;

reset(myfile2);

for j:= 1 to intpower(n,2) do

begin

for k:= 1 to intpower(n,2) do

begin

read(myfile2,sol[j,k]);

end;

end;

close(myfile2);

for j:= 1 to intpower(n,2) do

begin

for k:= 1 to intpower(n,2) do

begin

write(sol[j,k]:0:4,' ');

end;

writeln;

end;

{For brillant only}

sum:= 0;

for j:= 1 to intpower(n,2) do

begin

for k:= 1 to intpower(n,2) do

begin

sum:= sum + sol[j,k];

end;

end;

writeln;

writeln('Sum of elements of matrix = ',sum:0:4);

END;

{Last check [f(x)]B } {just for me-begin}

procedure switch3(var c:matrix; l,p,n:integer);

var r:integer;

z:real;

begin{switch3}

for r:= 1 to n + 1 do

begin{m}

   z:= c[l,r];

   c[l,r]:= c[p,r];

   c[p,r]:= z;

end;{m}

end;{switch3}

procedure safeguard3(var c:matrix; l:integer; var p:integer; n:integer; var v:integer);

var r:integer;

begin{safeguard3}

v:=0;

if (c[l,l] = 0) then

begin{then}

v:= 1;

r:= l;

while ((r + 1) <= n) and (v = 1) do

begin{loop}

if c[r + 1,l] <> 0 then

begin{then}

        p:= r + 1;

        switch3(c,l,p,n);

        v:= 0;

end;{then}

r:= r + 1;

end;{loop}

end;{then}

end;{safeguard3}

procedure operation13(var a:matrix; l,n:integer);

var r,k:integer;

s:matrix;

x:real;

                  {s is each transformed matrix}

begin{op13}

for r:= 1 to n + 1 do

begin{r}

s[l,r]:= a[l,r]/a[l,l];

end;{r}

x:= 1/(a[l,l]);

for r:= 1 to n + 1 do

begin{m}

a[l,r]:= s[l,r];

end;{r}

end;{op13}

procedure operation23(var a:matrix; l,n:integer);

var q,r:integer;

x:real;

s:matrix;

begin{op23}

for q:= 1 to n do

begin{q}

if q <> l then

begin{then}

x:= a[q,l];

for r:= 1 to n + 1 do

begin{r}

s[q,r]:= -1 * x * a[l,r] + a[q,r];

end;{r}

for r:= 1 to n + 1 do

begin{r}

a[q,r]:= s[q,r];

end;{r}

end;{then}

end;{q}

end;{op23}

procedure solution(y:matrix; n:integer);

var q:integer;

begin{solution}

for q:= 1 to n do

begin{q}

writeln(mywork3,y[q,n + 1]:0:4,'   ');

end;{q}

writeln(mywork3);

end;{solution}

procedure matrixmult(a,b:matrix; var summat:matrix);

var j,k,s:integer;

   sum:real;

begin{matrixmult}

for j:= 1 to intpower(n,2) do

begin{j}

for k:= 1 to 1 do

begin{k}

     sum:= 0;

for s:= 1 to intpower(n,2) do

begin{s}

     sum:= sum + a[j,s] * b[s,k];

end;{s}

      summat[j,k]:= sum;

              end;{k}

writeln(mywork3,sum:0:4);

end;{j}

writeln(mywork3);

end;{matrixmult}

\()

procedure check; t ype arraytype = array[1 .. maxnum] of real;

var p,j,k:integer;

x:arraytype;

sum:real;

u:matrix;

myfile:text;

begin

assign(myfile,'holdmatrix4.txt');

rewrite(myfile);

{without using matrix}

writeln(mywork3, ' Check [f(p)]B');

writeln(' -------------');

writeln(mywork3);

writeln('Enter a ', n,' X ',n,' matrix on one line');

for j:= 1 to intpower(n,2) do

begin

read(x[j]);

end;

for j:= 1 to intpower(n,2) do

begin

sum:= 0;

for k:= 1 to intpower(n,2) do

begin

sum:= sum + coeff[j,k] * x[k];

end;

write(myfile,sum);

end;

reset(myfile);

for k:= 1 to intpower(n,2) do

begin

read(myfile,f[k,intpower(n,2) + 1]);

end;

close(myfile);

for j:= 1 to intpower(n,2) do

begin

for k:= 1 to intpower(n,2) + 1 do

begin

write(mywork3,f[j,k]:0:4,' ');

end;

writeln(mywork3);

end;

{Next Use operations on matrix f}

writeln(mywork3);

writeln(mywork3, 'Check [f(p)]B');

writeln(mywork3);

for l:= 1 to intpower(n,2) do

begin{l}

safeguard3(f,l,p,intpower(n,2),v);

if v = 0 then

begin{then}

operation13(f,l,intpower(n,2));

operation23(f,l,intpower(n,2));

end;{then}

end;{l}

writeln(mywork3);

solution(f,intpower(n,2));

{Now do using matrix M}

writeln(mywork3);

writeln(mywork3);

{To do}

for j:= 1 to intpower(n,2) do

begin

e[j,intpower(n,2) + 1]:= x[j];

end;

for j:= 1 to intpower(n,2) do

begin

for k:= 1 to intpower(n,2) + 1 do

begin

write(mywork3,e[j,k]:0:4,' ');

end;

writeln(mywork3);

end;

for l:= 1 to intpower(n,2) do

begin{l}

safeguard3(e,l,p,intpower(n,2),v);

if v = 0 then

begin{then}

operation13(e,l,intpower(n,2));

operation23(e,l,intpower(n,2));

end;{then}

end;{l}

writeln(mywork3);

solution(e,intpower(n,2));

writeln(mywork3);

writeln(mywork3);

for j:= 1 to intpower(n,2) do

begin

u[j,1]:= e[j,intpower(n,2) + 1];

end;

writeln(mywork3);

writeln(mywork3);

matrixmult(sol,u,prod);

end;

\(\)

begin

assign(mywork3,'mywork3.txt');

rewrite(mywork3);

getsize;

getcoefficients;

getmatrices;

hold(f,a,intpower(n,2)); {for me only-check [f(X)]}

hold(e,b,intpower(n,2));

{do determinants here}

{To do determinants to check bases here, then done.} {checking basis for A(2x2)}

PRODUCT:= 1;

for l:= 1 to intpower(n,2) do

begin{l}

safeguard2(b,l,p,intpower(n,2),v,PRODUCT);

if v = 0 then

begin{then}

operation11(b,l,intpower(n,2),PRODUCT);

operation21(b,l,intpower(n,2));

end;{then}

end;{l}

DETB:= DETERMINANT(b,intpower(n,2),PRODUCT);

writeln;

while detb = 0 do

begin

writeln('Set of matrices is not a basis for A ',n,' X ',n);

writeln;

getmatrices;

PRODUCT:= 1;

for l:= 1 to intpower(n,2) do

begin{l}

safeguard2(b,l,p,intpower(n,2),v,PRODUCT);

if v = 0 then

begin{then}

operation11(b,l,intpower(n,2),PRODUCT);

operation21(b,l,intpower(n,2));

end;{then}

end;{l}

DETB:= DETERMINANT(b,intpower(n,2),PRODUCT);

end;

{checking basis for Rn^2}

hold(c,a,intpower(n,2));

PRODUCT:= 1;

for l:= 1 to intpower(n,2) do

begin{l}

safeguard2(c,l,p,intpower(n,2),v,PRODUCT);

if v = 0 then

begin{then}

operation11(c,l,intpower(n,2),PRODUCT);

operation21(c,l,intpower(n,2));

end;{then}

end;{l}

DETA:= DETERMINANT(c,intpower(n,2),PRODUCT);

writeln;

while deta = 0 do

begin

writeln('Set of vectors is not a basis for R',intpower(n,2));

writeln;

getmatrices;

hold(c,a,intpower(n,2));

PRODUCT:= 1;

for l:= 1 to intpower(n,2) do

begin{l}

safeguard2(c,l,p,intpower(n,2),v,PRODUCT);

if v = 0 then

begin{then}

operation11(c,l,intpower(n,2),PRODUCT);

operation21(c,l,intpower(n,2));

end;{then}

end;{l}

DETA:= DETERMINANT(c,intpower(n,2),PRODUCT);

end;

{Only getting through if deta <> 0 and detb <> 0}

for l:= 1 to intpower(n,2) do

begin{l}

safeguard(a,l,p,v);

if v = 0 then

begin{then}

operation1(a,l);

operation2(a,l);

end;{then}

end;{l}

showdata;

check;

close(mywork3);

readln;

readln;

end.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...