Condition number of empty matrix

1 view (last 30 days)
if is a 0 x 0 matrix, then cond( A ) returns 0. However, we know that the condition number is always >= 1. Also, one could argue that the empty matrix is an identity matrix, and hence its condition number should equal 1.
Any particular reason why matlab made this choice?
Robert van de Geijn
Robert van de Geijn on 22 Jun 2022
Let me now complicate matters even more with some more musings...
definition of norm of A
However, if anything, x being a 0 x 1 vector (a vector with no elements), its length (2-norm) must be 0, and hence it is the zero vector. Thus, the 2-norm of a 0 x 0 matrix cannot be defined...
If the 2-norm cannot be defined, then the condition number cannot be defined...

Sign in to comment.

Accepted Answer

Christine Tobler
Christine Tobler on 23 Jun 2022
The case of a 0-by-0 matrix doesn't have any very useful definition, as you note correctly in the comments above.
MATLAB does what it does because it computes any p-condition number using the formula:
norm(A, p) * norm(inv(A), p)
and of course the norm of [] is 0, as is the norm of the inverse of [].
A legitimate question could be if the norm of a [] matrix should be 0, or if it should be NaN since this matrix can't be mulitplied with a vector that has norm 1. But in practical terms, I think it's more useful to define this norm as being 0 than returning NaN.
Robert van de Geijn
Robert van de Geijn on 23 Jun 2022
As a purist, I consider a matrix to strictly be a convenient representation of a linear transformation. So, the first questions are
1) is R^0 (or C^0) a vector space?
2) Are there linear transformations that map R^0 to R^0?
3) How are these linear transformations represented as (0 x 0) matrices?
That establishes whether [] is even a matrix.
Let's say that the answers are
1) Yes, and its only element is the 0 x 1 vector, which then must be the zero vector, since the zero vector must be in the space.
2) Yes, only one: the linear transformation that maps the 0 x 1 to itself.
3) The matrix that represents it then is [] (the 0 x 0 matrix).
At this point we can start discussing the norm (let's stick to the 2-norm).
a) Since the 0 x 1 vector is the zero vector, its norm equals 0.
b) While the 2-norm for n > 0 is defined as max_x \neq 0 || A x ||, it is better to go back to thinking about linear transformations. The "size" (2-norm) of a linear transformation really measures by how much the linear transformation stretches the vector to which it is applied. One can argue that the linear transformation
a) maps the 0 x 1 vector to the zero vector and hence || A || = 0
b) maps the 0 x 1 vector to itself and hence A = I and || A || = 1
c) stetches the 0 x 1 vector by any nonnegative integer, since it is the zero vector.
The fact that all of these can be reasonably argued to me indicates that the condition number is ill-defined. Hence, I believe NaN or "not defined" are the only results in the running.
Now, it may be that since matlab is used as a tool for manipulating arrays in addition to matrices, it is convenient to define it differently. But then we should not really call it the condition number. It is merely the matlab operation that is denoted by cond().

Sign in to comment.

More Answers (0)


Find more on Multidimensional Arrays in Help Center and File Exchange




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!