2

This answer says:

We can have uncountable languages only if we allow words of infinite length.

So does that means any (finite / infinite) language or any (finite / infinite) set of languages over any (finite / infinite) alphabet will be uncountable of words have infinite length?

Let me simplify this by asking specifically for the simplest language of infinite length string:

Does the language of "finite" number of words, each of which can be of "infinite length" and are based on "finite" alphabet is uncountable?

Narek Bojikian
  • 4,784
  • 1
  • 13
  • 36
Rnj
  • 235
  • 1
  • 10

4 Answers4

3

A finite language is finite. Every finite set is countable, by definition.

A language of finite-length strings over a finite alphabet may be infinite but is always countable.

A language of infinite-length strings over a finite alphabet might be uncountable.

rici
  • 12,150
  • 22
  • 40
3

I will answer the question "is there a language which is countable and contains a string of infinite length?"

The answer is yes. Consider the symbols $\{0, 1\}$ and the language consisting of strings which do not contain the symbol $1$. The string of infinitely many $0$s and no $1$s is in the language, but there are still countably many strings in the language (match the empty string with the natural number 0, match the string of infinitely many $0$s with the natural number 1, match the string $0$ with 2, the string $00$ with 3, $000$ with 4, and so on.)

Now, given an infinite string over this set of symbols it is only semi-decidable if the string belongs to this language. That is, there is no TM which will tell you if an infinite string contains no $1$s, but a TM can tell you if a string does contain a $1$.

Since your question seems to indicate that you view the cardinality of a set and the decidability of set membership as being related, you may be interested in apartness relations and, more generally, in constructive mathematics: https://en.wikipedia.org/wiki/Apartness_relation

Jack
  • 113
  • 5
3

Take sin x for rational x. We write down the first digit after the decimal point in base 2, the second digit in base 3, third digit in base 4, and so on.

This gives us a countable language of infinite strings over an infinite alphabet.

It has the interesting property that examining any finite number of symbols in an infinite string cannot tell you if it is in the language or not.

gnasher729
  • 32,238
  • 36
  • 56
1

Each infinite word containing ${a,b}$ corresponds (one-one) to a real number with digits of $0,1$ if $a\mapsto 0$ and $b\mapsto 1$. For example, $$ abaaabb\cdots\mapsto 0.0100011\cdots $$ So all strings containing ${a,b}$ has the same infinity as all the numbers in $[0,1]$. And thus language with two symbols of infinite length of words is uncountable.

The infinity of languages with finite or even countable symbols is the same as the one with two symbols. This is a standard theorem in set theory, i.e. $$2^{\aleph_0}=N^{\aleph_0}=\aleph_0^{\aleph_0}={\aleph_1}$$

E Zhang
  • 148
  • 4