Question
Consider the following sets:
: Set of all recursively enumerable languages over the alphabet
: Set of all syntactically valid C programs
: Set of all languages over the alphabet
: Set of all non-regular languages over the alphabet
Which of the above sets are uncountable?
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:
- (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, is countably infinite.
- (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, is countably infinite.
- (All languages over ): The set of all languages is the power set . Since is countably infinite (), its power set has cardinality , which is uncountably infinite.
- (All non-regular languages over ): 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 and are uncountable (Option B).
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.