On the Subject of Maiming Matrices

Guess who just finished an algebra course?

Level -1: Meta-information

Each type of question is assigned a difficulty score, as noted in their own section. Cumulatively answer 15 points of difficulty to solve the module. If you’re near your goal, you will not receive difficult questions, going way over your goal.

Tips: (May be patched in the future!)

  • For most questions, the answer is generated first, so don’t be biased towards the ‘no’ button if you had to guess.
  • For questions about null(A) and rank(A), both the matrix and answer are randomly generated, so the answer always has a 25% chance of being Yes and 75% chance of being No. Notably, unless you get a zero matrix, null(A)3 and rank(A)0.
  • For the remaining number-checking questions, if the answer is ‘no’, the displayed number will be at most ±9 away from the real answer, so if yours is wayyyy off, check your work!
  • For ‘Is A __’ questions (except for 4.3), if the answer chosen is ‘no’, the randomly generated matrix will never have 3-digit numbers. (However, it will still check if the generated matrix somehow answers true to the question, but this is very unlikely.)

Level 0: Basics of Matrices

The main diagonal in a square matrix is the diagonal going from the top-left to the bottom-right.

Matrix indexing: Ai,j or Aij refers to the value at the ith row and jth column.

Example: For A= ( 123 456 789 ) , A11=1, A12=2, A13=3, etc.

Matrix addition: If two matrices have the same dimensions, they can be added together to make a new matrix with the same dimension. Each position in the new matrix equals the sum of that position of the two starting matrices.

Example: ( 111 111 111 ) + ( 123 456 789 ) = ( 234 567 8910 )

Scalar multiplication (number times matrix): Simply multiply all elements of the matrix with the number (sometimes called the scalar).

Example: 3 ( 123 456 789 ) = ( 369 121518 212427 )

Matrix multiplication: A matrix of size m×n can be multiplied by a matrix of size n×p, resulting in a matrix of size m×p. Order is especially important; that is, AB and BA are different, and swapping positions will cause the operation to become impossible if the matrices are mismatched in size, or result in a different resulting matrix.

For each position in the resulting matrix C, Cij can be calculated using the following steps:

  • Consider the ith row of the first matrix and the jth column of the second matrix.
  • Multiply the first element of the row by the first element of the column, the second by the second, etc.
  • Sum all the products up, that is the value of that position.
Examples: ( 61-4 3-12 351 ) ( -421 1-10 -274 ) = ( 6(-4)+1*1+(-4)(-2) 6*2+1(-1)+(-4)*7 6*1+1*0+(-4)*4 3(-4)+(-1)*1+2(-2) 3*2+(-1)(-1)+2*7 3*1+(-1)*0+2*4 3(-4)+5*1+1(-2) 3*2+5(-1)+1*7 3*1+5*0+1*4 ) = ( -15-17-10 -172111 -987 ) ( 61-4 3-12 351 ) ( 4 1 3 ) = ( 6*4+1*1+(-4)*3 3*4+(-1)*1+2*3 3*4+5*1+1 *3 ) = ( 13 17 20 )

Special (3x3): Multiplying any matrix with the zero matrix O= ( 000 000 000 ) results in the zero matrix of the correct size and multiplying by the identity matrix I= ( 100 010 001 ) results in the same matrix as before. That is, AO=OA=O and AI=IA=A.

Level 1: Shapes (0.25 points/question)

Shape Condition Example
Diagonal All values NOT on the main diagonal are 0. ( 500 000 001 )
Triangular All values below or above the main diagonal are 0. Diagonal matrices are also triangular. ( 400 930 071 )
Symmetric Every value is equal to its mirror reflection across the main diagonal. ( 498 937 871 )
Skew-Symmetric The main diagonal is entirely 0s, and every value is equal to negative its mirror reflection across the main diagonal. ( 09-8 -907 8-70 )
Centro-Symmetric Every value is equal to its center-symmetric counterpart. ( 308 767 803 )

Level 2: Properties

2.1. Trace (1 point)

Simply take the sum of the elements on the main diagonal.

tr ( abc def ghi ) =a+e+i

2.2. Determinants (3.75 points)

Determinant of a 2x2 matrix: det ( ab cd ) =ad-bc

Determinant of a 3x3 matrix: Take the sum of the products of the 3 diagonals going top-left to bottom-right (including wrap-around), minus the sum of the products of the 3 diagonals going top-right to bottom-left.

det ( abc def ghi ) = aei+bfg+cdh- ceg-bdi-afh

2.3. Invertibility (4 points)

A square matrix A is invertible if and only if det(A)0.

2.4. Permanent (3.75 points)

Permanent of a 3x3 matrix: similar to determinant, but replace all minuses with pluses.

perm ( abc def ghi ) = aei+bfg+cdh+ ceg+bdi+afh

2.5. Minor (3 points)

A minor of a matrix is the determinant of a matrix created by removing one row and one column from the original. Mij will remove the ith row and jth column.

Example: M12of ( 61-4 3-12 351 ) = det ( 32 31 ) = det ( 32 31 ) =3*1-3*2=-3

2.6. Cofactor (3.25 points)

Cofactor equals minor when i+j is even, and equals negative minor when i+j is odd.

Cij= (-1)i+j Mij

Example: M11=1C11=1
M32=2C32=-2

Level 3: Nullity and Rank (5 points)

An echelon matrix is a matrix that satisfies these requirements:

  • On all rows, all zero entries, if any, must be at the start.
  • All rows full of 0s must be at the bottom.
  • If a row is not full of 0s, it must have more zeroes than the row above it.

Example: ( 135 027 000 ) , ( 13579 02753 00611 00008 00000 )

To transform the given matrix into an echelon matrix, you are allowed to do the following:

  • Swap the position of any two rows.
  • Multiply any row by a nonzero number.
  • Add to any row, the entire content of another row, position by position.

To find the nullity and rank of a matrix, first convert it into an echelon matrix using the operations listed above. Hint: convert A21 and A31 to zero, then convert A32 to zero. Afterwards, if the resulting matrix is still not an echelon matrix (in other words, A22=0 ), convert A33 to zero.

Example:

( 2-22 81-2 -21110 ) ~ ( 2-22 09-10 -21110 ) ~ ( 2-22 09-10 0912 ) ~ ( 2-22 09-10 0022 )

With the resulting echelon matrix, it is trivial to find its nullity and rank:

  • Nullity is the number of rows that is full of 0s.
  • Rank is the number of rows that has at least one nonzero element.

Nullity and rank will always add up to the number of rows (3 in this module.)

Unless you get a zero matrix, null(A)3 and rank(A)0.

Level 4: Fuck

4.1. Involutory (6 points)

A 3x3 matrix A is involutory if and only if AA=I= ( 100 010 001 ) .

Tip: Check the first few (3+) positions. If any of them is incorrect then it’s a definite no. If all positions you’ve checked are correct, then it’s probably a yes, or you just got very lucky/unlucky.

Tip: Involutory matrices usually contain a lot of 0s.

4.2. Idempotency (6.25 points)

A square matrix A is idempotent if and only if AA=A.

4.3. Diagonalizability (10 points)

For any given 3x3 matrix A,
First, solve for its eigenvalues λ by solving the equation: det(A-λI)=0. The matrix is guaranteed to have 1-3 eigenvalues.
If the matrix has 3 eigenvalues, it is diagonalizable. Stop here.
If not, for each eigenvalue you received, calculate null(A-λI).
Sum all the nulls up. If the sum equals 3, the matrix is diagonalizable. If not, it is not diagonalizable.

Example: A= ( 3-68 4-1725 4-1420 )

Solving for eigenvalues: det ( ( 3-68 4-1725 4-1420 ) - ( λ00 0λ0 00λ ) ) =0
det ( 3-λ-68 4-17-λ25 4-1420-λ ) =0

-λ3 +6λ2 -11λ +6 =0

Solving this polynomial gives the values λ=3,2,1. Because the matrix has 3 eigenvalues, it is diagonalizable. However, continuing on:

For λ=1:

null ( 3-λ-68 4-17-λ25 4-1420-λ ) null ( 3-1-68 4-17-125 4-1420-1 ) ( 2-68 4-1825 4-1419 ) ~ ( 2-68 4-1825 0-23 ) ~ ( 2-68 0-69 0-23 ) ~ ( 2-68 0-69 000 ) nullity=1

For λ=2:

null ( 3-λ-68 4-17-λ25 4-1420-λ ) null ( 3-2-68 4-17-225 4-1420-2 ) ( 1-68 4-1925 4-1418 ) ~ ( 1-68 05-7 4-1418 ) ~ ( 1-68 05-7 010-14 ) ~ ( 1-68 05-7 000 ) nullity=1

For λ=3:

null ( 3-λ-68 4-17-λ25 4-1420-λ ) null ( 3-3-68 4-17-325 4-1420-3 ) ( 0-68 4-2025 4-1417 ) ~ ( 4-2025 4-1417 0-68 ) ~ ( 4-2025 06-8 0-68 ) ~ ( 4-2025 06-8 000 ) nullity=1

Sum the nullities up, we get 1+1+1=3, which means the matrix is diagonalizable.

Level 5: The Text-Field Calculator

The Text-Field Calculator has some built-in functions that help you do operations on matrices.

First, create a matrix with the syntax: [[a,b,c],[d,e,f],[g,h,i]] and replace the letters with your matrix, in reading order. Then, type one of the functions below into the calculator, putting your matrix inside the brackets ( ) or over the placeholder if any:

matrix * matrix returns the matrix multiplication product of the two matrices.

det( ) returns the determinant of the matrix.

eigs( ) returns the eigenvalues of the matrix within some data. You’d want to look for the very first “values”: [number, number, number], these are your eigenvalues. If floating point arithmetic has messed with your values, feel free to round them.