2.34 Find the rank and the bases of the Null space for a matrix A

Problem: Find the rank and nullities of the following matrices, and find the bases of the range space and the Null space.

\( A=\begin {pmatrix} 2 & 3 & 3 & 4 \\ 0 & -1 & -2 & 2 \\ 0 & 0 & 0 & 1 \end {pmatrix} \)

Mathematica

mat={{2,3,3,4}, 
     {0,-1,-2,2}, 
     {0,0,0,1}}; 
 
{nRow,nCol} = Dimensions[mat]
 

3,4

Print["Rank (or dimension of the range space)=", 
       MatrixRank[mat]]
 

   Rank (or dimension of the range space)=3
 

Print["Dimension of the Null Space=", 
      nCol-MatrixRank[mat]]
 

   Dimension of the Null Space=1
 

Print["Basis for Null Space=",NullSpace[mat]]
 

Basis for Null Space={{3,-4,2,0}}
 

 

Matlab

A=[2 3 3 4; 
   0 -1 -2 2; 
   0 0 0 1] 
 
[nRow,nCol]=size(A); 
 
r = rank(A); 
fprintf('A range space dimension=%d\n',r); 
fprintf('A null space dimension= %d\n',nCol-r); 
fprintf('Basic for null space of A ='); 
null(A,'r')'
 

A range space dimension=3 
A null space dimension= 1 
Basic for null space of A = 
 
ans = 
 1.5000   -2.0000  1.0000  0
 

 

Maple

restart; 
A:=Matrix([[2,3,3,4],[0,-1,-2,2],[0,0,0,1]]); 
LinearAlgebra:-Rank(A); 
LinearAlgebra:-ColumnDimension(A)-LinearAlgebra:-Rank(A); 
LinearAlgebra:-NullSpace(A)
 

3 
1 
  [3/2 
   -2 
   1 
   0]