GATE 2019
65 questions
MCQ 41 · NAT 241-mark 30 · 2-mark 35
Questions 41–45 of 65
Which one of the following languages over is NOT context-free?
Answer: (C)
- : even palindromes, so CFL.
- : nested, and on the outside and inside, so CFL: .
- : the union of , and , each a CFL, so CFL.
- : the pair has inside it, while the pair has inside it. The pairs cross instead of nesting, and one stack can only match nested pairs. So this is not a CFL.
Answer: (C)
- : nested, and on the outside and inside, so CFL: .
- : the union of , and , each a CFL, so CFL.
- : the pair has inside it, while the pair has inside it. The pairs cross instead of nesting, and one stack can only match nested pairs. So this is not a CFL.
Answer: (C)
Let the set of functional dependencies hold on a relation schema X = (PQRS). X is not in BCNF. Suppose X is decomposed into two schemas Y and Z where Y = (PR) and Z = (QRS).
Consider the two statements given below:
I. Both Y and Z are in BCNF
II. Decomposition of X into Y and Z is dependency preserving and lossless.
Which of the above statements is/are correct?
Consider the two statements given below:
I. Both Y and Z are in BCNF
II. Decomposition of X into Y and Z is dependency preserving and lossless.
Which of the above statements is/are correct?
Answer: (C)
Keys of X: R is on no right side, and . and (since ), so the keys are and .
Statement I:
- Y(P, R): the dependency is , and is the key, so Y is in BCNF.
- Z(Q, R, S): the dependencies are and . In , is not a superkey of Z, so Z is not in BCNF. So I is false.
Statement II:
- Dependency preserving: sits in Y. and sit in Z. All three are kept.
- Lossless: the common attribute is , and makes a key of Y. So the join is lossless. II is true.
Answer: (C)
Statement I:
- Y(P, R): the dependency is , and is the key, so Y is in BCNF.
- Z(Q, R, S): the dependencies are and . In , is not a superkey of Z, so Z is not in BCNF. So I is false.
Statement II:
- Dependency preserving: sits in Y. and sit in Z. All three are kept.
- Lossless: the common attribute is , and makes a key of Y. So the join is lossless. II is true.
Answer: (C)
Assume that in a certain computer, the virtual addresses are 64 bits long and the physical addresses are 48 bits long. The memory is word addressable. The page size is 8kB and the word size is 4 bytes. The Translation Look-aside Buffer (TLB) in the address translation path has 128 valid entries. At most how many distinct virtual addresses can be translated without any TLB miss?
Answer: (B)
The memory is word addressable and a word is 4 bytes. So a page of 8 KB / 4 B holds words, which is 2048 addresses.
128 TLB entries map 128 pages, giving addresses with no TLB miss.
Answer:
128 TLB entries map 128 pages, giving addresses with no TLB miss.
Answer:
Consider the following sets:
S1: Set of all recursively enumerable languages over the alphabet {0, 1}.
S2: Set of all syntactically valid C programs.
S3: Set of all languages over the alphabet {0, 1}.
S4: Set of all non-regular languages over the alphabet {0, 1}.
Which of the above sets are uncountable?
S1: Set of all recursively enumerable languages over the alphabet {0, 1}.
S2: Set of all syntactically valid C programs.
S3: Set of all languages over the alphabet {0, 1}.
S4: Set of all non-regular languages over the alphabet {0, 1}.
Which of the above sets are uncountable?
Answer: (B)
Let us check each set:
- S1: every RE language has a TM, and all TMs can be listed so it is countable.
- S2: C programs are finite strings so it is countable.
- S3: the set of all languages is the power set of so it is uncountable.
- S4: take S3 and remove the countably many regular languages. What is left is still uncountable.
Answer: S3 and S4
- S1: every RE language has a TM, and all TMs can be listed so it is countable.
- S2: C programs are finite strings so it is countable.
- S3: the set of all languages is the power set of so it is uncountable.
- S4: take S3 and remove the countably many regular languages. What is left is still uncountable.
Answer: S3 and S4
Consider the first order predicate formula:
Here 'a|b' denotes that 'a divides b', where a and b are integers. Consider the following sets:
S1: {1, 2, 3, ..., 100}
S2: Set of all positive integers
S3: Set of all integers
Which of the above sets satisfy ?
Here 'a|b' denotes that 'a divides b', where a and b are integers. Consider the following sets:
S1: {1, 2, 3, ..., 100}
S2: Set of all positive integers
S3: Set of all integers
Which of the above sets satisfy ?
Answer: (C)
The formula says: for every whose only divisors are 1 and (a prime, or 1), there is a larger whose only divisors are 1 and (a prime). Here the divisors are taken as positive numbers, as in the definition of a prime. If is not of that kind, the left side is false and the implication is true for that .
- S1 = {1, ..., 100}: take , a prime. The numbers 98, 99, 100 are not prime, so S1 has no larger prime . S1 fails.
- S2 (positive integers): for any prime there is a larger prime, as there are infinitely many primes. For take . For a composite the left side is false. S2 satisfies the formula.
- S3 (all integers): the positive integers work as in S2. For or a negative , a positive divisor other than 1 and exists (such as 2 for 0, or ), so the left side is false. For take . S3 satisfies the formula.
So S2 and S3 satisfy it.
Answer: (C)
- S1 = {1, ..., 100}: take , a prime. The numbers 98, 99, 100 are not prime, so S1 has no larger prime . S1 fails.
- S2 (positive integers): for any prime there is a larger prime, as there are infinitely many primes. For take . For a composite the left side is false. S2 satisfies the formula.
- S3 (all integers): the positive integers work as in S2. For or a negative , a positive divisor other than 1 and exists (such as 2 for 0, or ), so the left side is false. For take . S3 satisfies the formula.
So S2 and S3 satisfy it.
Answer: (C)