Linear Algebra - Vector Vector Operations

Card Puncher Data Processing

About

Vector Vector Operations:

List

Using operator overloading, you can compute this operations with the following syntax.

Operation Syntax
vector addition u+v
vector negation -v
vector subtraction u-v
scalar-vector multiplication alpha*v
division of a vector by a scalar v/alpha
dot-product u*v
getting value of an entry v[d]
setting value of an entry v[d] = …
testing vector equality u == v
pretty-printing a vector print(v)
copying a vector v.copy()

Operations

Translation

A vector translation is also known as a vector Addition.

Syntax

[u1, u2, . . . , un] + [v1, v2, . . . , vn] = [u1 + v1, u2 + v2, . . . , un + vn]
v + 0 = v

Property

Vector addition is

(x + y) + z = x + (y + z)
x + y = y + x

Representation

Addition of vectors over <math>\mathbb{R}</math> can be visualized using arrows.

Vector Addition Arrow

Computation

In python:

  • For two n-vectors
def addn(v, w): return [v[i]+w[i] for i in range(len(v))]
  • For n n-vectors:
>>> vectorList = [[1,2,3],[1,2,3], [1,2,3]]
# How to group the number by position in the vector
>>> [[i[j] for i in vectorList] for j in range(len(vectorList[0])) ]
[[1, 1, 1], [2, 2, 2], [3, 3, 3]]
# Then add a sum to the above statement
>>> [sum([i[j] for i in vectorList]) for j in range(len(vectorList[0])) ]
[3, 6, 9]

Scalar Multiplication

Linear Algebra - Scalar (Multiplication|Product) - Scaling

Dot product

Linear Algebra - (Dot|Scalar|Inner) Product of two vectors

Element-wise multiplication

Element-wise multiplication is the default method when two NumPy arrays are multiplied together.

The element-wise calculation is as follows: <MATH> \mathbf{x} \odot \mathbf{y} = \begin{bmatrix} x_1 . y_1 \\\ x_2 . y_2 \\\ \vdots \\\ x_n . y_n \end{bmatrix} </MATH>

Example: <MATH> \begin{bmatrix} 1 \\\ 2 \\\ 3 \end{bmatrix} \odot \begin{bmatrix} 4 \\\ 5 \\\ 6 \end{bmatrix} = \begin{bmatrix} 4 \\\ 10 \\\ 18 \end{bmatrix} </MATH>

Others

Inner product

Linear Algebra - Inner product of two vectors

Cross Property

Distributivity

Scalar-vector multiplication distributes over vector addition (translation):

<MATH>\alpha(u+v)=\alpha.u+\alpha.v</MATH>

2([1, 2, 3] + [3, 4, 4]) = 2 [1, 2, 3] + 2 [3, 4, 4] = [2, 4, 6] + [6, 8, 8] = [8, 12, 14]

Addition and scalar multiplication are used to defined a a line that not necessarily go through the origin.





Discover More
Support Vector Geometry
Data Mining - Support Vector Machines (SVM) algorithm

A support vector machine is a Classification method. supervised algorithm used for: Classification and Regression (binary and multi-class problem) anomalie detection (one class problem) Supports:...
Vector Addition Scalar Multiplication
Linear Algebra - (Line|Line Segment)

in linear algebra. Line and line segment definition in Linear Algebra that goes: A line has a dimension of one because only one coordinate is needed to specify a point on it Line_segmentline...
Card Puncher Data Processing
Linear Algebra - Inner product of two vectors

Inner products allow the rigorous introduction of intuitive geometrical notions such as the length of a vector or the angle between two vectors. They also provide the means of defining orthogonality between...
Card Puncher Data Processing
Linear Algebra - Linear Equation

A linear equation represents a linear function that forms a straight line. A common form of a linear equation in the two variables (two dimensions) x and y is where: m is a constant named the slope...
Card Puncher Data Processing
Linear Algebra - Matrix Vector (Multiplication)

There is two ways to multiply a matrix by a vector: matrix vector or vector matrix For each of these multiplication, two equivalent implementations (definitions): in terms of linear combinations...
Card Puncher Data Processing
Linear Algebra - Norm (Length)

The norm of a vector v is written The norm of a vector v is defined by: where: is the inner product of v. In Euclidean space, the inner product is the . For a 2-vector: as the Pythagorean...
Image Vector
Linear Algebra - Vector

tuple in Linear algebra are called vector. A vector is a list of scalar (real number) used to represent a When the letters are in bold in a formula, it signifies that they're vectors, To represent...
Card Puncher Data Processing
Python - NumPy

NumPy is a Python library for working with arrays. NumPy provides abstractions that make it easy to treat these underlying arrays as vectors and matrices....



Share this page:
Follow us:
Task Runner