Addition of a number and a vector

50 Views Asked by At

Does it mathematically make sense for a number to be added to a vector (or matrix for that matter)? When I put $4 + [1, 2, 3]$ into Wolfram Alpha it gives me $[5, 6, 7]$, 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?

1

There are 1 best solutions below

0
On BEST ANSWER

Formally speaking, if $x \in \mathbb{R}$ and $\vec{v} = (v_k)_{k=1}^n \in \mathbb{R}^n$, for $n>1$, then $x + \vec{v}$ is not a defined operation, unlike $x\vec{v}$, which is defined to be component-wise multiplication, i.e., $$x\vec{v} := (xv_k)_{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 + \vec{v} := x \vec{1} + \vec{v} = (x + v_k)_{k=1}^n, $$ which sometimes serves as a useful notational shorthand.