It was late last night when I wrote the first post so it was short on explanation ... so here is a brief explanation ...<div><br></div><div>Every time one ballot ranks x before y and the other one doesn't, there is a discrepancy that separates them in ballot space. A complete reversal to y ahead of x is twice as serious as a mere change to equality in rank. </div><div><br></div><div>To assure freedom from clone bias the discrepancy is weighted by the product P(x)P(y) where P is a probability.distribution that distributes P(x) among x1,x2,x3, etc. when x is is replaced by a set of closely clustered clones.</div><div><br></div><div>The matrix manipulation keeps track of the count of weighted discrepancies... in particular, the entry in row x, column y of M1 is (supposed to be) a one if x is ranked ahead or equal to y, otherwise zero.</div><div><br></div><div>So M1(x, y) minus M1(y, x) is one, zero, or negative one, depending on whether x>y, x=y, or x<y. So if M, defined as</div><div><br></div><div>(M1 - transposeM1) - (M2 - transposeM2)</div><div><br></div><div>is zero, the two ballot rankings are identical.</div><div><br></div><div>Otherwise, the absolute values of the entries in M reflect the severity of descrepency., which brings us to the matrix A of absolute values of the entries in M.</div><div><br></div><div>Finally pre and post multiplying A by b and b', the row of benchmark probabilites (random ballot probabilities) and its transpose puts in the weights,  and sums the weighted discrepancies. Divide by two (or four) as desired to normalize the distance.</div><div><br></div><div>I hope that helps!</div><div><br></div><div>Forest</div>