Question

Consider the following sets:

S1S_1: Set of all recursively enumerable languages over the alphabet {0,1}\{0, 1\}
S2S_2: Set of all syntactically valid C programs
S3S_3: Set of all languages over the alphabet {0,1}\{0, 1\}
S4S_4: Set of all non-regular languages over the alphabet {0,1}\{0, 1\}

Which of the above sets are uncountable?

Choose one option
Official answer and solution
Official answer
B
From
Official GATE 2019 answer key

Solution

Determine the cardinality of each set using diagonalization and power set cardinality rules.

Let us determine the cardinality of each set:

  • S1S_1 (Recursively enumerable languages): Every recursively enumerable language is accepted by a distinct Turing machine. Since every Turing machine can be encoded as a finite binary string, the set of all Turing machines is countably infinite. Hence, S1S_1 is countably infinite.
  • S2S_2 (Syntactically valid C programs): Every valid C program is a finite sequence of ASCII characters. The set of all finite strings over any finite alphabet is countably infinite. A subset of a countable set is countable. Hence, S2S_2 is countably infinite.
  • S3S_3 (All languages over {0,1}\{0, 1\}): The set of all languages is the power set P(Σ∗)\mathcal{P}(\Sigma^*). Since Σ∗\Sigma^* is countably infinite (∣Σ∗∣=ℵ0|\Sigma^*| = \aleph_0), its power set has cardinality ∣P(Σ∗)∣=2ℵ0=c|\mathcal{P}(\Sigma^*)| = 2^{\aleph_0} = \mathfrak{c}, which is uncountably infinite.
  • S4S_4 (All non-regular languages over {0,1}\{0, 1\}): The set of all regular languages is countable (each regular language corresponds to a finite regular expression or DFA, which is countable). Since the set of all languages is uncountable and the set of regular languages is countable, their difference (the set of non-regular languages) must be uncountably infinite.

Therefore, sets S3S_3 and S4S_4 are uncountable (Option B).

Final answer

B

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2019 Computer Science and Information Technology (CS)
Question
44 of 65, printed as CS Q.34
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.