bugGNU Octave - Bugs: bug #52533, Explanation of the rank function

 
 

bug #52533: Explanation of the rank function

Submitter:  Lasse Kliemann <lassekliemann>
Submitted:  Mon 27 Nov 2017 05:21:05 PM UTC
   
 
Category:  Documentation Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Documentation
Status:  Fixed Assigned to:  siko1056
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 29 Nov 2017 11:35:57 AM UTC, comment #3: 

Pushed: https://hg.savannah.gnu.org/hgweb/octave/rev/f38165f34ff1

Thank you for the documentation improvement.

Kai Torben Ohlhus <siko1056>
Group Member
Wed 29 Nov 2017 10:41:55 AM UTC, comment #2: 

Yes, just one little thing:

"The function `orth' may be used to compute an orthonormal basis of that space." --> "The function `orth' may be used to compute an orthonormal basis of the column space." Since although the dimensions are the same, row and column spaces can still be considered as different.

Thanks!

Lasse Kliemann <lassekliemann>
Wed 29 Nov 2017 10:16:42 AM UTC, comment #1: 

Do you agree with the following docstring?  Then I can push this one straight-forward.  The changes will be part of the next major release, that might be 4.4.0, and are contributed to you,
Lasse Kliemann <lasse@lassekliemann.de>.


 -- rank (A)
 -- rank (A, TOL)
     Compute the rank of matrix A, using the singular value
     decomposition.

     The rank is taken to be the number of singular values of A that are
     greater than the specified tolerance TOL.  If the second argument
     is omitted, it is taken to be

          tol = max (size (A)) * sigma(1) * eps;

     where `eps' is machine precision and `sigma(1)' is the largest
     singular value of A.

     The rank of a matrix is the number of linearly independent rows or
     columns and equals the dimension of the row and column space.  The
     function `orth' may be used to compute an orthonormal basis of
     that space.

     For testing if a system `A*X = B' of linear equations is solvable,
     one can use

          rank (A) == rank ([A B])

     In this case, `X = A \ B' finds a particular solution X.  The
     general solution is X plus the null space of matrix A.  The
     function `null' may be used to compute a basis of the null space.

     Example:

          A = [1 2 3
               4 5 6
               7 8 9];
          rank (A)
            => 2

     In this example, the number of linearly independent rows is only 2
     because the final row is a linear combination of the first two
     rows.

          A(3,:) == -A(1,:) + 2 * A(2,:)

     See also: null, orth, sprank, svd, eps.


(file #42520)

Kai Torben Ohlhus <siko1056>
Group Member
Mon 27 Nov 2017 05:21:05 PM UTC, original submission:  

https://www.gnu.org/software/octave/doc/interpreter/Basic-Matrix-Functions.html#Basic-Matrix-Functions

Regarding rank, it says: "The rank of a matrix is the number of linearly independent rows or columns and determines how many particular solutions exist to a system of equations. Use null for finding the remaining homogenous solutions."

I find that the statement "how many particular solutions exist to a system of equations" makes no sense. Talking about solutions only makes sense when we have a right-hand side b also given in addition to a coefficient matrix A. It can be said that the system Ax=b is solvable if and only if rank(A) = rank([A b]). If it is solvable, the general solution is given by one particular solution plus the null space. So it makes sense to mention the function 'null' here. However, I do not see why these are the "remaining homogenous solutions".

Here is a suggestion for the text:

"The rank of a matrix is the number of linearly independent rows or columns. It is thus the dimension of the range space. The function 'orth' may be used to compute an orthonormal basis of that space. For testing if a system Ax=b of linear equations is solvable, test if rank(A) = rank([A b]). If it is solvable, a particular solution can be found via A \ b, and the general solution is this particular solution plus the null space, of which a basis can be computed using null(A)."

Lasse Kliemann <lassekliemann>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #42520:  bug_52533.patch added by siko1056 (2KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by siko1056 (Updated the item)
  • -email is unavailable- added by lassekliemann (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-11-29 siko1056 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2017-11-29 siko1056 Attached File- Added bug_52533.patch, #42520
        StatusNone Patch Submitted
        Assigned toNone siko1056
        Release4.2.1 dev

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code