Recently when learning group theory, I came across Cayley graphs and upon looking at how can be labelled, I was confused.
Take the $D_4$ dihedral group for example. From wikipedia there is a Cayley graph of $D_4$ in which the element $a$ corresponds to a rotation of $\pi/2$ clockwise, and $b$ corresponds to a reflection about a vertical axis. The graph also suggests that $ab$ corresponds to the rotation $a$ followed by the reflection $b$, and this has caused me some confusion because I would think that a rotation then a reflection would instead correspond to $ba$ rather than $ab$.
I think this because the matrix representation of $D_3$ has a rotation of $\pi/2$ clockwise given by $$R=\begin{pmatrix}0 & 1\\\ -1 & 0\end{pmatrix}$$ and a reflection along a vertical axis is $$S=\begin{pmatrix}-1 & 0\\\ 0 & 1\end{pmatrix}$$ When doing the multiplication, we get $$RS=\begin{pmatrix}0 & 1\\\ 1 & 0\end{pmatrix}$$ which corresponds to a reflection about the axis $y=x$, which geometrically is a reflection about a vertical axis then a rotation $\pi/2$ clockwise. Note that this is not a rotation and then a reflection which the Cayley graph suggests with $ab$.
So it seems like the matrix representation has transformations applied from right to left, and in the Cayley graph, transformations are applied from left to right. What's the reason for this difference?
Historically we defined the composition $f(g(x)) = (g \circ f)(x)$ so that reading from left to right we would apply $g$ first, then $f$. However this gets confusing so the convention that $f(g(x)) = (f \circ g)(x)$ is also in use. This can cause some side switching when we consider an operation as a multiplication in a group or as a function acting on a set depending on the author. However the left-group action is more common which is consistent with column vector standard for a the matrix representation.
So if we call $v$ the vertex vector then $RSv$ would transform this vector and simply by writing $R(Sv)$ we can see that the reflection should be applied first, then the rotation. When studying the symmetric group on $n$ letters you will also be applying transformations from the right to the left to understand the action.