:<math>r(i) ~~=~~ \# \{ k \mid k > i ~\land~ \pi(k) < \pi(i) \}</math>
Both <math>v</math> and <math>r</math> can be found with the help of a '''[[Rothe diagram''']], which is a [[permutation matrix]] with the 1s represented by dots, and an inversion (often represented by a cross) in every position that has a dot to the right and below it. <math>r(i)</math> is the sum of inversions in row <math>i</math> of the Rothe diagram, while <math>v(i)</math> is the sum of inversions in column <math>i</math>. The permutation matrix of the inverse is the transpose, therefore <math>v</math> of a permutation is <math>r</math> of its inverse, and vice versa.