Matrix Multiplication $1 \times n$ and $n \times 1$ Case
I have seen a matrix multiplication with programming and other means such as the convention of dot product where $[3][2]=6$. However, I am unsure if it is technically correct to have it $[3][2]=[6]$. If you have a matrix $A$ which is $ 1 \times n$ and another matrix $B$ which is $n \times 1$ where $n$ is an element of the set of natural numbers, then $AB$ is another matrix which is $1 \times 1$ (like $[6]$) or is it not a matrix at all (like $6$)?
Solution 1:
Yes, it is technically correct to write, for example, $$ \pmatrix{3&1}\pmatrix{2\\-1} = (5) $$ However, it is much more common to simply write $$ \pmatrix{3&1}\pmatrix{2\\-1} = 5 $$ It is rare to see $1 \times 1$ matrices enclosed in brackets (or thought of as matrices rather than scalars), so the reader is likely to be confused at first if you decide to go with the "technically correct" first option. However, either way is understandable.
Often, writing a $1 \times 1$ matrix as a scalar allows you to cut through and clarify matrix multiplication. For example, it is helpful to write that if $x$ is a unit vector, then $$ (xx^T)^2 = x(x^Tx)x^T = (x^Tx)(xx^T) = xx^T $$ In the case that $x$ isn't a unit vetor, we can now easily see that $(xx^T)^n = (x^Tx)^{n-1} xx^T$, which is more immediately comprehensible than $x(x^Tx)^{n-1}x^T$.
Similarly, the Sherman-Morrison formula should technically be written as $$ A^{-1} - A^{-1}u([1] + v^TA^{-1}u)^{-1}v^TA^{-1} $$ but (I find) it is much clearer if written in the form $$ A^{-1} - \frac{A^{-1}uv^TA^{-1}}{1 + v^TA^{-1}u} $$