Is there some formula that allows us to calculate the number of calculations in a comparasion?
Suppose you have 5 numbers and want to calculate the number of comparisons :
Comparison 1: (1,2), (1,3), (1,4), (1,5), (2,3), (2,4), (2,5), (3,4), (3, 5), (4,5) : 10 Calculations
Comparison 2: (1,1), (1,2), (1,3), (1,4), (1,5), (2,2), (2,3), (2,4), (2,5), (3,3), (3,4), (3, 5), (4,4), (4,5), (5,5) : 15 Calculations
Comparison 3: (1,1), (1,2), (1,3), (1,4), (1,5), (2,1), (2,2), (2,3), (2,4), (2,5), (3,1), (3,2), (3,3), (3,4), (3, 5), (4,1), (4,2), (4,3), (4,4), (4,5), (5,1), (5,2), (5,3), (5,4), (5,5) : 25 Calculations
My Question: Are there some general formulas that can be used to "predict" in advance how many calculations will be required in each one of these comparisons? Could some formulas be used to extend this for "n" number of numbers? E.g. (1,1,1) ... (5,5,5)?
Thanks!