I'm writing some software that takes a group of users and compares each user with every other user in the group. I need to display the amount of comparisons needed for a countdown type feature.
For example, this group [1,2,3,4,5] would be analysed like this:
By creating little diagrams like this I've figured out the pattern which is as follows:
I need to be able to take any number of users, and calculate how many comparisons it will take to compare every user with every other user.
Can someone please tell me what the formula for this is?