While going through an equation today i realized that sum of first (n-1) numbers is [n*(n-1)/2] which is equal to combinations of two items out of n i.e [n!/((n-2)! * 2!)]. I need some intuition on how these two things are related?
4 Answers
You're asking why the number of ways to pick 2 cards out of a deck of n
is the same as the sum 1 + 2 + ... + (n-1).
The reason is that there are (n-1) ways to pair the first card with another card, plus (n-2) ways to pair the second card with one of the remaining cards, plus (n-3) ways to pair the third card...
One way to think of this is to map it to an intermediary representation - namely, a triangle made of boxes:
*****
****
***
**
*
Let's suppose that this triangle has width and height $n$. The number of dots in this triangle is equal to $1 + 2 + 3 + ... + n = \frac{n(n+1)}{2}$.
We can interpret this triangle as every way of choosing two elements out of $n + 1$ by expanding it out into a 0/1 matrix:
| 1 2 ... n-1 n
----+------------------
n+1 | 1 1 1 1 1
n | 1 1 1 1 0
n-1 | 1 1 1 0 0
... | 1 1 0 0 0
2 | 1 0 0 0 0
1 | 0 0 0 0 0
If we take all unordered pairs of two numbers, then we can always sort the pair by putting the bigger number first. Each possible way to do this corresponds to a 1 entry in this matrix. For example, the pairing $(n+1, n)$ corresponds to the upper-right corner, since $n+1 > n$. Similarly, $(n+1, 1)$ corresponds to the top-left corner. If you count up the number of 1s in this matrix, you'll note that it's half the area of the matrix. There are $n + 1$ rows and $n$ columns, so the area is $\frac{n(n + 1)}{2}$.
We can also arrive here by noting that there are $n$ 1s in the first row, then $n - 1$, then $n - 2$, ..., then 1. Thus $1 + 2 + ... + n$ is equal to the number of unordered pairs drawn from $n + 1$ numbers.
Hope this helps!

- 10,206
Wolfram proof without words. Note that this uses Pascal's Triangle.

- 155

- 146
-
3I don't think that the math helps at all here. That just gives a proof that they're equal, rather than providing an intuition for why they're equal. – templatetypedef Aug 23 '12 at 03:58
-
Yes the math does not help here as your proof is something on which the question is based. The question is "Why are these two completely different equations related?" – Aug 23 '12 at 04:59
-
This answer is perfectly fine! The number of dots is the arithmetic sum of the rows:
(n-1)+(n-2)+(n-3)+...+2+1
. – ninjagecko Aug 23 '12 at 05:13 -
-
Sorry guys, the link to wolfram gives a good intuition but the explanation above is a bit misleading, so i have removed it and selected this as the accepted answer. – Shashank Tomar Aug 23 '12 at 06:48
Let's count 2-subsets from a set of size $n$.
Certainly this is $n\choose2$.
Alternatively, we can count by cases. First some details:
Let $N$ be the set $\{x_1, x_2, \ldots x_{n}\}$ where $x_i < x_{i+1}$ for $1 \leq i \leq n - 1$.
We seek to count how many unique subsets $\{a, b\} \subseteq N$ there exist where $a < b$.
Cases:
1) $b = x_n$ $\hspace{14mm}$ As $a < b$, there remain $(n - 1)$ choices for a.
2) $b = x_{n-1}$ $\hspace{9mm}$ There remain $(n - 2)$ choices for $a$.
3) $b = x_{n-2}$ $\hspace{9mm}$ There remain $(n - 3)$ choices for $a$.
$\hspace{10mm}\vdots$
$n$) $b = x_0$ $\hspace{13mm}$ There remain $0$ choices for $a$.
Summing over each of these distinct cases gives us $\sum_{i=0}^{n-1}i$.
Hence, $\frac{n(n-1)}{2} =$ $n\choose2$ $= 1 + 2 + \ldots (n-1)$.
n*n/2
not(n*n-1)/2
– zerocool Aug 18 '22 at 16:06