Number of codes with max codeword length over an alphabet I have to find the number of codes with maximum codeword length $n$ over an alphabet $S$ of size $r$. 
The back of my book uses the fact that this number is equal to the number of subsets of $S_n$ and proceeds from there. 
Could someone explain to me why this is the case? The textbook has not covered subsets yet, so I am wondering what the connection between the two is. 
Thank you.

You have to prove that:
1- every subset of $S_n $ is a suitable code.
2- every suitable code is included in $S_n $
1- let $A\subseteq S_n $, now let $w\in A $ a string in the code A, $w\in A\rightarrow w\in S_n\rightarrow (|w|\leq n \wedge w\in S^*) $ as desired.
2- let $A=\{w\in S|w\leq n\}$ a code of suitable strings $w\in A\rightarrow w\in S_n $.
So we are done.
Note that all the implications simply come from the definitions given (remember $S_n=\{w\in S^*\|w|\leq n\} $).
