169k views
5 votes
your job is to decide which of a set of given numbers is the smallest. how many comparisons (of 2 numbers at a time) do you have to make if you have 8 numbers?

User Anther
by
7.9k points

1 Answer

4 votes
If I have eight numbers and i am tasked to decide which of the set of given numbers is the smallest comparing 2 numbers at a time, I will have 28 comparisons in all. Trying all combinations for the first number, you have 7. Trying all combinations for the second number nit including its comparison to the first number (because it will be redundant), you will have 6 comparisons an so on. Adding it all up, you have 7+6+5+4+3+2+1=28.
User David Hahn
by
7.8k points