Find number of flips of transposition $(i \ j)$. Suppose that $(i \ j) \in S_n$ is a transposition and that $i &lt; j$.

How would it be possible to find an expression for the number of flips of $(i \ j)$?
If I understand correctly your definition in the comments, the number of flips of an element $\sigma \in S_n$ is $nf := |\{i, j &lt; n| i &lt; j, x(j) &lt; x(i)\}|$. In that case, the question seems to have an easy solution:

Suppose $(ij)$ is your transposition ($i &lt; j$). It swaps $j$ and $i$ and leaves all other elements on their place. Now, suppose $p$ and $q$ are such numbers, that $p &lt; q$ and $(ij)(p) &gt; (ij)(q)$. This definitely can not happen in case, when neither $p$ nor $q$ belong to $\{i, j\}$. Neither can they in case, when $p, q \leq i$ or $p, q \geq j$. Now, suppose $p = i$ and $q \neq j$. Then $i &lt; q &lt; j$. Suppose $q = j$, $p \neq i$. That also results in $i &lt; p &lt; j$. Those cases and $p = i$, $q = j$ are the only possible ones. So $nf((ij)) = 2|\{p|i &lt; p &lt; j\}| + 1 = 2(|j - i| - 1) + 1 = 2|i - j| - 1$
The inversion number (what you call the number of flips) is the number of crossings in the arrow diagram of the permutation. This is $1$.

See here for more.