Matricies Flashcards
(48 cards)
What is a matrix?
A 2D array of numbers arranged in rows and columns.
What is a row in a matrix?
A horizontal group of elements.
What is a column in a matrix?
A vertical group of elements.
What is the size or dimension of a matrix?
The number of rows and columns, represented as m x n.
What is a square matrix?
A matrix with the same number of rows and columns.
What is a diagonal matrix?
A square matrix where all off-diagonal elements are zero.
What is an identity matrix?
A diagonal matrix with 1s on the diagonal and 0s elsewhere.
What is a zero matrix?
A matrix where all elements are 0.
What is a symmetric matrix?
A matrix equal to its transpose.
What is a transpose of a matrix?
A matrix obtained by swapping rows with columns.
What is a sparse matrix?
A matrix where most elements are zero.
What is a dense matrix?
A matrix with few or no zero elements.
What is the time complexity to access an element in a matrix?
O(1) for direct access using indices.
How is a matrix represented in code?
Typically as a list of lists or 2D array.
What is matrix addition?
Adding corresponding elements of two matrices of the same size.
What is matrix subtraction?
Subtracting corresponding elements of two matrices of the same size.
What is scalar multiplication in a matrix?
Multiplying every element by a constant.
What is matrix multiplication?
A row-by-column operation producing a new matrix.
What is the condition for matrix multiplication?
The number of columns in the first matrix must equal the number of rows in the second.
What is the time complexity of matrix multiplication?
O(n^3) for naïve method; faster algorithms like Strassen’s exist.
What is a triangular matrix?
A matrix where all elements below or above the main diagonal are zero.
What is a lower triangular matrix?
A matrix where all elements above the diagonal are zero.
What is an upper triangular matrix?
A matrix where all elements below the diagonal are zero.
What is a row-major order?
Matrix elements are stored row by row in memory.