NapkinCalc

Linear Algebra — Matrices

Solving systems — Cramer’s rule

continues from lesson 2 — values defined earlier in the course stay live here

The Algebra 1 system 2x + y = 8, x − y = 1 in matrix form is A·[x, y] = [8, 1]. Cramer's rule solves it with determinants alone: replace a column with the right-hand side, divide the dets:

Am:=[2,1;1,1]A_{m} := [2, 1; 1, -1] = [[2,1],[1,1]][[2, 1], [1, -1]] coefficient matrix
dA=det(Am)d_{A} = \mathrm{det}\left(A_{m}\right) = 3-3 must be nonzero — else no unique solution
xc:=det([8,1;1,1])/dAx_{c} := det([8, 1; 1, -1]) / d_{A} = 33 x: right side replaces column 1
yc:=det([2,8;1,1])/dAy_{c} := det([2, 8; 1, 1]) / d_{A} = 22 y: right side replaces column 2
✓ pass abs(xc3)<1e9andabs(yc2)<1e9abs(x_{c} - 3) < 1e-9 and abs(y_{c} - 2) < 1e-9 same (3, 2) Algebra 1 found by elimination

Same answer, zero algebra — and unlike elimination, this scales to systems with thousands of unknowns (with better algorithms than Cramer, but the same idea: systems are matrix equations).