GATE 2021 (Session 2)
64 questions
MCQ 33 · MSQ 13 · NAT 181-mark 29 · 2-mark 35
Questions 46–50 of 64
For two n-dimensional real vectors and , the operation is defined as follows:
Let be a set of 10-dimensional non-zero real vectors such that for every pair of distinct vectors . What is the maximum cardinality possible for the set ?
Let be a set of 10-dimensional non-zero real vectors such that for every pair of distinct vectors . What is the maximum cardinality possible for the set ?
Answer: (B)
is the dot product, so is a set of non-zero vectors that are pairwise orthogonal.
Such vectors are linearly independent. Suppose . Take the dot product with . Every term with vanishes, leaving . Since , for every .
has dimension 10, so it holds at most 10 linearly independent vectors. The 10 unit vectors along the axes are pairwise orthogonal, so 10 is reached.
Answer: (B)
Such vectors are linearly independent. Suppose . Take the dot product with . Every term with vanishes, leaving . Since , for every .
has dimension 10, so it holds at most 10 linearly independent vectors. The 10 unit vectors along the axes are pairwise orthogonal, so 10 is reached.
Answer: (B)
For a statement S in a program, in the context of liveness analysis, the following sets are defined:
USE(S) : the set of variables used in S
IN(S) : the set of variables that are live at the entry of S
OUT(S) : the set of variables that are live at the exit of S
Consider a basic block that consists of two statements, S1 followed by S2. Which one of the following statements is correct?
USE(S) : the set of variables used in S
IN(S) : the set of variables that are live at the entry of S
OUT(S) : the set of variables that are live at the exit of S
Consider a basic block that consists of two statements, S1 followed by S2. Which one of the following statements is correct?
Answer: (A)
Inside a basic block, control moves directly from S1 to S2. So the variables live at the exit of S1 are the same as the variables live at the entry of S2, that is, OUT(S1) = IN(S2).
Answer: OUT(S1) = IN(S2)
Answer: OUT(S1) = IN(S2)
For constants and , consider the following recurrence defined on the non-negative integers:
Which one of the following options is correct about the recurrence ?
Which one of the following options is correct about the recurrence ?
Answer: (C)
This matches case 1 of the Master theorem exactly. If for some , then .
The other options are not right in general.
- (A) fails when and . Then and , so case 1 gives , not .
- (B) fails when and . Then , and the top level alone costs , which is much more than . In fact .
- (D) is case 2 of the Master theorem. It gives an extra log factor: , not .
Answer: (C)
The other options are not right in general.
- (A) fails when and . Then and , so case 1 gives , not .
- (B) fails when and . Then , and the top level alone costs , which is much more than . In fact .
- (D) is case 2 of the Master theorem. It gives an extra log factor: , not .
Answer: (C)
Suppose the following functional dependencies hold on a relation U with attributes :
Which of the following functional dependencies can be inferred from the above functional dependencies?
Which of the following functional dependencies can be inferred from the above functional dependencies?
One or more options are correct.
Answer: (A), (C), (D)
Let us test each statement one by one:
- by decomposition. This is True.
- by augmentation, and then . This is True.
- . This is True.
- : here , so it cannot be implied. This is False.
Answer:
- by decomposition. This is True.
- by augmentation, and then . This is True.
- . This is True.
- : here , so it cannot be implied. This is False.
Answer:
For a string , we define to be the reverse of . For example, if then .
Which of the following languages is/are context-free?
Which of the following languages is/are context-free?
One or more options are correct.
Answer: (B), (C), (D)
- (A) : the pair and the pair cross, since x sits between w and but comes after . A stack matches only nested pairs, so this is not a CFL. Proof sketch with the pumping lemma (length p) on (w = , x = ):
Any member of the form (all at least 1) has w starting with 0 and x starting with 1, and w, carry equal numbers of 0/1 changes, while the string has only three. This forces either ( and ) or ( and ). A string is never a member.
Since , the pumped part touches at most two neighbouring blocks. In blocks 1 and 2: if it adds a's, pump up (then , not a member); otherwise it only changes the 1-block, so pump down (then and , not a member). In blocks 3 and 4 it is the mirror image: if it adds 1's (so , with ) pump up; otherwise pump down. In blocks 2 and 3: if it changes both blocks, pump up; if only one, pump down. Every case leaves the language.
- (B) : two even palindromes one after the other, . It is a CFL.
- (C) : take . Then x is any string, so the language is all of , which is regular and so a CFL.
- (D) : this is , an even palindrome, with the pairs nested, . It is a CFL.
Answer: (B), (C), (D)
Any member of the form (all at least 1) has w starting with 0 and x starting with 1, and w, carry equal numbers of 0/1 changes, while the string has only three. This forces either ( and ) or ( and ). A string is never a member.
Since , the pumped part touches at most two neighbouring blocks. In blocks 1 and 2: if it adds a's, pump up (then , not a member); otherwise it only changes the 1-block, so pump down (then and , not a member). In blocks 3 and 4 it is the mirror image: if it adds 1's (so , with ) pump up; otherwise pump down. In blocks 2 and 3: if it changes both blocks, pump up; if only one, pump down. Every case leaves the language.
- (B) : two even palindromes one after the other, . It is a CFL.
- (C) : take . Then x is any string, so the language is all of , which is regular and so a CFL.
- (D) : this is , an even palindrome, with the pairs nested, . It is a CFL.
Answer: (B), (C), (D)