while going through the matrices and its rank,, I found an example
matrix A $$ \begin{matrix} 1 & 2 & 3 \\ 2 & 3 & 5 \\ 3 & 4 & 7 \\ 4 & 5 & 9 \\ \end{matrix} $$
well clearly column2 and column3 are linear combinations of column1,
in terms of python
column1 = [ x for x in range(1,5) ]
column2 = [ x+1 for x in range(1,5) ]
column3 = [ 2*x+1 for x in range(1,5) ]
similarly in R
column1 <- 1:4
column2 <- column1 + 1
column3 <- column1*2 + 1
and I have calculated the rank in both of these languages , and it turns out to be 2,, but as per my intuition rank is the no of independent rows or columns in a matrix , and here it is 1( column1),
Can someone, please explain where am I going wrong in my concept?
This is because independence considers whether a column is a linear combination of other columns or not. Addition of a constant is not a linear operation. It is not equivalent to adding a multiple of other column unless you have a column like $t(1,1,1,1)$. If you create a column by multiplying by constant the vector representing the column does not change its direction. But adding a constant has a different effect. column 1 and 2 are independent as you can not represent second column as multiple of column 1.