ROB-GY 6013 · Mathematics for Robotics · Fall 2026
Version 1 · 2026-10-04
Different books write the same mathematics differently. This page fixes what the symbols mean here, so that a derivation you follow in one lecture still reads the same way in the next one and in your homework. Where a source uses another convention, the lecture says so and gives the bridge rather than quietly switching.
A convention is not a theorem. None of the choices below changes what is true; they change what you have to check when two pieces of work are put side by side. The last section lists the places where this course deliberately keeps a second name for one object, and what the mapping is.
A real vector is a column. So is a gradient. If something is a row, the page says so and writes the transpose.
| symbol | meaning | shape |
|---|---|---|
| $x$ | an input, a point, a parameter vector | $n\times1$ |
| $A$ | a matrix acting on columns: $y=Ax$ | $m\times n$ |
| $A^{\mathsf T}$ | transpose | $n\times m$ |
| $A^{-1}$ | inverse, only when $A$ is square and invertible | $n\times n$ |
| $A^{+}$ | pseudoinverse: $A^{+}b$ is the minimum-norm least-squares solution, and $A^{+}=A^{-1}$ when $A$ is invertible | $n\times m$ |
| $\operatorname{Col}(A)$ | column space, what $Ax$ can reach | a subspace of $\mathbb R^{m}$ |
| $\operatorname{Null}(A)$ | null space, what $A$ sends to zero | a subspace of $\mathbb R^{n}$ |
Transpose, inverse and pseudoinverse are three different objects. $A^{\mathsf T}$ always exists and $A^{-1}$ usually does not. $A^{+}$ always exists: it returns the least-squares solution of smallest norm, and it agrees with $A^{-1}$ whenever the inverse exists.
For $f:\mathbb R^{n}\to\mathbb R^{m}$ the Jacobian is
$$J_f\in\mathbb R^{m\times n},\qquad (J_f)_{ij}=\frac{\partial f_i}{\partial x_j}.$$One row per output, one column per input. Row $i$ says how output $i$ responds to every input; column $j$ says how input $j$ moves every output. The shape is the same statement: $J_f$ maps an input increment to an output increment, so it must be $m\times n$.
The robot Jacobian is this object with particular names. With joint angles $q$ and a tip position $p=f(q)$, $J$ is $\partial p/\partial q$ — the same rule with $q$ in place of $x$ and $p$ in place of $y$. A book may instead give a spatial or body Jacobian, which stacks angular velocity with linear velocity and is a larger object than the position-only one used here.
A scalar function of a vector has two standard arrangements of the same numbers, and this course uses both — named, and in the open.
$$\nabla_x L\in\mathbb R^{n\times1}\quad\text{the gradient, a column}, \qquad \frac{\partial L}{\partial x}=(\nabla_x L)^{\mathsf T}\in\mathbb R^{1\times n}\quad\text{the derivative, a row}.$$The row is what the chain rule multiplies, because $\partial L/\partial x$ composes as $(\partial L/\partial y)(\partial y/\partial x)$. The column is what you add to a parameter, what a picture draws as an arrow, and what code stores beside the parameter it belongs to.
For a matrix parameter the shape rule wins. $\nabla_W L$ is defined by
$$dL=\operatorname{tr}\!\big((\nabla_W L)^{\mathsf T}\,dW\big),$$which makes $\nabla_W L$ the same shape as $W$ — one number per weight, sitting where that weight sits. The row convention is not imposed on matrix derivatives.
These two statements look alike and are not the same:
$$dL=(\nabla_x L)^{\mathsf T}dx \qquad\text{exact, by definition of the differential}$$ $$L(x+\Delta x)-L(x)=(\nabla_x L)^{\mathsf T}\Delta x+o(\lVert\Delta x\rVert)\qquad\text{at a differentiable point}$$The first is an identity about a linear model. The second is a statement about the function, and it carries a remainder that vanishes faster than $\lVert\Delta x\rVert$ and is in general not zero — it is identically zero exactly when the function is affine. Changing the symbol from $dx$ to $\Delta x$ is not what makes it an approximation; the curvature is.
A finite change is never written as an exact differential identity in this course. Where a page compares a predicted change with an actual one, the gap is the omitted higher-order term, and the page names it.
One sample. Inputs are columns and a weight matrix is output-by-input:
$$x\in\mathbb R^{n\times1},\quad W\in\mathbb R^{m\times n},\quad b\in\mathbb R^{m\times1}, \qquad z=Wx+b,\qquad a=\operatorname{ReLU}(z).$$A batch. Samples are rows, which is what array libraries and data files do, so the weight matrix appears transposed:
$$X\in\mathbb R^{B\times n},\qquad Z=XW^{\mathsf T}+\mathbf 1_B b^{\mathsf T}\in\mathbb R^{B\times m}.$$With $G=\nabla_Z L$, the same shape as $Z$:
$$\nabla_X L=GW,\qquad \nabla_W L=G^{\mathsf T}X,\qquad \nabla_b L=G^{\mathsf T}\mathbf 1_B.$$$G$ already carries the reduction. Whatever factor the loss applies — a sum, a mean over $B$, a mean over $Bm$ — is already inside $G$ by the time these three rules are used. Do not divide a second time.
Indices that count different things get different letters: $i$ for a sample, $j$ and $k$ for
coordinates, and a layer number as a subscript on the object ($W_1$, $z_1$, $a_1$), never as a free
index. A code name such as dX is the gradient an implementation stores, not a
differential $dX$; the lecture says which one it means.
| symbol | definition | where it is natural |
|---|---|---|
| $r$ | $r=\text{target}-\text{prediction}$, e.g. $r=b-Ax$ | least squares, projection, normal equations |
| $e$ | $e=\text{prediction}-\text{target}$, e.g. $e=Ax-b$ | losses and backpropagation, where $\partial L/\partial e$ is wanted |
Both appear because each makes its own chapter read naturally: the projection picture wants the vector that points from the prediction to the target, and a loss wants the quantity whose derivative flows backward. A gradient written with the wrong one is off by a sign, which is exactly the kind of error a sign convention is supposed to make visible rather than hide.
Lecture 5 writes the bridge where it switches. Lectures 1 to 4 use one of the two throughout and do not state the relation on the page, so when you carry a formula between them, convert it here first: the residual of the projection chapters and the error of the loss chapters are the same vector with opposite signs.
The target is named locally, and $y$ is used carefully: $y^\star$ or $b$ for a target, $y$ for an intermediate value $y=f(x)$, $\hat y$ for a prediction.
A loss is never written as "MSE" alone. Each one states its reduction and every factor:
$$\textstyle\sum_i \tfrac12 e_i^2,\qquad \frac1B\sum_i \tfrac12 e_i^2, \qquad \frac1{2B}\lVert e\rVert^2,\qquad \frac1{Bm}\sum_{i,j} e_{ij}^2 .$$Multiplying a loss by a positive constant does not move its minimiser, and does scale its gradient by the same constant. So a factor you drop changes every number in a gradient check while leaving the fitted answer alone.
One exception worth stating: in a regularised objective, rescaling only the data term changes the effective regularisation strength. Rescale both terms or neither.
The $\tfrac12$ in $\tfrac12\lVert e\rVert^2$ is there so the derivative comes out as $e$ rather than $2e$. A chapter that works with $\lVert e\rVert^2$ instead is not in conflict: it is the same problem with the same minimiser, and its gradient is twice as large. The earlier lectures state the objective but not that consequence, so check the factor before carrying a gradient out of one.
The same letter counts different things in different chapters. That is allowed; guessing is not. Read the role, not the letter.
| role | Lecture 4 (PCA, SVD) | Lecture 5 (networks) |
|---|---|---|
| number of samples | $N$ | $B$ (batch) |
| number of features of an input | $d$ | $n$ |
| number of outputs | — | $m$ |
| a general matrix $A\in\mathbb R^{m\times n}$ | $m$ rows, $n$ columns | same |
So Lecture 4's data matrix with $N$ rows and $d$ columns and Lecture 5's $X\in\mathbb R^{B\times n}$ are the same arrangement: one row per sample. The letters differ because each chapter borrows the ones its own literature uses.
A second name is kept when it helps a chapter read naturally or when it is what you will meet elsewhere. The rule for new material is that each alias is bridged on the page where it first appears; in the earlier lectures some are bridged only in what the lecturer says, so this table is where to settle them.
| object | displayed name | alias you will also see |
|---|---|---|
| column space | $\operatorname{Col}(A)$ | $\mathcal C(A)$ — Strang and earlier handouts; also image, range |
| null space | $\operatorname{Null}(A)$ | $\mathcal N(A)$ — Strang and earlier handouts; also $\ker(A)$ |
| residual / error | $r=b-Ax$ | $e=Ax-b=-r$ |
| scalar derivative | $\nabla_x L$ (column) | $\partial L/\partial x=(\nabla_x L)^{\mathsf T}$ (row) |
| samples | $B$ | $N$ — Lecture 4 and most statistics texts |
| input features | $n$ | $d$ — Lecture 4 and most statistics texts |
| eigenvector basis matrix | $V$ in $AV=V\Lambda$ | $B$ where the same basis is built column by column |
Course-wide convention: Lectures 1–6, practice sheets and the midterm use $\operatorname{Col}(A)$, $\operatorname{Null}(A)$ and $\operatorname{Row}(A)$. The calligraphic names in older handouts and external books denote the same subspaces. A calligraphic $\mathcal C$ used as the name of a basis is a different object and is unchanged.
These are the opposite of the table above. There, one object had two names. Here, one letter names different objects in different chapters, and nothing is being claimed to be equal. Read the definition on the page, never the letter.
| letter | meanings, by where they appear |
|---|---|
| $r$ | the rank of a matrix · the residual $b-Ax$ · a row index in elimination |
| $e$ | a standard basis vector $e_j$ · the error $Ax-b$ · Euler's number |
| $B$ | a generic matrix · a basis matrix · a control input matrix · the batch size |
| $H$ | a worked example's matrix · the Hessian · a measurement map $h$ |
| $R$ | row-echelon form · a measurement covariance · a rotation matrix · the triangular factor of $QR$ |
| $V$ | a vector space · a matrix of stacked vectors · the eigenvector or right-singular matrix |
| $P$ | a change-of-coordinates matrix · a projection matrix |
| $p$ | a probability distribution · a tip position · a dimension count |
| $q$ | joint coordinates · an orthonormal basis vector $q_i$ · a quadratic form $q(x)$ |
| $\lambda$ | an eigenvalue · a regularisation strength |
| $d$ | a feature count · a distance · a differential, as in $dx$ |
| $L$ | a linear map · a loss · the lower-triangular factor of $LU$ |
| $\alpha,\beta$ | arbitrary scalars · coordinates in a basis · a step size · a fitted parameter vector |
| $\theta$ | a joint angle · a parameter vector · an angle between vectors |
None of this is avoidable in a course that borrows from linear algebra, robotics, statistics and machine learning at once; the alphabet is not large enough. What matters is that a page defines the letter it is about to use, and that you look at the definition rather than at the letter.
Some code and some texts put inputs in rows and weights input-by-output — the transpose of the single-sample layout above. Both are correct. What is not correct is converting one of them and leaving the rest alone.
Writing $\cdot_c$ for the column layout of this page and $\cdot_r$ for the row layout:
$$x_c=x_r^{\mathsf T},\quad W_c=W_r^{\mathsf T},\quad b_c=b_r^{\mathsf T},\quad z_c=z_r^{\mathsf T}, \qquad \nabla_{W_c}L=\big(\nabla_{W_r}L\big)^{\mathsf T}.$$If you convert, convert the formula, the code, the stored answer and the written solution together. A formula transposed on paper while the code keeps the old layout is the single most common way a correct derivation produces a wrong number.
And check the conversion on a non-square, non-symmetric example. A square symmetric weight matrix returns the same thing either way, so it cannot tell you that you made a mistake.
When a book writes a gradient as a row, stacks samples in columns, or omits a $\tfrac12$, it is not wrong — it made a different choice. Three questions settle almost every mismatch:
The rule for new material is that a result adapted from a source using another convention says so — adapted to the course column-gradient convention — rather than being imported silently. The Textbooks and Reading Guide lists each source's category and the places its notation differs from this page.