[Data article] How many times do we need to compare each other according to group numbers ?

[Data article] How many times do we need to compare each other according to group numbers ?

Image created by DALL·E 3

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



Leave a Reply

If you include a website address in the comment section, I cannot see your comment as it will be automatically deleted and will not be posted. Please refrain from including website addresses.