A condition in the definition of algebra over a ring This is an elementary question about definition, but I do not get answer in texts where I saw the definition (Atiyah-McDonald, Paolo Aluffi).

A ring $B$ is said to be an algebra over a commutative ring $R$ if there is a ring homomorphism from $R$ to $B$ such that image of $R$ is in the center of $B$.

I do not understand the requirement of last condition: "image of $R$ is in center of $B$".
Can one point out why it is required, by illustration of an example, in which a nice theorem fails by removal of this condition? Or can one illustrate the requirement of the last condition in some natural example of algebras?
 A: For an algebra, you want the coefficients to be able to commute with everything, so that you don’t have to worry what side of elements they are written on.
It also forces the coefficient ring to be commutative, and so if you represent elements of $A$ as matrices (when $A$ is a free $R$ module) you can do determinants easily.
I don’t know what kind of theorem failure will impress you. Perhaps that “every finite dimensional semisimple $\mathbb C$ algebra is a full matrix ring over $\mathbb C$”?
The failure is that the quaternions $\mathbb H$ would be a $\mathbb C$ algebra if we dropped the centrality condition, but it is NOT a full matrix ring over $\mathbb C$.
A: In general a ring $R$ does not need to be commutative. Cf. Wikipedia for the definition of center.
For example consider the ring $R=\mathbb{Q}x\oplus\mathbb{Q}y$ given by bilinearily extending the product from the products of basis elements: $x^2=x, xy=y, yx=x, y^2=y$. This gives a non-commutative but associative ring without unit. The map $\mathbb{Q}\rightarrow R, q\mapsto qx$ is ringmorphism, whose image is the subring $\mathbb{Q}x\subset R$, but it does not make $R$ a $\mathbb{Q}$-algebra, since the center is $Z(R)=\{0_R\}$, as $xy=y\neq x=yx$.
Since here we do not require ringmorphisms to be unital, we could however consider $R$ as a $\mathbb{Q}$-algebra via the map $\mathbb{Q}\rightarrow R, q\mapsto 0_R$ - this is not very interesting, though.
If you require that (associative) rings $R$ must be unital, then $R$ can always be considered as a $\mathbb{Z}$-algebra, by the morphism induced by $1_{\mathbb{Z}}\rightarrow 1_R$, because the additive subgroup generated by $1_R$ is always in the center.
A: The statement "Multiplication in $B$ is bilinear over $R$" is false without the centrality condition.
Intuitively, we think of an algebra over $R$ as a module over $R$ that has a product that respects the module action.  For example, algebras over $\mathbb{R}$ are vector spaces over $\mathbb{R}$, equipped with a bilinear product.
Thus without the centrality condition, the definition would fail to capture the the fundamental intuition of what an algebra is.
Suppose we do not have the centrality condition, so some $a\in R$, has image $x\in B$, with $xy\neq yx$ for some $y\in B$.  Then $$(1.a)y=1xy=xy\neq yx=(1y).a,$$ so the product in $B$ is not bilinear over $R$.
Here the module action $.a,$ of $a\in R$, is given by right multiplication by the image of $a$ in $B$.
