4.2.8 Vectors Flashcards
(11 cards)
Define Vectors.
A data structure representing a quantity with both magnitude and direction. It can be represented as a list, function or geometric point.
Vector representation with the set symbol.
Vectors can be represented using the symbol for the set they are drawn from, raised to a power equal to their number of components.
How are vectors represented as lists?
v = (2,4)
list v = (2,4)
How are vectors represented as 1D arrays?
v = (7,4,12)
array v [3]
v = (7,4,12)
How are vectors represented as functions?
f = function to create the vector.
S = the complete set of values that the function can be applied to. ( the domain)
R = the potential outputs of the function. (the co-domain)
f : S -> R
e.g set S = {0,1,2,3}, co-domain R (real numbers)
How are vectors represented as dictionaries?
A vector can be thought of as a function that maps from a value, representing a dimension, to the property in that dimension.
v = (2.4, 6.8, 4.5, 9.2)
0 |-> 2.4
1 |-> 6.8
2 |-> 4.5
3 |-> 9.2
dictionary v <- {0 : 2.4, 1 : 6.8, 2 : 4.5, 3 : 9.2}
How is vector addition performed?
Add the components together to achieve translation.
How is scalar vector multiplication performed?
Multiple the vector by the scalar, achieves scaling.
What is the expression for the Convex combination of 2 vectors?
(a *u) + (b * v)
or
au + bv
What are the conditions for convex combination of 2 vectors?
in au + bv:
where
- u and v are vectors
- a + b = 1
- a, b >= 0
What is the dot product?
Multiply top vectors and add it with the bottom vectors multiplied.
Application of dot product:
cos q = (a . b) / (|a| * |b|)