How to compute $T'=\{n + 1 - i : i \in T \}$ for lexicographic ordering?

37 Views Asked by At

I have a question that came up during one of my combinatorial algorithm lectures, and could use some help. One of the theorems our book provides states that:

Let $S$ consist of all $k$-element subsets of the $n$-set $S=\{1,\dots,n\}$. Suppose that $\operatorname{rank}_L$ denotes rank in the lexicographic ordering, and $\operatorname{rank}_C$ denotes rank in the co-lexicographic ordering. Then, for any $k$-set $T\in S$, we have $$\operatorname{rank}_L(T)+\operatorname{rank}_C(T')=\binom{n}{k}-1,$$ where $T'=\{n+1-i : i \in T \}$.

There was also an example provided where one subset $T=\{1,2,3\}$ had the corresponding $T'=\{3,4,5\}$, and I'm not entirely sure how this conclusion was reached. In this example $n=5$ and $k=3$.

How was $T'$ computed in this instance, and what would $n$ and $i$ be in the equation for $T'$?