TITLE: associativity of quaternion multiplication
QUESTION [5 upvotes]: I understand that quaternion multiplication is non-commutative, but what association does it have.
putting into context when we have the statement
when given general numbers, and algebra such as: $A*B*C$ we generally are taught left to right $(A*B)*C$ even though it does not directly matter, but all of the examples that I have found for multiplying quaternions is only the case of multiplying $q_1*q_2$, and no examples of 3, or more. 
so because quaternion multiplication is non-commutative, and probably has a implicit associative (might be using this word our of context) property. what is it?
when given $q_1 * q_2 * q_3$ do I treat this as $q_1 * (q_2 * q_3)$, or as $(q_1 * q_2) * q_3$, or does it actually matter as long as the absolute order is maintained?

REPLY [6 votes]: Let $K$ be a field, and let $A$ be a not-necessarily-associative-or-unital algebra over $K$.  For $x,y,z \in A$, we define the associator 
$[x,y,z] = (xy)z - x(yz)$.
The associator defines a $K$-linear map $\varphi: A^3 \rightarrow A$. So the following are equivalent:    
(i) $A$ is associative.
(ii) The map $\varphi$ is identically zero.
(iii) For any $K$-basis $\{e_i\}_{i \in I}$ of $A$, all associators $[e_i,e_j,e_k]$ of not necessarily distinct triples of basis elements are zero.  
Thus, if $A$ has finite dimension $d$ over $K$, showing its associativity is a purely finite calculation involving checking all $d^3$ associators involving elements of a given basis are zero.  This calculation is performed for an arbitrary quaternion algebra over a field $K$ (of characteristic not $2$) in $\S 1.6$ of these notes.  This is by no means the best way of showing associativity of quaternion algebras -- e.g. it would be better to embed them, possibly after base extension, into a matrix algebra -- but I find it comforting that one can verify associativity of finite-dimensional algebras "while sleeping", so to speak, if one cares to.