Lecture 9 Flashcards

1
Q

Vector space

A

Set V of vectors and a field F of scalars with addition and multiplication ⍺v∈V, u+v∈V
- associativity, commutativity, additive identity, additive inverse, associativity wrt scalar multiplication, distributivity wrt scalar/vector addition, scalar multiplication identity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Linear function

A
f(u+v) = f(u) + f(v)
f(⍺u) = ⍺f(u)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

f(x) = |x|/x, f:R>R linear?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

f(x) = ax+b, f:R>R linear?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Linear functions as matrix-vector multiplication ?

A
y = f(x) > y = Ax
A(u+v) = Au + Av
A(⍺u) = ⍺Au
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Shear operator

A

Change in angle:
1 b
a 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Rotation operator

A

cos(θ) -sin(θ)

sin(θ) cos(θ)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Scale operator

A

a=x-direction, b=y-direction
a 0
0 b

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Reflection operator

A

-a:y-axis symmetry
-a 0
0 -b

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Translation

A

+ (a b)
1 0
0 1
nonlinear!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Permutation matrix

A

permutation of the identity matrix (swap rows):
0 0 1
1 0 0
0 1 0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Lower/Upper triangular matrix

A

lower: 0 j more than i, upper: 0 i more than j

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Rank

A
  • number of linearly independent columns of the matrix

- rank(A) ≤ min(m,n), if = min(m,n) then full-rank otherwise rank deficient

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Singular matrix

A

A square matrix which is not invertible, that is det(A) = 0 (linearly independent row/columns) - if not singular then rank = n

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Sparse matrix

A

O(min(n,m)) non-zero entries

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

A+B number of operations dense vs sparse matrices

A

O(n^2) vs

O(nnz(A)+nnz(B))

17
Q

Dense representation (DNS)

A

AA = [#rows #col v1 v2 v3…]

stores zeros, row-wise..

18
Q

Coordinate representation (COO)

A
data = [v1 v2 v3...]
row = [rowv1, rowv2,...]
col = [colv1, colv2...]
nnz*doubles + 2nnz*integers
no zeros and not sorted
19
Q
COO how many bytes? (32 bits integer, 64 bits float, 1 byte = 8 bits)
0    0    1.3
-1.5 0.2  0
5    0     0
0    0.3  3
0    0     0
A

nnz64+2nnz32 = 96 bytes

20
Q

Compressed Sparse Row representation (CSR)

A

data = [v1, v2,…] (nnz integers)
col = [colv1, colv2,…] (nnz doubles)
rowptr = [i1, i2,.., in, nnz] (size n+1)
i1 is the starting index in data of row1 (row offset) - always 0!
fast operations between sparse matrices / matrix-vector product.

21
Q
CSR representation (rowptr)
1   5  0  0   1
0  2  3  0  0
0  0  0  0  0
0  0  0  4  0
0  0  6  9  7
A

rowptr = [0 3 5 5 6 9]

22
Q

Inverse of a permutation matrix - nnz

A

its transpose, nnz = n

23
Q

Matrix in block form / block diagonal

A

matrix partitioned into blocks (sub matrices)
M =
A B
C D
block diagonal if off-diagonal matrices are zero matrices (C and B here)

24
Q

A rotates θ, what rotates -θ?

A

A.T, A^-1

25
Q

How many solutions Ax = b if A is non-singular?

A

1 solution, x=A^-1 b

26
Q

How many solutions Ax = b if A is singular?

A

It depends on b

27
Q

from/to CSR python

A

import scipy as sp
import scipy.sparse

csr = sp.sparse.csr_matrix(A)
print(csr.indptr)

sp.sparse.csr_matrix( (data,indices,indptr), shape=(x,y) ).todense()