HOME | POLITICS | SPORTS | LIFE | SCI/TECH | OPEDS | HELPFUL TIPS

Useless-Knowledge.com
Articles


Tensors: Calculating The Determinants Of Square Matrices

By Thomas Keyes
May 29, 2005

Contemplating a series of informal articles as an introduction to tensors, I have decided to prescind the topic of determinants, which is one of the thorniest parts of the whole subject arithmetically. Nowadays determinants can be calculated with ease on a computer or one of the better calculators, like TI-80, but formerly had to be worked out longhand or with earlier-generation calculators. But going through the whole procedure can be informative.

A matrix is a set of numbers arranged in rows and columns. The dimension of a matrix, such as 3 x 1, 3 x 2, 3 x 3, etc., is the number of rows by the number of columns. Matrices of the form 2 x 2, 3 x 3, 4 x 4, etc., are called square matrices. A tensor is a set of quantities, each quantity being either purely numerical, as 10.5123, or the product of a number and a unit of measure, as 10.5123 pounds, miles per hour, Newtons per square meter, etc. Tensors have rank: first, second, third, fourth, etc. A second-rank tensor, such as one for stress, strain or rotation, can be represented in the form of a square matrix, but not all matrices are tensors, so the terms are not synonymous. Here, however, the difference will matter little.

The tensors and matrices under consideration here will be 2 x 2, 3 x 3 and 4 x 4. This is because we are concerned primarily with 2-, 3- and 4-dimensional space. Tensors are widely used in engineering, flight mechanics, continuum mechanics, electronics, robotics, relativity and elsewhere. Stresses acting in a plane, as, for example, stresses in a gusset plate connecting the members of one of the trusses in a truss bridge, can be dealt with by means of 2 x 2 tensors, but stresses acting in all directions, as for example, on the massif of a mountain, require 3 x 3 tensors for their precise _expression. In four-dimensional space, as in relativity, 4 x 4 tensors must be used.

Square matrices are capable of being added, subtracted, multiplied and divided by one another. Dividing one matrix by another involves multiplying the dividend matrix by the inverse of the divisor matrix. Calculating the inverse of a matrix requires calculating the determinant of the matrix being inverted.

Calculating determinants of 2 x 2 matrices is very easy and the instructions below can be readily dispensed with, but for the purpose of preserving the formalism common to all the matrices under consideration, I'll go through it step by step.

Suppose we have a 2 x 2 matrix A. Most textbooks use italics for letters denoting matrices, but this is a refinement we can skip right now. The numbers in the matrix A are called elements, but we may use letters with suffixes to stand for the elements. Thus we have a11, a12, a21 and a22, used just like x, y and z in basic algebra, the numerical suffix, usually appearing as a subscript, identifying the row and column in which the element appears. Thus, a21 is in row 2, column 1, while a12 is in row 1, column 2, and so forth. Below the whole matrix is shown, first with the algebraic representations of the elements and next with actual numbers of a typical matrix. Ordinarily, the whole matrix, instead of individual rows, would appear in square brackets. Too, I have left a space between the rows, for e-mail purposes, but usually there are no spaces.

[a11, a12]

[a21, a22]

[1.5, 2.1]

[2.8, 4.2]

The next step is listing all permutations of the numbers up to the dimension of the matrix. Here we have two dimensions, so we have merely two permutations, 12 and 21. We suffix each permutation to the letter e, usually Greek epsilon, thereby producing e12 and e21, each of which we enclose in parentheses, leaving room for other symbols to be added. An inversion of such a permutation amounts to switching two adjacent digits. Thus the inversion of 21 is 12. For each of our two permutations, we calculate the number of inversions necessary to return the two digits to numerical order. With e12, no inversions are required, as the digits in 12 are already in numerical order. With e21, one inversion is required, that is, we put 21 in numerical order with one switch of adjacent digits, which changes it to 12. So we add the digits 0 and 1 in our parentheses, as can be seen below. If the digit is 0 or an even number we add a plus sign in the parentheses; if the digit is an odd number, we add a minus sign in the parentheses.

(e12, 0, +), (e21, 1, -)

For each of these two permutations, we must calculate a product of two of the elements of the matrix. The first digits in the suffixes of the elements to be multiplied will merely ascend from 1 up to the dimension of the matrix, in this case 2. So we start with the format (a1_ x a2_) for either permutation. In the blank spaces, we fill in the digits of the permutation, that is, 1 and 2 for e12, but 2 and 1 for e21. Thus we get (a11 x a22) and (a12 x a21), to each of which we prefix the plus or minus sign accompanying the permutation in the above parentheses, and which are then added. Therefore, the algebraic representaion of the determinant of matrix A, which we may call det A, takes the form of the first equation below, while the numerical form of our specimen matrix takes the second.

det A = + (a11 x a22) - (a12 x a21)

det A = + (1.5 x 4.2) - (2.1 x 2.8) = + 6.30 - 5.88 = 0.42

Let us call our 3 x 3 matrix B, shown below in its algebraic representation and with numerical values from a specimen matrix:

[b11, b12, b13]

[b21, b22, b23]

[b31, b32, b33]

[1.5, 2.1, 3.6]

[2.8, 4.2, 1.7]

[2.5, 3.1, 2.3]

In this case, we start with numbers 1, 2 and 3, producing six permutations, 123, 132, 213, 231, 312 and 321. Permutation e123 is already in numerical order, so we add a 0 in the parentheses, but e132 and e213 each require one inversion, 3 and 2 in the first case, and 2 and 1 in the second, so we add 1 in the parentheses. It takes 2 inversions apiece to numericalize 231 and 312. In the first case, we may invert 3 and 1, then 2 and 1, to return to 123. In the second case, we may invert 3 and 1, then 3 and 2, to return to 123. So we add 2 in each set of parentheses. With e321, we may invert, first 3 and 2, then 3 and 1, then 2 and 1, so we put 3 in the parentheses. This done, we can enter our plus and minus signs. If we perform the inversions in any other order, we always get the same answer, unless we disinvert something already inverted.

(e123, 0, +), (e132, 1, -), (e213, 1, -), (e231, 2, +), (e312, 2, +), (e321, 3, -)

Then we set up the format (b1_ x b2_ x b3_), producing six triple products by entering the digits from each of the six permutations, in order, in the above format. To the algebraically denoted products thus obtained, we prefix plus or minus signs from the parentheses, arranging the six products in the form of a sum. Once we have the algebraic configuration, we can substitute numerical values from our specimen matrix to get an equation for det B.

det B = + (b11 x b22 x b33) - (b11 x b23 x b32) - (b12 x b21 x b33) + (b12 x b23 x b31) + (b13 x b21 x b32) - (b13 x b22 x b31)

det B = + (1.5 x 4.2 x 2.3) - (1.5 x 1.7 x 3.1) - (2.1 x 2.8 x 2.3) + (2.1 x 1.7 x 2.5) + (3.6 x 2.8 x 3.1) - (3.6 x 4.2 x 2.5) = + 14.490 - 7.905 - 13.524 + 8.925 + 31.248 - 37.800 = - 4.566

Similarly, we set up our 4 x 4 matrix, first algebraically, then entering specimen numbers.

[c11, c12, c13, c14]

[c21, c22, c23, c24]

[c31, c32, c33, c34]

[c41, c42, c43, c44]

[1.5, 2.1, 3.6, 4.1]

[2.8, 4.2, 1.7, 1.2]

[2.5, 3.1, 2.3, 3.3]

[1.9, 3.5, 2.4, 2.2]

With 4 digits, we have 24 permutations, which are shown below, in parentheses, along with the number of inversions required to numericalize them and the polarity (plus or minus) thus determined. Counting inversions has no other function than to find the polarity.

(e1234, 0, +), (e1243, 1, -), (e1324, 1, -), (e1342, 2, +), (e1423, 2, +), (e1432, 3, -), (e2134, 1, -), (e2143, 2, +), (e2314, 2, +), (e2341, 3, -), (e2413, 3, -), (e2431, 4, +), (e3124, 2, +), (e3142, 3, -), (e3214, 3, -), (e3241, 4, +), (e3412, 4, +), (e3421, 5, -), (e4123, 3, -), (e4132, 4, +), (e4213, 4, +), (e4231, 5, -), (e4312, 5, -), (e4321, 6, +)

Setting up the format, (c1_ x c2_ x c3_ x c4_), we fill in the digits from each of the permutations to form 24 fourfold products, which are added according to the plus and minus signs, as before:

det C = + (c11 x c22 x c33 x c44) - (c11 x c22 x c34 x c43) - (c11 x c23 x c32 x c44) + (c11 x c23 x c34 x c42) + (c11 x c24 x c32 x c43) - (c11 x c24 x c33 x c42) - (c12 x c21 x c33 x c44) + (c12 x c21 x c34 x c43) + (c12 x c23 x c31 x c44) - (c12 x c23 x c34 x c41) - (c12 x c24 x c31 x c43) + (c12 x c24 x c33 x c41) + (c13 x c21 x c32 x c44) - (c13 x c21 x c34 x c42) - (c13 x c22 x c31 x c44) + (c13 x c22 x c34 x c41) + (c13 x c24 x c31 x c42) - (c13 x c24 x c32 x c41) - (c14 x c21 x c32 x c43) + (c14 x c21 x c33 x c42) + (c14 x c22 x c31 x c43) - (c14 x c22 x c33 x c41) - (c14 x c23 x c31 x c42) + (c14 x c23 x c32 x c41)

det C = + (1.5 x 4.2 x 2.3 x 2.2) - (1.5 x 4.2 x 3.3 x 2.4) - (1.5 x 1.7 x 3.1 x 2.2) + (1.5 x 1.7 x 3.3 x 3.5) + (1.5 x 1.2 x 3.1 x 2.4) - (1.5 x 1.2 x 2.3 x 3.5) - (2.1 x 2.8 x 2.3 x 2.2) + (2.1 x 2.8 x 3.3 x 2.4) + (2.1 x 1.7 x 2.5 x 2.2) - (2.1 x 1.7 x 3.3 x 1.9) - (2.1 x 1.2 x 2.5 x 2.4) + (2.1 x 1.2 x 2.3 x 1.9) + (3.6 x 2.8 x 3.1 x 2.2) - (3.6 x 2.8 x 3.3 x 3.5) - (3.6 x 4.2 x 2.5 x 2.2) + (3.6 x 4.2 x 3.3 x 1.9) + (3.6 x 1.2 x 2.5 x 3.5) - (3.6 x 1.2 x 3.1 x 1.9) - (4.1 x 2.8 x 3.1 x 2.4) + (4.1 x 2.8 x 2.3 x 3.5) + (4.1 x 4.2 x 2.5 x 2.4) - (4.1 x 4.2 x 2.3 x 1.9) - (4.1 x 1.7 x 2.5 x 3.5) + (4.1 x 1.7 x 3.1 x 1.9)

det C = + 31.8780 - 49.8960 - 17.3910 + 29.4525 + 13.3920 - 14.4900 - 29.7528 + 46.5696 + 19.6350 - 22.3839 - 15.1200 + 11.0124 + 68.7456 - 116.4240 - 83.1600 + 94.8024 + 37.8000 - 25.4448 - 85.4112 + 92.4140 + 103.3200 - 75.2514 - 60.9875 + 41.0533 = - 5.6378

Matrices do not stop at 4 x 4. In electrical network analysis and elsewhere, it is easy to find 8 x 8 and other jumbo matrices. The determinant of an 8 x 8 matrix, calculated in the foregoing way, would involve adding up 40,320 products of 8 multiplicands apiece. 'Sparse' matrices are ones with lots of zeroes for elements, so they are somewhat easier. Determinants can be calculated instantaneously at the following web page: http://wims.unice.fr/wims/wims.cgi?session=WQE6AFC5EE.2&+lang=es&+module=tool%2Flinear%2Fmatrix.en

At that web page, we would enter our abovesaid 4 x 4 matrix C in the following way, without spaces between rows:

1.5,2.1,3.6,4.1

2.8,4.2,1.7,1.2

2.5,3.1,2.3,3.3

1.9,3.5,2.4,2.2]

------------

About the author Thomas Keyes: I have written two books: A SOJOURN IN ASIA (non-fiction) and A TALE OF UNG (fiction), neither published so far.

I have studied languages for years and traveled extensively on five continents.

Email: udikeyes@yahoo.com


Tell a friend about this site!

------------

All articles are EXCLUSIVE to Useless-Knowledge.com and are not allowed to be posted on other websites. ARTICLE THIEVES WILL BE PROSECUTED!

Useless-Knowledge.com © Copyright 2002-2005. All rights reserved.