Lexicographic Order Consider the r-subsets of {1,2,...,n} in lexicographic order. What are the first (n-r+1) r-subsets?
The answer is 12...r, 12...(r-1)(r+1),...,12...(r-1)n 
I don't understand where the 12 is coming from. 
In my book it says that 12...r is the first r-subset in the lexicographic ordering and (n-r+1)(n-2+2)...n is the last r-subset. 
Is anyone able to explain this and help me understand it all! 
Thanks! 
 A: For a concrete example take $n=9$ and $r=4$, so that we’re looking for the first six $4$-subsets of $[9]=\{1,\ldots,9\}$ in lexicographic order. If $A$ and $B$ are $4$-subsets of $[9]$, we determine which comes before the other as follows. Let $A=\{a_1,a_2,a_3,a_4\}$ and $B=\{b_1,b_2,b_3,b_4\}$, where $a_1<a_2<a_3<a_4$ and $b_1<b_2<b_3<b_4$. Assuming that $A\ne B$, find the smallest $k\in\{1,2,3,4\}$ such that $a_k\ne b_k$; if $a_k<b_k$, then $A$ comes before $B$ in lexicographic order, and if $b_k<a_k$, then $B$ comes before $A$. Thus, the first $4$-subset of $[9]$ is $\{1,2,3,4\}$.
Now consider a $4$-subset $\{1,2,3,k\}$, where $5\le k\le 9$, and any $4$-set $A$ that does not include all of $1,2$, and $3$. When the members of each set are listed in increasing order, the first position in which $\{1,2,3,k\}$ and $A$ differ must be one of the first three positions, and $A$ must have the larger member in that position. Thus, each of the $4$-sets $\{1,2,3,k\}$ precedes every $4$-subset of $[9]$ that does not include $1,2$, and $3$. Thus, the $4$-sets $\{1,2,3,k\}$ with $k=4,5,6,7,8,9$ are the first six $4$=subsets of $[9]$ in lexicographic order. Writing $A\prec B$ to mean that $A$ precedes $B$ is lexicographic order, we have
$$\{1,2,3,4\}\prec\{1,2,3,5\}\prec\{1,2,3,6\}\prec\{1,2,3,7\}\prec\{1,2,3,8\}\prec\{1,2,3,9\}\;,$$
with all other $4$-subsets of $[9]$ following these. 
The same idea applies in general. The first $r$-subset of $[n]$ is $\{1,2,3,\ldots,r-1,r\}$. The next one is $\{1,2,3,\ldots,r-1,r+1\}$, the one after that is $\{1,2,3,\ldots,r-1,r+2\}$, and so on until we reach $\{1,2,3,\ldots,r-1,n\}$. The largest element of the $r$-subset started at $r$ and topped out at $n$, so it went through $n-r+1$ different values. In other words, the first $n-r+1$ $r$-subsets of $[n]$ in lexicographic order are precisely the subsets that contain all of the integers $1,2,\ldots,r-1$ and one integer from $\{r,r+1,\ldots,n\}$.

To get more of a feel for the lexicographic order on subsets, you might return to the example and try to work out the the next few $4$-subsets of $[9]$. The very next one is $\{1,2,4,5\}$, followed by $\{1,2,4,6\}$, $\{1,2,4,7\}$, $\{1,2,4,8\}$, and $\{1,2,4,9\}$; can you see what the next five will be?
A: Consider the concrete example where $n=7, r=4$.  We want subsets of size 4.  Since a set can be written in any order, we are specifying "lexicographic" or dictionary order for each set, and then ordering them the same way.
The first set will be $\{1,2,3,4\}$.  Four terms is pretty few, but we could abbreviate this as $\{1,2,\ldots,4\}$.  This lets us not write any terms but the first two and the last one.  If instead of four terms there were forty, the savings would be much higher.
