Case 1. Given the alphabet we can define a bijection from the positive integers into Each positive integer has a binary expansion where each is 0 or 1 and If has such a binary expansion, then We define by where Every one of the strings of length are the images of exactly one of the integers between From its definition, is clearly a bijection; therefore, is countable.
Case 2: is Finite. We will describe how this case is handled with an example first and then give the general proof. If then we can code the letters in into strings from One of the coding schemes (there are many) is Now every string in corresponds to a different string in for example, would correspond with The cardinality of is equal to the cardinality of the set of strings that can be obtained from this encoding system. The possible coded strings must be countable, since they are a subset of a countable set, Therefore, is countable.
If then the letters in can be coded using a set of fixed-length strings from If then there are at least as many strings of length in as there are letters in Now we can associate each letter in with with a different element of Then any string in corresponds to a string in By the same reasoning as in the example above, is countable.
Case 3: is Countably Infinite. We will leave this case as an exercise.