Matrices in simple words
A matrix is a grid of numbers in rows (across) and columns (down). A 2 × 2 matrix has 2 rows and 2 columns, such as [1, 2; 3, 4].
To add two matrices of the same size, add the numbers in the same spot: [1, 2; 3, 4] + [5, 6; 7, 8] = [6, 8; 10, 12].
To multiply A × B, take a row of A and a column of B, multiply the matching numbers and add them up. For the top-left entry of [1, 2; 3, 4] × [5, 6; 7, 8]: 1 × 5 + 2 × 7 = 19.
The determinant is one number worked out from a square matrix. For [a, b; c, d] it is a × d − b × c, so for [1, 2; 3, 4] it is 4 − 6 = −2. If it is 0, the matrix has no inverse.
Formula and method
For A × B, each output entry is a row-column dot product. A’s column count must match B’s row count; addition requires identical dimensions.
Worked example
Multiplying [[1, 2], [3, 4]] by [[5, 6], [7, 8]] gives [[19, 22], [43, 50]].
Determinant, inverse, rank and powers
A 2 × 2 determinant is ad − bc: det [[1, 2], [3, 4]] = 1 × 4 − 2 × 3 = −2. A 3 × 3 expands along the first row, a(ei − fh) − b(di − fg) + c(dh − eg), and larger matrices are row-reduced: the determinant is the product of the pivots, with the sign flipped once for each row swap.
A matrix has an inverse only when its determinant is not zero. For 2 × 2, A⁻¹ = (1/det) × [[d, −b], [−c, a]], so [[4, 7], [2, 6]] has det 10 and inverse 1/10 × [[6, −7], [−2, 4]] = [[3/5, −7/10], [−1/5, 2/5]]. Larger matrices use Gauss–Jordan elimination on [A | I], shown column by column, and the result is checked by A × A⁻¹ = I.
Rank counts the pivots left after row reduction: [[1, 2], [2, 4]] has rank 1 because the second row is twice the first. Aⁿ multiplies A by itself n times (A⁰ is the identity), which is not the same as raising each entry to the power n. All of these use exact fractions, so 1/3 stays 1/3 instead of 0.333333.