How do I use the same method to find the rank of a 5x5 or 4x4 matrix?
Please give an example.
Thanks
Just a hint. Maybe you can check the dimension of nullspace for your
matrix and make the obvious conclusions about the rank.
--Julian Stoev
Gerry
(With Mathematica)
I load one of my packages
<< haypacks`LinearAlgebra`RandomObjects`
Get a random 7 x 5 matrix of rank 3
mat = RandomMatrix[{7, 5}, 3]
{{0, 3, 0, -15, -4}, {0, 4, -7, -55, -7}, {0, 3, 0, -15, 1},
{0, 1, 0, -5, -1}, {0, 3, 1, -10, 9}, {0, -5, -8, -15, 3},
{0, -2, -4, -10, 1}}
The rank is equivalently defined as
1) the largest r for which mat has an r x r submatrix with non-zero
deteminant
(this is the definition that you are using)
2) the number of non-zero rows in the row-reduced form
3) the number of rows - the dimension of the null space ( = { v : mat.v
= 0})
There are many other equivalet definitions - that's one of the reasons that
rank is important.
Now we can find the rank of mat:
RowReduce[mat]
{{0, 1, 0, -5, 0}, {0, 0, 1, 5, 0}, {0, 0, 0, 0, 1}, {0, 0, 0, 0, 0},
{0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}}
By 2) the rank is 3.
NullSpace[mat] (*give a basis for the nullspace*)
{{0, 5, -5, 1, 0}, {1, 0, 0, 0, 0}}
By 3) the rank is 5 -2 = 3.
Using the definition 1) is usually ineffcient as you will need to evaluate a
large number of determinants.
Allan,
---------------------
Allan Hayes
Mathematica Training and Consulting
www.haystack.demon.co.uk
h...@haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565
It's a poor method. True, the rank is the size of the largest square submatrix
whose determinant is nonzero. Trouble is, there are a lot of these to check:
a 5 x 5 matrix has 100 3 x 3 submatrices. Seeing whether the determinant
is nonzero would be a good way to check whether the matrix is nonsingular
(i.e. has full rank), if you were dealing with exact arithmetic. However,
in doing floating-point calculations it's not so good: because of roundoff
error, the answer will hardly ever come out exactly to 0. A much better
way to find the rank in floating-point calculations is to use the Singular
Value Decomposition of the matrix. The rank is the number of singular values
greater than a certain tolerance.
Robert Israel isr...@math.ubc.ca
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2
> >I am able to find the rank of 3x3 matrices by finding the determinant
> >and checking if it equals 0 ;hence giving its rank or by finding the
> >determiniant of it's submatrix to see if it is of a lower rank. This
> >method is used in "Further Engineering Maths" by STROUD.
> >
> >How do I use the same method to find the rank of a 5x5 or 4x4 matrix?
> >Please give an example.
> >
> >Thanks
If you know how to do a Gauss-Jordan row reduction, the number of non-zero
rows in the result is the rank.
If the matrix entries are all integers (rationals) there are modifications
of the row-reduction technique that involve only integers (rationals) so
that the result is exact even for ill-conditioned matrices.