Hello!

I'm not quite understanding this idea of inversions. I know that if is a permutation, then a pair is an inversion if .

The graph of has and as adjacent iff is an inversion.

I think I understand that. I have this big problem though:

Suppose . These are the points connected in a square shape. Clearly and are adjacent.

But, the formula gives for (this is just a pair, it isn't permutation notation?), .

I can't see why this is wrong, and since we're just following the path around the square.

Can someone explain why this is wrong?