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.
Sum. To build the triangle, start with 1 at the top, then continue placing numbers below it in a triangular pattern. Each number is the numbers directly above it added together.