Combining Predictions in Pairwise Classication: An Optimal Adaptive Voting Strategy and Its Relation to Weighted Voting Draft of a paper to appear in Pattern Recognition