GATE 2025 (Session 1)
65 questions
MCQ 30 · MSQ 13 · NAT 221-mark 30 · 2-mark 35
Questions 46–50 of 65
Which of the following statement(s) is/are TRUE while computing and during top-down parsing by a compiler?
One or more options are correct.
Answer: (A), (D)
(A) True. If is a production, can derive the empty string, so is put in .
(B) False. The end marker is not the first symbol of anything a nonterminal derives, so it is never put in a First set. It appears only in Follow sets.
(C) False. is not an input symbol that can come after , so it is never put in any Follow set. Follow sets hold only terminals and .
(D) True. The start symbol derives the whole input, and the end marker comes right after the whole input. So is put in . ( may also be followed by other terminals if it appears on some right-hand side.)
Answer: (A), (D)
(B) False. The end marker is not the first symbol of anything a nonterminal derives, so it is never put in a First set. It appears only in Follow sets.
(C) False. is not an input symbol that can come after , so it is never put in any Follow set. Follow sets hold only terminals and .
(D) True. The start symbol derives the whole input, and the end marker comes right after the whole input. So is put in . ( may also be followed by other terminals if it appears on some right-hand side.)
Answer: (A), (D)
Consider a relational schema , with functional dependencies , .
The relation is decomposed into two relations, and . Which of the following statement(s) is/are TRUE?
The relation is decomposed into two relations, and . Which of the following statement(s) is/are TRUE?
One or more options are correct.
Answer: (B), (C)
Take the relation with the FDs . The attribute by itself determines all the other attributes, so is a candidate key of . The left-hand side of every FD () is a superkey. So is already in BCNF, and so also in 3NF, before any decomposition. This means "team is NOT in BCNF" and "team is NOT in 3NF" are both false.
Now the decomposition into and . In each part, stays a key, because it determines the one remaining attribute. So and are both in BCNF. True.
For the lossless check, the common attribute of the two parts is . We have (that is, alone determines all of ). This meets the standard lossless-join test: is a superkey of at least one of the two parts. True.
Answer: t1 and t2 are in BCNF; and the decomposition is lossless.
Now the decomposition into and . In each part, stays a key, because it determines the one remaining attribute. So and are both in BCNF. True.
For the lossless check, the common attribute of the two parts is . We have (that is, alone determines all of ). This meets the standard lossless-join test: is a superkey of at least one of the two parts. True.
Answer: t1 and t2 are in BCNF; and the decomposition is lossless.
Which of the following predicate logic formulae/formula is/are CORRECT representation(s) of the statement: "Everyone has exactly one mother"?
The meanings of the predicates used are:
is the mother of
and are not equal
The meanings of the predicates used are:
is the mother of
and are not equal
One or more options are correct.
Answer: (B), (D)
We need: for every person , a mother exists, and no one different from is also a mother of .
(B) : is a mother of , and every different from is not a mother of . This covers existence and uniqueness. Correct.
(D) : "not there exists" is "for all not", and . So . This is the same as (B). Correct.
(A) only says that some is not a mother of . That is easy to satisfy and does not stop from having two mothers. Wrong.
(C) means . So the inner part is true with whenever holds. The statement is always true and never forces a mother to exist. Wrong.
Answer: (B), (D)
(B) : is a mother of , and every different from is not a mother of . This covers existence and uniqueness. Correct.
(D) : "not there exists" is "for all not", and . So . This is the same as (B). Correct.
(A) only says that some is not a mother of . That is easy to satisfy and does not stop from having two mothers. Wrong.
(C) means . So the inner part is true with whenever holds. The statement is always true and never forces a mother to exist. Wrong.
Answer: (B), (D)
is the set of non-negative integers. Let be the set of functions from to itself. For any two functions, , we define
for every number in . Which of the following is/are CORRECT about the mathematical structure ?
for every number in . Which of the following is/are CORRECT about the mathematical structure ?
One or more options are correct.
Answer: (B)
The operation is . It adds two functions point by point, and the values are non-negative integers.
- Closure: Adding two non-negative integers gives a non-negative integer. So is closed under .
- Associativity: This follows from the fact that ordinary integer addition is associative.
- Identity: The constant-zero function gives for every . So an identity element exists.
- Commutativity: at every point, so is commutative.
- Inverses: Take a general , for example . We would need some with . This forces . But negative values are not allowed in the codomain . So inverses do not exist in general.
The structure is closed, associative, has an identity and is commutative. It has no inverses. So is an Abelian monoid, not a group.
Answer: (F, ⊙) is an Abelian monoid.
- Closure: Adding two non-negative integers gives a non-negative integer. So is closed under .
- Associativity: This follows from the fact that ordinary integer addition is associative.
- Identity: The constant-zero function gives for every . So an identity element exists.
- Commutativity: at every point, so is commutative.
- Inverses: Take a general , for example . We would need some with . This forces . But negative values are not allowed in the codomain . So inverses do not exist in general.
The structure is closed, associative, has an identity and is commutative. It has no inverses. So is an Abelian monoid, not a group.
Answer: (F, ⊙) is an Abelian monoid.
Consider the following deterministic finite automaton (DFA) defined over the alphabet, . Identify which of the following language(s) is/are accepted by the given DFA.
One or more options are correct.
Answer: (C)
Name the states (start), , and (the final state), from left to right. Each state records the longest suffix of the input read so far that is a prefix of : is none, is b, is ba, is bab.
Transitions: on a stays, on b goes to . on b stays, on a goes to . on b goes to , on a goes to . on a goes to , on b goes to .
So the DFA is in the final state exactly when the input ends with bab. This makes (C) true.
(A) False: has zero b's (even) but the start state is not final. (B) False: baba contains bab but ends in , which is not final. (D) False: a does not contain aba but ends in , which is not final.
Answer: (C)
Transitions: on a stays, on b goes to . on b stays, on a goes to . on b goes to , on a goes to . on a goes to , on b goes to .
So the DFA is in the final state exactly when the input ends with bab. This makes (C) true.
(A) False: has zero b's (even) but the start state is not final. (B) False: baba contains bab but ends in , which is not final. (D) False: a does not contain aba but ends in , which is not final.
Answer: (C)