GATE / CS ARCHIVE

GATE CSE 2019 / QUESTION 34

Counting descriptions and languages

Theory of Computation · Other / Mixed Topics · Full GATE CSE 2019 paper

GATE 2019, Q34 2 marks · MCQ
Report issue

Other / Mixed Topics

Question 34, GATE 2019: Which sets are uncountable? S1: recursively enumerable languages over {0,1}; S2: syntactically valid C programs; S3: all languages over {0,1}; S4: all nonregular languages over {0,1}. Options A S1/S2, B S3/S4, C S2/S3, D S1/S4.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. A set is countable if its members can be listed using natural-number indices. Finite strings over any finite alphabet can be listed by length and then lexicographic order, so their collection is countable.
2. Each Turing machine has a finite description. There are therefore only countably many such machines and only countably many languages they recognize. Every recursively enumerable language is recognized by a machine, so S1 is countable.
3. Each C program is also a finite string. Restricting the countable set of all strings to those obeying C syntax cannot make it uncountable, so S2 is countable.
4. The set {0,1}* of words is countably infinite, but a language is an arbitrary subset of that set. Its power set is uncountable by Cantor's theorem. Hence S3 is uncountable; confusing words with sets of words is the main trap.
5. Regular languages have finite automaton descriptions, so there are only countably many of them. If S4 were countable too, all languages would be a union of two countable sets, contradicting step 4. Thus S4 is uncountable and the answer is B.

Original paper, page 11 · Answer key