Is the understanding of cardinality of sets of strings correct

elementary-set-theorylogic

Is my understanding of cardinality of sets of strings correct?

1) A finite set of symbols (containing $x$ symbols) and strings of finite length $n$ gives us $x^n$ finitely many strings.

2) A finite set of symbols (containing $x$ symbols) and strings of countably infinite length $\aleph_0$ gives us $x^{\aleph_0}$ uncountably many strings.

3) A countably infinite set of symbols (containing $\aleph_0$ symbols) and strings of finite length $n$ gives us $\aleph_0^n$ countably infinitely many strings.

4) A countably infinite set of symbols (containing $\aleph_0$ symbols) and strings of countably infinite length $\aleph_0$ gives us ${\aleph_0}^{\aleph_0}$ uncountably many strings.

And I've learned that there are countably infinite number of strings of finite lengths given a set of finitely many symbols, which is different from saying $x^n$, since it's talking about all values of the finite number $n$. Is there a formula to capture this notion in relation to $x^n$?

Best Answer

Apart from the issue about $x$ pointed out in the comments, your assertions are correct.

For the last one, if $X$ is a finite set of cardinality $x$, let $X^n$ denote the set of words of length $n$ on the alphabet $X$ (a finite set of cardinality $x^n$, as you observed). Note that, for $n = 0$, $X^0$ is the singleton containing the empty word. Then the set of all finite words, usually denoted $X^*$, is the union $\bigcup_{n \geqslant 0} X^n$. As a countable union of finite sets, it is countable, and hence its cardinality is $1$ if $x = 0$ and $\aleph_0$ otherwise.