Matrices & Linear Transformations
Bachelor in Computer Science and Artificial Intelligence (BCSAI) · IE University · a complete, syllabus-driven outline of the course, mapped to the interactive demos in this lab.
Matrices and linear transformations are part of linear algebra, a fundamental area of mathematics that provides powerful tools applied across computer science, business, physics, economics and engineering. In this field, concepts matter as much as computations: in practice computers handle the arithmetic, but you must choose the algorithm, interpret the results, and explain the conclusions.
The course revisits the foundations of vectors and matrices through extensive, applied practice rather than fully rigorous theory. More than anything, it aims to develop your mathematical intuition so that by the end you can abstract concepts of linear algebra, find the right algorithmic solution, write your own code, and compute answers to real problems.
Learning objectives
At the end of this course, you should be able to:
- Demonstrate knowledge and understanding of concepts related to vectors and their representation in the plane and in space.
- Show proficiency in solving linear systems of equations.
- Know the basic properties of vector spaces and operators between vector spaces.
- Perform matrix computations and use matrix operations to efficiently solve linear systems and determine the inverse of a matrix.
- Demonstrate proficiency in using the Gram–Schmidt process to construct an orthonormal basis.
- Show proficiency in applying the properties of determinants in solving related problems.
- Demonstrate proficiency in finding eigenvalues and eigenvectors of a matrix, and in determining whether a matrix is diagonalizable.
- Demonstrate understanding of the concept of a linear transformation and show proficiency in solving problems involving linear transformations.
- Analyze applications of linear algebra — finding the algorithmic solution to apply, writing your own code, and computing the result.
Methodology & assessment
IE University's teaching method is collaborative, active and applied. The professor leads and guides students through a diverse range of techniques; the workload (150 h, 6 ECTS) breaks down as follows.
Learning activity weighting
Assessment criteria
You need at least 3.5 / 10 on the final exam to pass the course overall. An 80% attendance rule applies. Note: GenAI use is not permitted for assessments in this course.
Assessment components in detail
Deliverable: sustained, active engagement during live sessions — contributing to discussions, asking questions, offering relevant remarks, and taking part in class exercises and group challenges.
Evaluated on: not just the frequency of contributions, but the quality and relevance of participation in class activities.
Deliverable: in assigned groups, an in-depth study of one Linear Algebra application chosen from the program's modules, presented to the class (Session 28).
Evaluated on: the submitted work graded after the deadline; one overall "Group Work" grade per group.
Deliverable: exercise assignments throughout the course (similar to those worked in class) together with the midterm exam (Session 15). Reported as "Individual work".
Evaluated on: correctness and method on assignments and the midterm covering Modules 1–3.
Deliverable: a comprehensive in-person final exam (Session 30) spanning the whole course. Detailed characteristics announced at the start of the semester.
Evaluated on: you must score at least 3.5 / 10 on this exam to pass the course overall — even if the other components would otherwise be passing.
Pass, attendance & re-sit rules
- Attendance: students who do not meet the 80% attendance rule fail both the ordinary and extraordinary calls for the year and must re-enrol (re-take) the next academic year.
- Minimum on final: a score of at least 3.5 / 10 on the final exam is required to pass the course overall.
- Calls: each student has four chances to pass a course over two consecutive academic years — ordinary and extraordinary (June/July re-sit) calls.
- Re-sit: the June/July re-sit is a single comprehensive exam (continuous evaluation is not counted); pass mark 5, capped at 8.0 ("notable"). Re-sits require physical presence on campus (Segovia or Madrid).
- Retakers: the maximum grade in a 3rd-call retake exam is 10.0; retakers must check the assigned professor's criteria. Failing more than 18 ECTS in a year after re-sits means leaving the program.
- GenAI: use of generative AI is not permitted for any assessment; AI-generated content is treated as academic misconduct and may fail the assignment or course.
Program — 30 sessions across 7 modules
Every session is live in-person. Topic bullets follow the syllabus; accent tags link to the matching interactive demo, grey tags flag key readings (Strang / Anton).
The course opens with the two basic objects of linear algebra. A vector packages several numbers into a single geometric arrow with length and direction; a matrix packages numbers into a rectangular array that both stores data and acts as an operator on vectors. Mastering their arithmetic — linear combinations, dot products, transpose, inverse and multiplication — is the toolkit every later module depends on.
- Represent vectors in the plane and in space and form linear combinations.
- Compute length, dot product, unit vectors, Minkowski distances and cosine similarity.
- Classify matrices and compute transpose, inverse and matrix products.
- Recognize when a faster multiplication scheme (Strassen) reduces the operation count.
Build geometric and algebraic intuition for vectors, linear combinations and the notions of length and similarity that underpin the rest of the course.
- Introduction to vectors — an ordered list of numbers seen as an arrow from the origin.
- Vectors and linear combination — scaling and adding vectors: $c\mathbf{u}+d\mathbf{v}$ sweeps out lines and planes.
- Length, dot product and unit vectors — the dot product measures alignment; dividing by length gives a unit vector.
- Minkowski distances — a family of distances $\big(\sum_i |x_i-y_i|^p\big)^{1/p}$ generalizing Manhattan ($p=1$) and Euclidean ($p=2$).
- Cosine similarity — compares direction regardless of magnitude, central to text and recommendation systems.
- Vectors applications
Define matrices, their types and key properties, and master the algebra of transpose, inverse and multiplication — including a fast-multiplication algorithm.
- Matrix definition — an $m\times n$ array of numbers; rows index outputs, columns index inputs.
- Types and properties of matrices — square, diagonal, identity, symmetric, triangular.
- Transpose and inverse of a matrix — $A^\top$ flips rows and columns; $A^{-1}$ undoes $A$ when it exists.
- Matrix multiplication — row-times-column combination; not commutative in general.
- Strassen algorithm — multiplies $2\times2$ blocks with 7 products instead of 8, giving $O(n^{2.81})$.
- Matrices exercises
Consolidate Module 1 by reviewing the key ideas and working through applied vector and matrix problems.
- Practice: review of key ideas
- Vectors and matrices applications — similarity search, image transforms and data tables as matrices.
The central computational problem of linear algebra is solving $A\mathbf{x}=\mathbf{b}$. This module develops the systematic engine — Gaussian elimination — and reinterprets it as a matrix factorization $A=LU$. It then turns to the practical realities of computing: round-off error, pivoting for stability, iterative methods for very large systems, and a tour of real applications from chemistry to GPS.
- Read a linear system in row, column and matrix form and solve it by elimination.
- Reduce a matrix to REF and RREF using elimination and permutation matrices.
- Factor $A=LU$ (and $PA=LU$) and estimate the cost of the algorithm.
- Compute $A^{-1}$ by Gauss–Jordan and apply pivoting to control numerical error.
- Use Jacobi and Gauss–Seidel iterations and model real systems as $A\mathbf{x}=\mathbf{b}$.
See linear systems three ways — by row, by column and as a matrix — and grasp the central idea behind Gaussian elimination.
- Linear equations ($n$ equations, $n$ unknowns)
- Row picture and column picture in 2D and 3D — rows are intersecting lines/planes; columns combine to reach $\mathbf{b}$.
- Matrix picture — the whole system collapses into $A\mathbf{x}=\mathbf{b}$.
- The idea of Gauss elimination — subtract multiples of rows to reach an upper-triangular system, then back-substitute.
Carry out elimination with elementary matrices, handle row swaps, and reduce a system to row-echelon and reduced row-echelon form.
- Gauss elimination using matrices
- Elimination matrix — a matrix $E$ that performs one row operation when it multiplies $A$.
- Permutation matrix — $P$ swaps rows; it is the identity with reordered rows.
- Row Echelon Form (REF) — staircase of leading entries, zeros below each pivot.
- Gauss–Jordan elimination
- Row Reduced Echelon Form (RREF) — pivots equal 1 with zeros above and below.
Express elimination as a factorization of $A$ and analyze its computational cost.
- Factorization $A=LU$ — $L$ stores the elimination multipliers, $U$ is the echelon result.
- Factorization $A=LDU$ — pull the pivots out into a diagonal $D$.
- Factorization $PA=LU$ — add a permutation when row swaps are needed.
- Computational cost of $A=LU$ — about $\tfrac13 n^3$ operations for an $n\times n$ matrix.
Apply elimination to model and solve concrete problems from chemistry, economics and engineering.
- Practice
- Application: balancing chemistry equations — conservation of atoms becomes a linear system.
- Application: Leontief input–output model — economic output solving $(I-A)\mathbf{x}=\mathbf{d}$.
- Application: electric circuits — Kirchhoff's laws give linear equations for currents.
Compute the inverse via Gauss–Jordan, understand round-off error and partial pivoting, and apply it to network flow.
- Gauss–Jordan inverse of $A$ — reduce $[\,A\mid I\,]$ to $[\,I\mid A^{-1}\,]$.
- Round-off error — finite-precision arithmetic accumulates small errors.
- Partial pivoting — swap in the largest available pivot to keep multipliers small and stable.
- Network flow application
Solve large systems iteratively and explore further applications of linear systems.
- Jacobi numerical method — update every unknown from the previous full iterate.
- Gauss–Seidel numerical method — reuse freshly updated values immediately; usually faster.
- Finite linear games
- GPS calculation — position from satellite distances solved as a linear system.
This module lifts the focus from individual equations to the structure of all solutions. A vector space is a set closed under addition and scaling; the subspaces attached to a matrix — column space, null space, row space and left null space — explain exactly when $A\mathbf{x}=\mathbf{b}$ has a solution and how many. Strang's "four fundamental subspaces" picture ties everything together and leads into the midterm.
- Decide whether a set is a vector space or subspace and find its span, basis and rank.
- Test vectors for linear independence and build a basis of minimal size.
- Describe the column space and null space and use them to solve $A\mathbf{x}=\mathbf{b}$ completely.
- Identify all four fundamental subspaces and their dimensions from the rank.
Introduce vector spaces and subspaces, identify pivots, and connect the column space and null space to solving $A\mathbf{x}=\mathbf{b}$ and $A\mathbf{x}=\mathbf{0}$.
- Vector spaces and subspaces — sets closed under addition and scalar multiplication, containing $\mathbf{0}$.
- Span, basis and rank — a basis is a smallest spanning set; its size is the dimension.
- Echelon form and pivots — pivot columns mark the independent directions.
- Reduced row echelon form
- Column space of $A$: solving $A\mathbf{x}=\mathbf{b}$ — solvable iff $\mathbf{b}$ lies in the column space.
- Nullspace of $A$: solving $A\mathbf{x}=\mathbf{0}$ — all vectors $A$ sends to zero.
Measure subspace dimension and assemble the complete picture of the four fundamental subspaces.
- Subspace dimension — the number of vectors in any basis.
- Complete solution of $A\mathbf{x}=\mathbf{b}$ — one particular solution plus the whole null space.
- Row space of $A$ — spanned by the rows; has the same dimension $r$ as the column space.
- Nullspace of $A^\top$ — the left null space, dimension $m-r$.
- The four fundamental subspaces picture
Test vectors for independence, build a basis for a subspace, and describe the full solution set of a system.
- Independence of vectors — no vector is a combination of the others; $c_1\mathbf{v}_1+\dots+c_k\mathbf{v}_k=\mathbf{0}$ forces all $c_i=0$.
- Basis of subspaces
- Complete solution of $A\mathbf{x}=\mathbf{b}$
Review subspaces and the four fundamental subspaces through worked problems and short questions.
- Subspaces
- Four fundamental subspaces
- Complete solution of $A\mathbf{x}=\mathbf{b}$
- Short questions
Consolidate Modules 1–3 in preparation for the midterm exam.
- Midterm review — vectors, matrices, elimination, $LU$, and the vector-space picture.
Assessed exam covering vectors, matrices, linear systems and vector spaces (counts toward individual work).
- Midterm exam
Orthogonality — vectors meeting at right angles — is what makes linear algebra computable and stable. Projecting a vector onto a subspace gives the closest point in it, which is exactly how least squares fits a model to noisy data. The Gram–Schmidt process turns any basis into an orthonormal one, yielding orthogonal matrices $Q$ and the $A=QR$ factorization used throughout numerical computing.
- Test vectors and subspaces for orthogonality and use the orthogonality of the four subspaces.
- Project a vector onto a line or subspace and solve least-squares problems.
- Run Gram–Schmidt to produce an orthonormal basis.
- Build an orthogonal matrix $Q$ and compute the $A=QR$ decomposition.
Work with orthogonal vectors and subspaces, project onto a subspace, and solve overdetermined systems by least squares.
- Orthogonal vectors — $\mathbf{u}\cdot\mathbf{v}=0$ means a right angle.
- Orthogonal subspaces
- Orthogonality of the four fundamental subspaces
- Projections — the closest point in a subspace to a given vector.
- Least squares — the best solution when $A\mathbf{x}=\mathbf{b}$ has no exact answer.
Construct orthonormal bases with the Gram–Schmidt process, recognize orthogonal matrices, and derive the QR decomposition.
- Orthonormal bases — mutually perpendicular unit vectors.
- Orthogonal matrix $Q$ — columns orthonormal, so $Q^\top Q=I$ and $Q^{-1}=Q^\top$.
- Gram–Schmidt — subtract off projections onto earlier vectors, then normalize.
- QR decomposition
Apply orthogonality techniques to fit equations and orthonormalize bases in worked problems.
- Practice
- Least squares for different equations — fitting lines, parabolas and other models to data.
- Gram–Schmidt
- QR decomposition
The determinant is a single number that captures whether a matrix is invertible and how it scales area and volume. From its three defining properties flow cofactor expansions, Cramer's rule, an explicit inverse formula, and geometric applications — even a classic encryption scheme, the Hill cipher.
- State the properties of the determinant and compute it by cofactors and condensed methods.
- Use the cross product and relate the determinant to area and volume.
- Find $A^{-1}$ from cofactors and solve systems with Cramer's rule.
- Apply determinants in a worked application such as the Hill cipher.
Establish the defining properties of the determinant and compute it via cofactors and condensed methods, with a cross-product application.
- Determinant properties — $\det I=1$, sign flips on a row swap, linear in each row.
- Formula of the determinant
- Cofactors — expand along a row/column using signed minors.
- Cross product application — $\mathbf{u}\times\mathbf{v}$ as a symbolic $3\times3$ determinant.
- Condensed method for determinants
Use the determinant to invert matrices, solve systems with Cramer's rule, measure areas and volumes, and encrypt with the Hill cipher.
- Formula for the inverse of $A$ — via the adjugate (matrix of cofactors).
- Cramer's rule — each unknown as a ratio of determinants.
- Areas — $|\det|$ of two column vectors is the area of the parallelogram they span.
- Volumes
- Application: Hill cipher — encrypt by multiplying blocks by an invertible matrix mod 26.
Eigenvectors are the special directions a matrix merely stretches without rotating; the stretch factors are the eigenvalues. They reveal a matrix's deepest structure — letting us diagonalize it, raise it to powers cheaply, and predict the long-run behaviour of dynamic systems. The module culminates in symmetric matrices, the SVD, and its data-science crown jewel, principal component analysis.
- Find eigenvalues and eigenvectors and determine whether a matrix is diagonalizable.
- Use diagonalization to compute matrix powers and solve recurrences.
- Analyze Markov chains and systems of differential equations via eigenvalues.
- Apply the spectral theorem for symmetric matrices and compute the SVD and PCA.
Introduce eigenvalues and eigenvectors, diagonalize a matrix, and use diagonalization to compute matrix powers.
- Introduction to eigenvalues and eigenvectors — directions fixed up to scaling by $A$.
- Diagonalizing a matrix — $A=S\Lambda S^{-1}$ when there are enough independent eigenvectors.
- Matrix powers via diagonalization — $A^k=S\Lambda^k S^{-1}$.
Apply eigen-analysis to recurrences, Markov chains and systems of differential equations.
- Fibonacci sequence — a recurrence whose growth rate is an eigenvalue (the golden ratio).
- Markov matrices — columns sum to 1; $\lambda=1$ gives the steady state.
- Differential equations — $\tfrac{d\mathbf{u}}{dt}=A\mathbf{u}$ solved by $e^{\lambda t}$ along eigenvectors.
Apply the module's tools in a collaborative team problem-solving competition.
- Math challenge: team competition — timed eigenvalue and diagonalization problems solved in groups.
Study symmetric matrices and their spectral structure, then introduce the singular value decomposition.
- Symmetric matrices — real eigenvalues and orthogonal eigenvectors (spectral theorem).
- Singular Value Decomposition (SVD) — factor any matrix into rotation · scaling · rotation.
Apply the SVD and connect it to principal component analysis for dimensionality reduction.
- Practice
- Singular Value Decomposition (SVD)
- Principal Component Analysis (PCA) — eigenvectors of the covariance matrix as directions of maximum variance.
The course closes by returning to the idea that quietly underlies everything: a matrix is a linear transformation. This module makes the correspondence explicit — every linear map between vector spaces is represented by a matrix once bases are chosen, composition of maps is matrix multiplication, and inverses match. It ends with student application presentations and a comprehensive review before the final exam.
- Verify whether a map is linear and find its matrix in given bases.
- Compose transformations and relate composition to matrix multiplication.
- Determine when a transformation is invertible and find its inverse.
- Synthesize the whole course to analyze and present a real linear-algebra application.
Formalize linear transformations, represent them by matrices, and study their inverses and composition.
- Linear transformations — maps preserving addition and scaling.
- Matrix of a linear transformation — columns are the images of the basis vectors.
- Inverse of a transformation — exists iff the matrix is invertible.
- Composition of linear transformations — doing one map then another multiplies their matrices.
Review the key ideas of linear transformations through applied problems.
- Practice: review of key ideas, linear transformations — building matrices for rotations, projections and shears.
Groups present a chosen application of linear algebra drawn from the modules of the program.
- Presentation of linear algebra applications by students — the assessed deliverable for the 30% group-work component.
Comprehensive review across the whole course in preparation for the final exam.
- Vectors and matrices · solving linear equations · vector spaces
- Orthogonality · determinants · eigenvalues · linear transformations
Comprehensive final exam — worth 30% of the grade, with a minimum score of 3.5 / 10 required to pass the course.
- Final exam — comprehensive, in-person; covers all seven modules.
Key concepts
A quick-reference glossary of the core terms running through the course, each with a one- or two-line working definition.
- Vector
- An ordered list of numbers, pictured as an arrow with length and direction in $\mathbb{R}^n$.
- Linear combination
- A sum of scaled vectors $c_1\mathbf{v}_1+\dots+c_k\mathbf{v}_k$; the set of all such sums is their span.
- Dot product
- $\mathbf{u}\cdot\mathbf{v}=\sum_i u_i v_i$; zero means orthogonal, and it encodes the angle between vectors.
- Norm (length)
- $\lVert\mathbf{v}\rVert=\sqrt{\mathbf{v}\cdot\mathbf{v}}$; a unit vector has norm 1.
- Cosine similarity
- $\cos\theta=\dfrac{\mathbf{u}\cdot\mathbf{v}}{\lVert\mathbf{u}\rVert\lVert\mathbf{v}\rVert}$; compares direction independent of magnitude.
- Matrix
- An $m\times n$ array of numbers that stores data and acts as a linear operator on vectors.
- Transpose
- $A^\top$ exchanges rows and columns; $(AB)^\top=B^\top A^\top$.
- Inverse
- The matrix $A^{-1}$ with $AA^{-1}=I$; it exists exactly when $\det A\neq 0$.
- Gaussian elimination
- Systematic row operations reducing $A\mathbf{x}=\mathbf{b}$ to triangular form for back-substitution.
- Pivot
- The first nonzero entry in a row of echelon form; the number of pivots is the rank.
- RREF
- Reduced row echelon form: pivots equal 1 with zeros above and below them.
- LU factorization
- $A=LU$, a lower-triangular $L$ times upper-triangular $U$; $PA=LU$ when row swaps are needed.
- Vector space
- A set closed under addition and scalar multiplication that contains the zero vector.
- Subspace
- A vector space sitting inside a larger one, e.g. a line or plane through the origin.
- Basis & dimension
- A smallest set of independent vectors that spans a space; its size is the dimension.
- Rank
- The number of independent columns (= pivots); it fixes all four subspace dimensions.
- Column space / null space
- $C(A)$ is all outputs $A\mathbf{x}$; $N(A)$ is all $\mathbf{x}$ with $A\mathbf{x}=\mathbf{0}$.
- Orthogonality
- A right-angle relation, $\mathbf{u}\cdot\mathbf{v}=0$; orthonormal vectors are also unit length.
- Projection
- The closest point of a subspace to a given vector; the engine behind least squares.
- Least squares
- The best approximate solution of an unsolvable system, via $A^\top A\hat{\mathbf{x}}=A^\top\mathbf{b}$.
- Gram–Schmidt
- Turns a basis into an orthonormal one by removing projections onto earlier vectors.
- QR decomposition
- $A=QR$ with $Q$ orthogonal and $R$ upper-triangular; a stable route to least squares.
- Determinant
- A scalar $\det A$ giving the volume-scaling factor; $\det A=0$ means singular.
- Eigenvalue / eigenvector
- Solutions of $A\mathbf{v}=\lambda\mathbf{v}$: directions $\mathbf{v}$ that $A$ only scales by $\lambda$.
- Diagonalization
- $A=S\Lambda S^{-1}$ using eigenvectors; makes powers $A^k=S\Lambda^k S^{-1}$ easy.
- SVD
- $A=U\Sigma V^\top$, factoring any matrix into rotation, scaling and rotation.
- PCA
- Dimensionality reduction along the top singular directions of the data — directions of maximum variance.
- Linear transformation
- A map preserving addition and scaling; once a basis is fixed it is a matrix.
Bibliography
Recommended texts for the course, annotated with how each one supports the program.