1x1 Matrix is a scalar?

  • #1
laser1
80
13
TL;DR Summary
1x1 Matrix is scalar or not?
I've seen dot product being represented as a (nx1 vector times a (mx1)^T vector. This gives a 1x1 matrix, whereas the dot product should give a scalar. I have found some threads online saying that a 1x1 matrix IS a scalar. But none of them seem to answer this question: you can multiply a 2x2 matrix by a scalar, but you can't multiply a 1x1 matrix by a 2x2 matrix.
 
Physics news on Phys.org
  • #2
:welcome:

What's your definition of a scalar?
 
  • #3
PeroK said:
:welcome:

What's your definition of a scalar?
I would tentatively say that it is something that has a magnitude but no direction! I'm not sure.
 
  • #4
laser1 said:
I would tentatively say that it is something that has a magnitude but no direction! I'm not sure.
That's not particularly helpful in the context of linear algebra. A matrix has neither magnitude nor direction!

https://en.wikipedia.org/wiki/Scalar_(mathematics)
 
  • #5
laser1 said:
I would tentatively say that it is something that has a magnitude but no direction! I'm not sure.
My answer would be that a vector space is defined over a scalar field - usually ##\mathbb R## or ##\mathbb C##. In this context, that's what a scalar is. Note that it's pointless to argue that a complex number has a magnitude and a direction and can't be a scalar. It's a scalar in the context of Linear Algebra.

The set of 1x1 matrices (with real entries, say) is clearly equivalent to the set of real numbers. But, if we use this as our field of scalars, then scalar multiplication is not defined the same as we would normally expect for matrix multiplication by a 1x1 matrix. With scalar multiplication, we multiply every element of the matrix by the scalar. Whereas, technically a 1x1 matrix cannot be multiplied by a 3x3 matrix, for example.

The moral is that terminology and definitions are there to help you. But, if you start messing around with things, you end up with arguments over words that have little or no mathematical content.
 
  • #6
laser1 said:
TL;DR Summary: 1x1 Matrix is scalar or not?

I've seen dot product being represented as a (nx1 vector times a (mx1)^T vector. This gives a 1x1 matrix, whereas the dot product should give a scalar. I have found some threads online saying that a 1x1 matrix IS a scalar. But none of them seem to answer this question: you can multiply a 2x2 matrix by a scalar, but you can't multiply a 1x1 matrix by a 2x2 matrix.
Strictly speaking, it is not a scalar. Say we have the matrix ##(a).## Then it represents the linear function ##x\mapsto a\cdot x,## i.e. ##a\,\cdot\,.## The dot behind ##a## makes the difference. The number ##a## itself is a scalar, the coordinate at position ##(1,1).##

However, the distinction between ##(a)## and ##a## is a bit artificial in a case where there is only one matrix entry, i.e. if the function and the coordinate is represented by the same single number.

A case, where such a distinction is important is differentiation. We say that the derivative is a linear approximation or a linear function. the derivative ##f'(x_0)## at point ##x_0## isn't linear in ##x_0## but linear in ##v\mapsto f'(x_0)\cdot v.##
\begin{align*}
f(x_0+v)&=f(x_0) + (f'(x_0))\cdot v + o(\|v\|)\\[6pt]
(x_0+v)^3&=x_0^3+(3x_0^2)\cdot v + (3x_0v^2+v^3)
\end{align*}
The linearity is somehow invisible if there is only one direction ##v=x## as in one-dimensional real calculus so speaking of a derivative as a linear map appears to be strange. But it is exactly the difference between a one-dimensional matrix ##(f'(x_0))## and the coordinate ##f'(x_0).##

Hence, there is something to it, distinguishing between a matrix as a linear function and its one coordinate, a scalar, even if the difference in one dimension seems to be a bit artificial.
 
Last edited:
  • #7
PeroK said:
My answer would be that a vector space is defined over a scalar field - usually ##\mathbb R## or ##\mathbb C##. In this context, that's what a scalar is. Note that it's pointless to argue that a complex number has a magnitude and a direction and can't be a scalar. It's a scalar in the context of Linear Algebra.

The set of 1x1 matrices (with real entries, say) is clearly equivalent to the set of real numbers. But, if we use this as our field of scalars, then scalar multiplication is not defined the same as we would normally expect for matrix multiplication by a 1x1 matrix. With scalar multiplication, we multiply every element of the matrix by the scalar. Whereas, technically a 1x1 matrix cannot be multiplied by a 3x3 matrix, for example.

The moral is that terminology and definitions are there to help you. But, if you start messing around with things, you end up with arguments over words that have little or no mathematical content.
Okay, so can I conclude that the dot product is NOT two matrix multiplied? But people get messy with it and say that it is even though technically it is not. Is this correct?
 
  • #8
laser1 said:
Okay, so can I conclude that the dot product is NOT two matrix multiplied? But people get messy with it and say that it is even though technically it is not. Is this correct?
The dot product is defined to be a function that takes two vectors and produces a number (either Real or Complex). It can be seen as the multiplication of two matrices (1x3 times 3x1), as long as you also map the resulting 1x1 matrix to the corresponding number.

In most applications that level of detail is hardly relevant. To be honest, it's not a detail I've ever previously noticed.
 
  • Like
Likes laser1
  • #9
PeroK said:
as long as you also map the resulting 1x1 matrix to the corresponding number.
aha! That was what I was missing. Thanks
 
  • #10
laser1 said:
TL;DR Summary: 1x1 Matrix is scalar or not?

I've seen dot product being represented as a (nx1 vector times a (mx1)^T vector. This gives a 1x1 matrix, whereas the dot product should give a scalar. I have found some threads online saying that a 1x1 matrix IS a scalar. But none of them seem to answer this question: you can multiply a 2x2 matrix by a scalar, but you can't multiply a 1x1 matrix by a 2x2 matrix.
How do you multiply a 2x2 matrix by a scalar? It doesn't hold up dimension-wise; you can only multiply an mxn matrix by an nxp matrix.
 
  • Skeptical
Likes PeroK
  • #12
PeroK said:
Ok, fair enough, I should have been more precise. This is scaling, which is different from matrix multiplication. An mxn matrix can only be multiplied, in terms of matrix , rather than scaling, with an nxp matrix.
 
  • #13
A matrix is (even 1 by 1) not a number. But the set of ##1\times 1## matrices over a ring ##R## is isomorphic to ##R## (the real numbers, say). You can get away with it in some sense by identifying these matrices with their single component (the scalar), but strictly speaking that is not consistent with the arithmetic laws. For example, we can multiply a matrix with any scalar, but we can't multiply every matrix with any ##1\times 1## matrix.

In short, if you know what you're doing, you can get away with it. Otherwise, let scalars and matrices be separate objects and you'll also be fine.
 
Last edited:
  • Like
Likes laser1

Similar threads

Replies
1
Views
2K
Replies
2
Views
2K
Replies
4
Views
2K
Replies
4
Views
2K
Replies
7
Views
2K
Replies
19
Views
2K
Back
Top