GATE 2022
65 questions
MCQ 32 · MSQ 15 · NAT 181-mark 30 · 2-mark 35
Questions 46–50 of 65
Which of the following is/are undecidable?
One or more options are correct.
Answer: (A), (B), (C)
(B) "L(M) is regular" and (C) "M accepts all strings" are non-trivial properties of the language of a single TM: some machines have the property and some do not. By Rice's theorem both are undecidable.
(A) Equality of two TM languages is undecidable too. Reduce from (C): for a given M, take as a machine that accepts every string. Then exactly when M accepts all strings. If equality were decidable, so would (C) be.
(D) is decidable. In steps a TM can read only the first input symbols, so its behaviour in those steps depends only on that prefix. It is enough to run M for steps on each of the finitely many strings of length up to (the alphabet is finite) and check that none halts within steps.
Answer: (A), (B), (C)
(A) Equality of two TM languages is undecidable too. Reduce from (C): for a given M, take as a machine that accepts every string. Then exactly when M accepts all strings. If equality were decidable, so would (C) be.
(D) is decidable. In steps a TM can read only the first input symbols, so its behaviour in those steps depends only on that prefix. It is enough to run M for steps on each of the finitely many strings of length up to (the alphabet is finite) and check that none halts within steps.
Answer: (A), (B), (C)
Consider the following languages:
Note that is the reversal of the string . Which of the following is/are TRUE?
Note that is the reversal of the string . Which of the following is/are TRUE?
One or more options are correct.
Answer: (A), (B), (C)
- : n may be 0. With we get for every , so (every string is in it, and the language only has strings over a and b). This is regular.
- : and . The last symbol of is the first symbol of , so every string of starts and ends with the same symbol and has length at least 3. Conversely, such a string is with and a non-empty middle . So , which is regular.
Both languages are regular, so both are also context-free. (A), (B) and (C) are true. (D) is false because it says they are not regular.
Answer: (A), (B), (C)
- : and . The last symbol of is the first symbol of , so every string of starts and ends with the same symbol and has length at least 3. Conversely, such a string is with and a non-empty middle . So , which is regular.
Both languages are regular, so both are also context-free. (A), (B) and (C) are true. (D) is false because it says they are not regular.
Answer: (A), (B), (C)
Consider the following languages:
Which of the following statements is/are FALSE?
Which of the following statements is/are FALSE?
One or more options are correct.
Answer: (B), (C), (D)
Facts about the three languages:
- and are deterministic CFLs: a DPDA matches the a's with the b's and then skips the c's (for ), or skips the a's and matches the b's with the c's (for ).
- is not context-free. Intersect with the regular language to get and pump . The pumped part can touch at most two neighbouring blocks, but the matching blocks (1st with 3rd, 2nd with 4th) are never neighbours, so one block changes without its partner and the form breaks.
- The complement of is context-free. It is the odd-length strings (regular) together with the even-length strings that have an a in one half and a b exactly half the length later, or the other way round. These are generated by : the centres of the odd strings A and B are exactly half the total length apart.
Now the statements:
- (A) is true: is not a CFL, and are DCFLs.
- (B) is false: is context-free.
- (C) is false: (a's equal b's and b's equal c's), which is not context-free, since pumping cannot keep all three counts equal.
- (D) is false: the complement of is context-free.
Answer: (B), (C), (D)
- and are deterministic CFLs: a DPDA matches the a's with the b's and then skips the c's (for ), or skips the a's and matches the b's with the c's (for ).
- is not context-free. Intersect with the regular language to get and pump . The pumped part can touch at most two neighbouring blocks, but the matching blocks (1st with 3rd, 2nd with 4th) are never neighbours, so one block changes without its partner and the form breaks.
- The complement of is context-free. It is the odd-length strings (regular) together with the even-length strings that have an a in one half and a b exactly half the length later, or the other way round. These are generated by : the centres of the odd strings A and B are exactly half the total length apart.
Now the statements:
- (A) is true: is not a CFL, and are DCFLs.
- (B) is false: is context-free.
- (C) is false: (a's equal b's and b's equal c's), which is not context-free, since pumping cannot keep all three counts equal.
- (D) is false: the complement of is context-free.
Answer: (B), (C), (D)
Consider a simple undirected weighted graph G, all of whose edge weights are distinct. Which of the following statements about the minimum spanning trees of G is/are TRUE?
One or more options are correct.
Answer: (A), (B), (C)
All edge weights are distinct, so the MST is unique.
- (A) True. Kruskal takes edges in increasing order. The two lightest edges cannot form a cycle (a cycle needs at least 3 edges), so the second smallest edge is always taken.
- (B) True. If the 3rd smallest edge is taken, we are done. If it is rejected, it closes a triangle with the two smallest edges, so those three edges use up all the edges among their 3 vertices. The 4th edge then has an endpoint outside these 3 vertices, so it cannot form a cycle with the two smallest edges, and it is taken.
- (C) True. This is the cut property: for any cut, the lightest edge crossing it is in every MST.
- (D) False. Distinct weights give a unique MST.
Answer: (A), (B), (C)
- (A) True. Kruskal takes edges in increasing order. The two lightest edges cannot form a cycle (a cycle needs at least 3 edges), so the second smallest edge is always taken.
- (B) True. If the 3rd smallest edge is taken, we are done. If it is rejected, it closes a triangle with the two smallest edges, so those three edges use up all the edges among their 3 vertices. The 4th edge then has an endpoint outside these 3 vertices, so it cannot form a cycle with the two smallest edges, and it is taken.
- (C) True. This is the cut property: for any cut, the lightest edge crossing it is in every MST.
- (D) False. Distinct weights give a unique MST.
Answer: (A), (B), (C)
The following simple undirected graph is referred to as the Peterson graph.
Which of the following statements is/are TRUE?
Which of the following statements is/are TRUE?
One or more options are correct.
Answer: (A), (B), (C)
Name the outer 5-cycle (clockwise from the top) and the inner points , with joined to and each joined to . Every vertex has degree 3 and there are 15 edges.
(A) True. The outer 5-cycle is an odd cycle, so at least 3 colours are needed. Three are enough: give colour 1, colour 2 and colour 3. No edge joins two vertices of the same colour. So the chromatic number is 3.
(B) True. The path uses only edges of the graph and visits all 10 vertices once. So a Hamiltonian path exists. (A Hamiltonian cycle does not exist, but the option asks only for a path.)
(C) True. The second graph has 10 vertices, every vertex has degree 3, and it has no triangle and no 4-cycle (checked from its edges: the outer 9-cycle with three chords and a centre joined to three outer vertices). A 3-regular graph on 10 vertices with no cycle shorter than 5 is the Petersen graph, since it is the only such graph. So the two graphs are isomorphic.
(D) False. is an independent set of size 4, so the largest one is not 3. It cannot be 5 either: five pairwise non-adjacent vertices would send out all 15 edges (3 each) to the other five vertices, so those five would have no edges among themselves, the graph would be bipartite, and that contradicts the 5-cycle. So the largest independent set has size 4.
Answer: (A), (B), (C)
(A) True. The outer 5-cycle is an odd cycle, so at least 3 colours are needed. Three are enough: give colour 1, colour 2 and colour 3. No edge joins two vertices of the same colour. So the chromatic number is 3.
(B) True. The path uses only edges of the graph and visits all 10 vertices once. So a Hamiltonian path exists. (A Hamiltonian cycle does not exist, but the option asks only for a path.)
(C) True. The second graph has 10 vertices, every vertex has degree 3, and it has no triangle and no 4-cycle (checked from its edges: the outer 9-cycle with three chords and a centre joined to three outer vertices). A 3-regular graph on 10 vertices with no cycle shorter than 5 is the Petersen graph, since it is the only such graph. So the two graphs are isomorphic.
(D) False. is an independent set of size 4, so the largest one is not 3. It cannot be 5 either: five pairwise non-adjacent vertices would send out all 15 edges (3 each) to the other five vertices, so those five would have no edges among themselves, the graph would be bipartite, and that contradicts the 5-cycle. So the largest independent set has size 4.
Answer: (A), (B), (C)