A matrix is a rectangular array of numbers arranged in $m$ rows and $n$ columns. We say the matrix has size $m \times n$ and write $A = [a_{ij}]$, where $a_{ij}$ is the entry in row $i$ and column $j$. For example, $A=\begin{bmatrix}3&-2\\4&-1\end{bmatrix}$ is a $2 \times 2$ (square) matrix with $a_{12}=-2$.
Special matrices you must know for YÖS:- Square matrix: the number of rows equals the number of columns ($n \times n$).- Zero matrix $O$: all entries are $0$. For any matrix $A$ of the same size, $A + O = A$.- Identity matrix $I$: a square matrix with $1$ on the main diagonal and $0$ elsewhere: $$I = \begin{bmatrix}1&0\\0&1\end{bmatrix}.$$ It behaves like the number $1$: $AI = IA = A$ for every square matrix $A$ of the same size.
Two matrices are equal if and only if they have the same size and all corresponding entries are equal. This is the key to problems with unknown parameters: equate entries one by one.
Matrices of the same size are added and subtracted entry by entry, and a matrix is multiplied by a number (scalar) by multiplying every entry:$$(A \pm B)_{ij} = a_{ij} \pm b_{ij}, \qquad (kA)_{ij} = k\,a_{ij}.$$
Example of a combined linear operation:$$\begin{bmatrix}3&-2\\4&-1\end{bmatrix} - 2\begin{bmatrix}-1&-1\\0&2\end{bmatrix} = \begin{bmatrix}3-(-2)&-2-(-2)\\4-0&-1-4\end{bmatrix} = \begin{bmatrix}5&0\\4&-5\end{bmatrix}.$$
Useful rules: $k(A+B) = kA + kB$, $(k+m)A = kA + mA$, $A - B = A + (-1)B$. Watch the signs carefully when the scalar is negative — this is the most common source of mistakes.
The product $AB$ is defined only when the number of columns of $A$ equals the number of rows of $B$:$$A_{m \times n} \cdot B_{n \times p} = C_{m \times p}, \qquad c_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j} + \dots + a_{in}b_{nj}.$$The entry $c_{ij}$ is the sum of products of row $i$ of $A$ with column $j$ of $B$.
A rectangular example: if $A$ is $2 \times 3$ and $B$ is $3 \times 2$, then $AB$ is a $2 \times 2$ matrix, while $BA$ is $3 \times 3$ — different sizes!
A $2 \times 2$ example:$$\begin{bmatrix}1&2\\3&4\end{bmatrix}\begin{bmatrix}0&1\\1&0\end{bmatrix} = \begin{bmatrix}1\cdot0+2\cdot1&1\cdot1+2\cdot0\\3\cdot0+4\cdot1&3\cdot1+4\cdot0\end{bmatrix} = \begin{bmatrix}2&1\\4&3\end{bmatrix}.$$
Warning: matrix multiplication is NOT commutative: in general $AB \neq BA$. However, it is associative, $(AB)C = A(BC)$, and distributive, $A(B+C) = AB + AC$.
The transpose $A^T$ is obtained by turning the rows of $A$ into columns: $(A^T)_{ij} = a_{ji}$. If $A$ is $m \times n$, then $A^T$ is $n \times m$. For example:$$A = \begin{bmatrix}1&2&3\\4&5&6\end{bmatrix} \;\Rightarrow\; A^T = \begin{bmatrix}1&4\\2&5\\3&6\end{bmatrix}.$$
Key properties:$$(A^T)^T = A, \qquad (A+B)^T = A^T + B^T, \qquad (kA)^T = kA^T, \qquad (AB)^T = B^T A^T.$$Note the reversed order in $(AB)^T = B^T A^T$.
In YÖS problems an equality such as $A^T = A$ or $A^T = B$ with parameter entries is solved by matching corresponding entries: the entry in position $(i,j)$ of the left side must equal the entry in position $(i,j)$ of the right side. This gives a system of ordinary equations for the parameters.
For a square matrix, $A^2 = A \cdot A$, $A^3 = A^2 \cdot A$, and so on; by convention $A^0 = I$. Powers of the same matrix commute: $A^m A^n = A^{m+n}$.
YÖS often asks for a large power such as $A^{32}$. Never multiply 32 times — compute $A^2$ and $A^3$, spot the pattern, then jump to the required exponent. Typical patterns:- Triangular matrices with 1s on the diagonal: for $A = \begin{bmatrix}1&a\\0&1\end{bmatrix}$ we get $A^n = \begin{bmatrix}1&na\\0&1\end{bmatrix}$ — the off-diagonal entry grows linearly.- Cyclic matrices: sometimes $A^2 = I$ or $A^3 = I$ or $A^4 = I$. Then reduce the exponent modulo the cycle length: if $A^4 = I$, then $A^{2026} = A^{4 \cdot 506 + 2} = A^2$.- Expressions like $A^2 - 3A$: just compute $A^2$ directly, then multiply $A$ by $3$ and subtract entry by entry.
Always verify the pattern on one extra power (e.g. check $A^3 = A^2 \cdot A$) before generalizing.
If $f(x) = a_k x^k + \dots + a_1 x + a_0$ is a polynomial and $A$ is a square matrix, then $f(A)$ is defined by replacing $x$ with $A$ and — very important — replacing the constant term $a_0$ with $a_0 I$:$$f(x) = x^2 - 3x + 2 \quad\Longrightarrow\quad f(A) = A^2 - 3A + 2I.$$
Why $2I$ and not just the number $2$? Because every term of the sum must be a matrix of the same size; the constant $a_0$ corresponds to $a_0 x^0 = a_0 \cdot 1$, and the matrix analogue of $1$ is the identity matrix $I$.
Computation plan: first find $A^2$ by the row-by-column rule, then $3A$ by scalar multiplication, then $2I = \begin{bmatrix}2&0\\0&2\end{bmatrix}$, and finally combine everything entry by entry. Forgetting the $I$ in the constant term is the classic trap in these problems.
The determinant of a $2 \times 2$ matrix is the number$$\det A = \begin{vmatrix}a&b\\c&d\end{vmatrix} = ad - bc$$— the product of the main diagonal minus the product of the secondary diagonal.
The entries may be any expressions, and the rule stays the same:- Trigonometric: $\begin{vmatrix}\cos x&-\sin x\\\sin x&\cos x\end{vmatrix} = \cos^2 x + \sin^2 x = 1.$- With the imaginary unit: $\begin{vmatrix}1&i\\i&1\end{vmatrix} = 1 - i^2 = 1-(-1) = 2.$- Exponential: $\begin{vmatrix}e^{2x}&e^{3x}\\e^{3x}&e^{4x}\end{vmatrix} = e^{2x}e^{4x} - e^{3x}e^{3x} = e^{6x} - e^{6x} = 0.$- With a parameter: $\begin{vmatrix}t&2\\3&t-1\end{vmatrix} = t(t-1) - 6 = t^2 - t - 6$ — then solve the resulting equation for $t$.
After expanding, always simplify using identities ($\sin^2 x + \cos^2 x = 1$, $i^2 = -1$, laws of exponents).
Cofactor expansion along the first row reduces a $3 \times 3$ determinant to three $2 \times 2$ determinants:$$\begin{vmatrix}a_{11}&a_{12}&a_{13}\\a_{21}&a_{22}&a_{23}\\a_{31}&a_{32}&a_{33}\end{vmatrix} = a_{11}\begin{vmatrix}a_{22}&a_{23}\\a_{32}&a_{33}\end{vmatrix} - a_{12}\begin{vmatrix}a_{21}&a_{23}\\a_{31}&a_{33}\end{vmatrix} + a_{13}\begin{vmatrix}a_{21}&a_{22}\\a_{31}&a_{32}\end{vmatrix}.$$The signs follow the checkerboard $+,-,+$; the sign of the position $(i,j)$ is $(-1)^{i+j}$. You may expand along any row or column — choose the one with the most zeros.
Sarrus rule (only for $3 \times 3$): copy the first two columns to the right, then add the three products of the diagonals going down-right and subtract the three products going up-right:$$\det A = a_{11}a_{22}a_{33} + a_{12}a_{23}a_{31} + a_{13}a_{21}a_{32} - a_{13}a_{22}a_{31} - a_{11}a_{23}a_{32} - a_{12}a_{21}a_{33}.$$Both methods always give the same answer; use whichever is faster for the given entries.
These properties turn ugly determinants into easy ones:1. $\det(A^T) = \det A$ — every row property is also a column property.2. Swapping two rows (or columns) changes the sign of the determinant.3. If two rows (or columns) are equal or proportional, the determinant is $0$.4. A common factor of one row can be taken outside: multiplying one row by $k$ multiplies the determinant by $k$. Hence for an $n \times n$ matrix $\det(kA) = k^n \det A$.5. Adding a multiple of one row to another row does not change the determinant. This is the main computational trick.6. $\det(AB) = \det A \cdot \det B$, and $\det I = 1$; therefore $\det(A^n) = (\det A)^n$.
Classic YÖS application of property 5 — subtract a column from another before multiplying big numbers:$$\begin{vmatrix}1995&1999\\1991&1995\end{vmatrix} = \begin{vmatrix}1995&1999-1995\\1991&1995-1991\end{vmatrix} = \begin{vmatrix}1995&4\\1991&4\end{vmatrix} = 4(1995-1991) = 16.$$And by property 3, a $3 \times 3$ determinant whose second row is, say, twice its first row is $0$ immediately — no expansion needed.
The inverse of a square matrix $A$ is the matrix $A^{-1}$ satisfying$$A \cdot A^{-1} = A^{-1} \cdot A = I.$$It exists if and only if $\det A \neq 0$. If $\det A = 0$, the matrix is called singular (non-invertible) — this is exactly the condition used in problems asking for which parameter value a matrix has no inverse.
For a $2 \times 2$ matrix there is a ready formula:$$A = \begin{bmatrix}a&b\\c&d\end{bmatrix} \quad\Longrightarrow\quad A^{-1} = \frac{1}{ad-bc}\begin{bmatrix}d&-b\\-c&a\end{bmatrix}.$$Recipe: swap the diagonal entries $a$ and $d$, change the signs of $b$ and $c$, divide by the determinant.
Useful facts: $(A^{-1})^{-1} = A$, $(AB)^{-1} = B^{-1}A^{-1}$ (reversed order), $\det(A^{-1}) = \dfrac{1}{\det A}$.
Quick check: multiply your $A^{-1}$ by $A$ — you must get $I$.
To solve an equation like $AB = C$ for the unknown matrix $B$, multiply both sides by $A^{-1}$ on the left:$$AB = C \;\Longrightarrow\; A^{-1}(AB) = A^{-1}C \;\Longrightarrow\; B = A^{-1}C.$$For $XA = C$ multiply on the right: $X = CA^{-1}$. The side matters because multiplication is not commutative — $A^{-1}C$ and $CA^{-1}$ are generally different!
If the unknown matrix is small, an alternative is to write $B = \begin{bmatrix}x&y\\z&t\end{bmatrix}$, multiply out, and equate entries.
Algebraic identities also work for matrices when only one matrix (and $I$) is involved, because $A$ commutes with itself and with $I$:$$(A-I)(A+I) = A^2 + AI - IA - I^2 = A^2 - I.$$Combined with $\det(XY) = \det X \cdot \det Y$ this gives the frequently tested identity$$\det\big((A-I)(A+I)\big) = \det(A-I)\cdot\det(A+I) = \det(A^2 - I).$$But beware: $(A+B)^2 = A^2 + AB + BA + B^2$, which is NOT $A^2 + 2AB + B^2$ unless $AB = BA$.
Problem. Given $A=\begin{bmatrix}3&-2\\4&-1\end{bmatrix}$ and $B=\begin{bmatrix}-1&-1\\0&2\end{bmatrix}$, find $C = A - 2B$ and then $CB$.
Step 1. Compute $2B$ by multiplying every entry by $2$:$$2B = \begin{bmatrix}-2&-2\\0&4\end{bmatrix}.$$
Step 2. Subtract entry by entry:$$C = A - 2B = \begin{bmatrix}3-(-2)&-2-(-2)\\4-0&-1-4\end{bmatrix} = \begin{bmatrix}5&0\\4&-5\end{bmatrix}.$$
Step 3. Multiply $C$ by $B$ using the row-by-column rule:$$CB = \begin{bmatrix}5&0\\4&-5\end{bmatrix}\begin{bmatrix}-1&-1\\0&2\end{bmatrix} = \begin{bmatrix}5\cdot(-1)+0\cdot0 & 5\cdot(-1)+0\cdot2\\ 4\cdot(-1)+(-5)\cdot0 & 4\cdot(-1)+(-5)\cdot2\end{bmatrix} = \begin{bmatrix}-5&-5\\-4&-14\end{bmatrix}.$$
Answer: $C = \begin{bmatrix}5&0\\4&-5\end{bmatrix}$, $CB = \begin{bmatrix}-5&-5\\-4&-14\end{bmatrix}$.
Problem. For $A = \begin{bmatrix}1&-1\\0&1\end{bmatrix}$ find $A^{32}$.
Step 1. Compute the first powers:$$A^2 = \begin{bmatrix}1&-1\\0&1\end{bmatrix}\begin{bmatrix}1&-1\\0&1\end{bmatrix} = \begin{bmatrix}1&-2\\0&1\end{bmatrix}, \qquad A^3 = A^2 \cdot A = \begin{bmatrix}1&-3\\0&1\end{bmatrix}.$$
Step 2. Spot the pattern: only the top-right entry changes, and it equals $-n$:$$A^n = \begin{bmatrix}1&-n\\0&1\end{bmatrix}.$$Check by induction: $A^{n+1} = A^n \cdot A = \begin{bmatrix}1&-n\\0&1\end{bmatrix}\begin{bmatrix}1&-1\\0&1\end{bmatrix} = \begin{bmatrix}1&-(n+1)\\0&1\end{bmatrix}$ — the pattern holds.
Step 3. Substitute $n = 32$:$$A^{32} = \begin{bmatrix}1&-32\\0&1\end{bmatrix}.$$
Answer: $A^{32} = \begin{bmatrix}1&-32\\0&1\end{bmatrix}$.
Problem. Let $f(x) = x^2 - 3x + 2$ and $A = \begin{bmatrix}2&1\\0&1\end{bmatrix}$. Find $f(A)$.
Step 1. Write the matrix version of the polynomial (the constant becomes $2I$):$$f(A) = A^2 - 3A + 2I.$$
Step 2. Compute $A^2$:$$A^2 = \begin{bmatrix}2&1\\0&1\end{bmatrix}\begin{bmatrix}2&1\\0&1\end{bmatrix} = \begin{bmatrix}2\cdot2+1\cdot0 & 2\cdot1+1\cdot1\\ 0&1\end{bmatrix} = \begin{bmatrix}4&3\\0&1\end{bmatrix}.$$
Step 3. Compute $3A$ and $2I$:$$3A = \begin{bmatrix}6&3\\0&3\end{bmatrix}, \qquad 2I = \begin{bmatrix}2&0\\0&2\end{bmatrix}.$$
Step 4. Combine entry by entry:$$f(A) = \begin{bmatrix}4-6+2 & 3-3+0\\ 0-0+0 & 1-3+2\end{bmatrix} = \begin{bmatrix}0&0\\0&0\end{bmatrix} = O.$$
Answer: $f(A) = O$ (the zero matrix). This is no accident: $f(x) = (x-1)(x-2)$, and the diagonal entries of the triangular matrix $A$ are exactly $2$ and $1$, so $(A-I)(A-2I) = O$.
All course topics · Practice problems
Please enable JavaScript to use the practice app.