Exercise 2: A Triangular Loop at n=10 — Possible Solution ==================================================================== GIVEN ------------------------------ A triangular loop identical in structure to this chapter's own example (inner loop running from 0 to i-1 for each outer value i), with n = 10. STEP 1: DIRECT SUMMATION ------------------------------ Total operations = 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 = 45 STEP 2: THE CLOSED-FORM FORMULA ------------------------------ Per this chapter's own formula (reusing Discrete Mathematics Fundamentals Chapter 8's own summation result): n(n-1)/2 = 10(9)/2 = 90/2 = 45 STEP 3: CONFIRMING THE MATCH ------------------------------ Direct summation gives 45. The closed-form formula also gives 45 - an exact match, confirming the formula correctly predicts the total operation count without needing to add up every term by hand. STEP 4: THE BIG-O CLASS ------------------------------ Per this chapter's own dominant-term simplification of n(n-1)/2 (which expands to (n^2-n)/2), the dominant term is n^2, so the overall complexity is: O(n^2) WHY THIS WORKS AS AN ANSWER ------------------------------ Both the direct summation and the closed-form formula are computed independently and explicitly shown to agree at n=10, confirming this chapter's own formula is correct rather than merely assumed, and the Big-O class is derived using the same dominant-term reasoning applied throughout this chapter.