GATE 2022
65 questions
MCQ 32 · MSQ 15 · NAT 181-mark 30 · 2-mark 35
Questions 51–55 of 65
Consider the following recurrence:
Then, which of the following statements is/are TRUE?
Then, which of the following statements is/are TRUE?
One or more options are correct.
Answer: (A), (B), (C)
Some values: , , , , , , , , , .
(A) True. . If , then .
(B) True. , and with this is . The base is .
(C) True. . If , then .
(D) False. For , .
Answer: (A), (B), (C)
(A) True. . If , then .
(B) True. , and with this is . The base is .
(C) True. . If , then .
(D) False. For , .
Answer: (A), (B), (C)
Which of the properties hold for the adjacency matrix of a simple undirected unweighted graph having vertices?
One or more options are correct.
Answer: (A)
(A) True. , because is symmetric with 0/1 entries. This is the number of neighbours of vertex , that is its degree.
(B) False. Take the path 1-2-3 (, so ). Entry (1, 2) of is 0, because there is no walk of length exactly 2 from 1 to 2 and the identity adds nothing off the diagonal.
(C) False. A sum of entries means at most edges. A triangle plus one isolated vertex (, 3 edges) satisfies this but has a cycle.
(D) False. Two disjoint edges on 4 vertices: every row and column has a 1, but the graph is not connected.
Answer: (A)
(B) False. Take the path 1-2-3 (, so ). Entry (1, 2) of is 0, because there is no walk of length exactly 2 from 1 to 2 and the identity adds nothing off the diagonal.
(C) False. A sum of entries means at most edges. A triangle plus one isolated vertex (, 3 edges) satisfies this but has a cycle.
(D) False. Two disjoint edges on 4 vertices: every row and column has a 1, but the graph is not connected.
Answer: (A)
Which of the following is/are the eigenvector(s) for the matrix given below?
One or more options are correct.
Answer: (A), (C), (D)
Multiply the matrix with each vector. Then see if the product is a multiple of that same vector:
- = 1v. This is True.
- The product is not a multiple. This is False.
- = 3v. This is True.
- = 3v. This is True.
Answer: Options 1, 3 and 4
- = 1v. This is True.
- The product is not a multiple. This is False.
- = 3v. This is True.
- = 3v. This is True.
Answer: Options 1, 3 and 4
Consider a system with 2 KB direct mapped data cache with a block size of 64 bytes. The system has a physical address space of 64 KB and a word length of 16 bits. During the execution of a program, four data words P, Q, R, and S are accessed in that order 10 times (i.e., PQRSPQRS...). Hence, there are 40 accesses to data cache altogether. Assume that the data cache is initially empty and no other data words are accessed by the program. The addresses of the first bytes of P, Q, R, and S are 0xA248, 0xC28A, 0xCA8A, and 0xA262, respectively. For the execution of the above program, which of the following statements is/are TRUE with respect to the data cache?
One or more options are correct.
Answer: (A), (B), (D)
Number of lines = 2 KB / 64 B = 32. A 16-bit address splits into tag 5 bits, index 5 bits and offset 6 bits. Block number = address / 64, and line = block number mod 32.
- P = 0xA248 block 649 line 9
- Q = 0xC28A block 778 line 10
- R = 0xCA8A block 810 line 10
- S = 0xA262 block 649 line 9 (same block as P)
- S is always accessed after P has already loaded that block so every S access is a hit. True
- Only P and S use line 9 so P is never evicted. True
- Q and R use the same line 10 so every R access evicts Q. True
- At the end, the block of P (which holds S) and R are in the cache. So it is not "only R and S". False
Answer: Options 1, 2 and 4
- P = 0xA248 block 649 line 9
- Q = 0xC28A block 778 line 10
- R = 0xCA8A block 810 line 10
- S = 0xA262 block 649 line 9 (same block as P)
- S is always accessed after P has already loaded that block so every S access is a hit. True
- Only P and S use line 9 so P is never evicted. True
- Q and R use the same line 10 so every R access evicts Q. True
- At the end, the block of P (which holds S) and R are in the cache. So it is not "only R and S". False
Answer: Options 1, 2 and 4
Consider routing table of an organization's router shown below:
Which of the following prefixes in CIDR notation can be collectively used to correctly aggregate all of the subnets in the routing table?
Which of the following prefixes in CIDR notation can be collectively used to correctly aggregate all of the subnets in the routing table?
One or more options are correct.
Answer: (B), (D)
Write each subnet as a range of the third octet (all are in 12.20.x.0):
- 164.0/22 164 to 167
- 166.0/23 166 to 167 (already inside the first)
- 168.0/23 168 to 169
- 170.0/23 170 to 171
Together they cover exactly 164 to 171. An aggregate should cover these addresses and no others. An address that is not in the table must go to the default route R3, but a wider aggregate would send it along the wrong next hop.
- (B) 12.20.164.0/22 covers 164 to 167 and (D) 12.20.168.0/22 covers 168 to 171. Together they match the table exactly.
- (C) /21 blocks are 8 wide and start at a multiple of 8, so 12.20.164.0/21 is really 160 to 167. It leaves out 168 to 171 and adds 160 to 163.
- (A) /20 blocks are 16 wide, so 12.20.164.0/20 is 160 to 175. It adds 160 to 163 and 172 to 175, which are not in the table.
Answer: (B), (D)
- 164.0/22 164 to 167
- 166.0/23 166 to 167 (already inside the first)
- 168.0/23 168 to 169
- 170.0/23 170 to 171
Together they cover exactly 164 to 171. An aggregate should cover these addresses and no others. An address that is not in the table must go to the default route R3, but a wider aggregate would send it along the wrong next hop.
- (B) 12.20.164.0/22 covers 164 to 167 and (D) 12.20.168.0/22 covers 168 to 171. Together they match the table exactly.
- (C) /21 blocks are 8 wide and start at a multiple of 8, so 12.20.164.0/21 is really 160 to 167. It leaves out 168 to 171 and adds 160 to 163.
- (A) /20 blocks are 16 wide, so 12.20.164.0/20 is 160 to 175. It adds 160 to 163 and 172 to 175, which are not in the table.
Answer: (B), (D)