# Why does ReplaceAll change the ordering of expresssions?

I wrote the following replacing statement:

Binomial[12 - u - v - w + z,  4 - u - w + z] /.
{u -> Subscript[c, αβ],
v -> Subscript[c, βγ], w -> Subscript[c, γα],
z -> Subscript[c, αβγ]}


which on the screen is displayed as

$$\text{Binomial}[12 - u - v - w + z,\ 4 - u - w + z]\ /.\{u\rightarrow c_{\alpha\beta},\ v\rightarrow c_{\beta\gamma},\ w\rightarrow c_{\gamma\alpha},\ z\rightarrow c_{\alpha\beta\gamma}\}$$

But the result is

Binomial[
12 - Subscript[c, αβ] + Subscript[ c, αβγ] - Subscript[c, β[Gamma]] -
Subscript[c, γα], 4 - Subscript[c, αβ] + Subscript[ c, αβγ] - Subscript[c, γα]]


which on the screen is displayed as

$$\text{Binomial}[12 - c_{\alpha\beta}+c_{\alpha\beta\gamma} - c_{\beta\gamma} - c_{\gamma\alpha} ,\,4 - c_{\alpha\beta}+ c_{\alpha\beta\gamma} -c_{\gamma\alpha} ]$$

from which we see the ordering of $u,v,w,z$ are shuffled after ReplaceAll, and with the original ordering it would have been

$$\text{Binomial}[12 - c_{\alpha\beta} - c_{\beta\gamma} - c_{\gamma\alpha}+c_{\alpha\beta\gamma}, \,4 - c_{\alpha\beta} -c_{\gamma\alpha}+ c_{\alpha\beta\gamma} ]$$

Why is this shuffling happening and how can I prevent it?

• Plus[] is commutative (has the Orderless attribute), so Mathematica will sort addends in a canonical order. – J. M. will be back soon Jul 27 '17 at 1:05
• @J.M. thank you! – Jia Yiyang Jul 27 '17 at 2:02

It is not an effect of Replace. It is caused by Plus having the attribute Orderless, which makes it act as a Abelian operator. If further computation is not needed, you can suppress the reordering with HoldForm.
HoldForm @