Consider the following sets:
S1: Set of all recursively enumerable languages over the alphabet
S2: Set of all syntactically valid C programs
S3: Set of all languages over the alphabet
S4: Set of all non-regular languages over the alphabet
Which of the above sets are uncountable?
View worked solution
Answer: B
To determine which of the given sets are uncountable, let us analyze each set individually:
- : Set of all recursively enumerable (RE) languages over
Every recursively enumerable language is recognized by a Turing Machine. Since any Turing Machine can be represented as a finite-length string over a finite alphabet, the set of all Turing Machines is countably infinite. Consequently, the set of all RE languages () is countable.
- : Set of all syntactically valid C programs
Each syntactically valid C program is a finite-length string of characters chosen from a finite alphabet (ASCII). The set of all finite-length strings over a finite alphabet is countably infinite. Thus, is countable.
- : Set of all languages over
The set of all strings over , denoted by , is countably infinite. The set of all languages over is the power set of , i.e., . According to Cantor's theorem, the power set of a countably infinite set is uncountably infinite. Therefore, is uncountable.
- : Set of all non-regular languages over
The set of all languages () is the union of the set of regular languages () and the set of non-regular languages ():
Since every regular language can be represented by a finite regular expression, is countable. If were also countable, then their union would have to be countable (as the union of two countable sets is countable). Since is uncountable, must be uncountable.
Thus, only and are uncountable sets.
Free practice · Your answers on this page are not saved.
