The concept of a dot product between tuples is so valuable that I am going to introduce it now. The dot product is the sum of the products of the corresponding entries of two tuples. (aside: There is a different rule when complex numbers are involved.) For our purpose, the dot product is just a definition. $$\left(\begin{array}{c}a\\b\\c\end{array}\right)\cdot\left(\begin{array}{c}x\\y\\z\end{array}\right)=ax+by+cz$$ The dot product returns a scalar, which is just a single number.
What is the dot product of $P$ and $Q$, if $P=(1,2)$ and $Q=(3,4)$?
Answer: $$\left(\begin{array}{c}1\\2\end{array}\right)\cdot\left(\begin{array}{c}3\\4\end{array}\right)=1\cdot3+2\cdot4=11$$
The dot product is also called the inner product or the scalar product. If two vectors are named $\mathbf{u}$ and $\mathbf{v}$ then some notation that is frequently used is $\left\langle \mathbf{u|v}\right\rangle$ to mean inner product. If no confusion would exist, then the same inner product is notated as $(\mathbf{u,v}).$ There is much more to the topic of inner product than has been introduced here, but this is all that is needed for a long time.
Given vectors $(\mathbf{x,y})\in\mathbb{R}^{n}$ then we define the dot product as $$\mathbf{x\cdot y}= (\mathbf{x,y})=\left\langle \mathbf{x|y}\right\rangle =\sum_{i=1}^{n}x_{i}y_{i}.$$ We also define the Euclidean norm as “length” of vector $\mathbf{x}.$ $$\Vert\mathbf{x}\Vert=\sqrt{\left\langle \mathbf{x|x}\right\rangle }=\sqrt{\mathbf{x\cdot x}}=\sqrt{\sum_{i=1}^{n}x_{i}^{2}}$$ Then our distance function is $$dist(\mathbf{x,y})=\Vert\mathbf{x-y}\Vert=\left(\sum_{i=1}^{n}(x_{i}-y_{i})^2\right)^{1/2}$$