Here's an easier way that corrects one of the other answers. There are n singleton intervals of the form [a, a]. For intervals [a, b] with a =/= b, there are n choices for a, (n-1) choices for b, and exactly half of those pairs have a < b (the other half have a > b). That's n(n-1)/2 of these intervals. Adding in the singletons gives n + n(n-1)/2 = n(n+1)/2.
(To determine which of us is right, consider [1, 2, 3] which has [1,1], [1,2], [1,3] [2,2], [2,3], [3,3] so 6 intervals. Putting 3 into n(n-1)/2 gives 3, wrong; putting 3 into n(n+1)/2 gives 6, which agrees with this case.)
2007-02-17 02:39:52
·
answer #1
·
answered by brashion 5
·
0⤊
0⤋
If you do this by looking at the integer interval S={1, ... n} as a set, then the question can be rephrased as "find the total number of consecutive sets of size 1 to n in the set {1...n}"
First, for a one point interval, you'll find n sets, as there are n points in the set S. Doing this for a 2-set, you'll find n-1, n-2 for 3 set and so on and finally 1 for the n-set, which is S itself. Thus, you'd have to sum up 1 to n and the sum is basically given by n(n-1)/2.
2007-02-17 07:48:56
·
answer #2
·
answered by anomaly 2
·
0⤊
0⤋