[Data article] How many times do we need to compare each other according to group numbers ?
All of a sudden, I became curious about this question, How many time do we need to compare each other according to group numbers?” and searched for the answer on a website, but I couldn’t find a clear answer. Therefore, I calculated it myself.
For example, when there are two groups, we will compare them only once. When there are three groups, we need to compare each group with every other group, resulting in three comparisons. With four groups, we need to compare each group to every other group once, resulting in six comparisons.
Then, what about when there are 10 groups? I checked manually and found a certain pattern between the number of groups and the number of comparisons.
and I suggest the below equation.
0.5*n*(n-1) where n is group number
So if there are 100 groups, how many times we have to compare each other? It would be 0.5*100*(100-1)= 4950