Vectors & Matrices Flashcards
What is a vector?
Sequence of nums but diff from sequence as position of each value is significant. Sequence comp creates sequence in same way as set comp, with constraint of 1 generating variable + its value taken in order from set of whole nums.
E.g. [x|x∈{1,…,3}]. ‘inds(S)’ means {1,…,len(S)}
How do we add vectors?
Add 2 vectors to create new one by adding corresponding elements. Must be of same kind. E.g. (2,3,1,200) + (2,3,1,300) = (4,6,2,500) so A + B = [A(i)+B(i)|i∈inds(A)]
What is a scalar?
Single number. To multiply vector by scalar, multiply each element by scalar. If s is scalar + v is vector, product of s and v is sv = [sv(i)|i∈ inds(s)]
How do you multiply 2 vectors?
Can multiply 2 vectors + get scalar answer. If a and b are vectors of same length, a is horizontal + b is vertical, then scalar product of a and b is:
len (a)
a * b = ∑ a(i) * b(i)
i=1
How do we multiply matrices?
(0.60 0.50)
(0.90 0.80)
Matrices e.g. (2,3,1,200) * = (6.79 8.10)
(0.80 0.70)
(0.01 0.02)
Matrix addition + multiplication are associative, matrix multiplication distributes over matrix addition.
What is a matrix?
Sequence of vectors where each vector is of same length. If M is matrix, then M(r) is rth row, within this row, M(r)(c) is cth element (column c). Row, then column. Can be represented in expression boxes as sequence of sequences. C = A*B means C will have A rows and B columns.
Why do we use vectors of vectors?
Number of multiplications + additions hasn’t been reduced by using vectors of vectors, benefit is keeping track of values.
What is an identity matrix?
An n x n matrix in which every element is zero except for falling diagonal + where falling diagonal is all 1’s is called an Identity Matrix In. If A is n x m matrix, then ln * A = A. If B is m x n matrix, then B * ln = B. A matrix is unchanged when multiplied by identity matrix In.