This notebooks shows how to work with vectors in R
Given are the following two vectors \(v\) and \(w\). Compute
- the sum \(v+w\),
- the difference \(v-w\) and
- the dot product \(v\cdot w\).
\[v = \left[\begin{array}{c}
3 \\
-5 \\
1 \\
9 \\
\end{array}\right]
\]
and
\[w = \left[\begin{array}{c}
1 \\
9 \\
-12 \\
27 \\
\end{array}\right]
\]
LS0tCnRpdGxlOiAiVmVjdG9ycyBpbiBSIgpvdXRwdXQ6IGh0bWxfbm90ZWJvb2sKLS0tCgpUaGlzIG5vdGVib29rcyBzaG93cyBob3cgdG8gd29yayB3aXRoIHZlY3RvcnMgaW4gUgoKR2l2ZW4gYXJlIHRoZSBmb2xsb3dpbmcgdHdvIHZlY3RvcnMgJHYkIGFuZCAkdyQuIENvbXB1dGUKCiogdGhlIHN1bSAkdit3JCwgCiogdGhlIGRpZmZlcmVuY2UgJHYtdyQgYW5kIAoqIHRoZSBkb3QgcHJvZHVjdCAkdlxjZG90IHckLiAKCiQkdiA9IFxsZWZ0W1xiZWdpbnthcnJheX17Y30KICAgMyAgXFwgCiAgLTUgIFxcIAogICAxICBcXCAKICAgOSAgXFwKICBcZW5ke2FycmF5fVxyaWdodF0KJCQKCmFuZCAKCiQkdyA9IFxsZWZ0W1xiZWdpbnthcnJheX17Y30KICAgIDEgIFxcIAogICAgOSAgXFwgCiAgLTEyICBcXCAKICAgMjcgIFxcCiAgXGVuZHthcnJheX1ccmlnaHRdCiQkCg==