equissupnica7

2022-07-17

Does it mathematically make sense for a number to be added to a vector (or matrix for that matter)? When I put $4+\left[1,2,3\right]$ into Wolfram Alpha it gives me $\left[5,6,7\right]$, i.e. the number is added to each item, but this doesn't seem correct to me as I would have thought that the number would just be added to the 1st item of the vector - or is neither correct?

Urijah Hahn

Expert

Formally speaking, if $x\in \mathbb{R}$ and $\stackrel{\to }{v}=\left({v}_{k}{\right)}_{k=1}^{n}\in {\mathbb{R}}^{n}$, for n>1, then $x+\stackrel{\to }{v}$ is not a defined operation, unlike $x\stackrel{\to }{v}$ , which is defined to be component-wise multiplication, i.e.,
$x\stackrel{\to }{v}:=\left(x{v}_{k}{\right)}_{k=1}^{n}.$
Thus, you can define the addition to be whatever you like to make life easier and notation simpler.
In many computer implementations, e.g. Mathematica or Python's numpy, you will find the notation
$x+\stackrel{\to }{v}:=x\stackrel{\to }{1}+\stackrel{\to }{v}=\left(x+{v}_{k}{\right)}_{k=1}^{n},$
which sometimes serves as a useful notational shorthand.

Do you have a similar question?

Recalculate according to your conditions!