GATE 2015 (Session 1)
65 questions
MCQ 45 · NAT 201-mark 30 · 2-mark 35
Questions 26–30 of 65
Which one of the following fields of an IP header is NOT modified by a typical IP router?
Answer: (B)
A router lowers the TTL value, works out the checksum again, and changes the length when it fragments a packet. The source address is not changed. The only exception is NAT, and that is not normal routing.
Answer: Source address
Answer: Source address
In one of the pairs of protocols given below, both the protocols can use multiple TCP connections between the same client and the server. Which one is that?
Answer: (A)
Let us look at each protocol:
- HTTP: a browser is able to open many TCP connections at the same time to one server.
- FTP: it has one control connection and separate data connections.
TELNET and SMTP work with only one connection.
Answer: HTTP, FTP
- HTTP: a browser is able to open many TCP connections at the same time to one server.
- FTP: it has one control connection and separate data connections.
TELNET and SMTP work with only one connection.
Answer: HTTP, FTP
For any two languages L1 and L2 such that L1 is context-free and L2 is recursively enumerable but not recursive, which of the following is/are necessarily true?
I. (complement of L1) is recursive
II. (complement of L2) is recursive
III. is context-free
IV. is recursively enumerable
I. (complement of L1) is recursive
II. (complement of L2) is recursive
III. is context-free
IV. is recursively enumerable
Answer: (D)
Let us go through each statement:
- I: A CFL can be decided, and recursive languages stay recursive under complement True
- II: Suppose is recursive. Then L2 would also be recursive False
- III: CFLs do not stay closed under complement so it is not necessarily true
- IV: is recursive (so it is also RE), and RE languages are closed under union True
Answer: I and IV only
- I: A CFL can be decided, and recursive languages stay recursive under complement True
- II: Suppose is recursive. Then L2 would also be recursive False
- III: CFLs do not stay closed under complement so it is not necessarily true
- IV: is recursive (so it is also RE), and RE languages are closed under union True
Answer: I and IV only
Consider a system with byte-addressable memory, 32-bit logical addresses, 4 kilobyte page size and page table entries of 4 bytes each. The size of the page table in the system in megabytes is ________ .
Answer: 4
Find the count of pages first:
The page table size is B, which is 4 MB.
Answer: 4
The page table size is B, which is 4 MB.
Answer: 4
The following two functions P1 and P2 that share a variable B with an initial value of 2 execute concurrently.
The number of distinct values that B can possibly take after the execution is______________.
P1( ) { P2( ) {
C = B - 1; D = 2 * B;
B = 2 * C; B = D - 1;
} } The number of distinct values that B can possibly take after the execution is______________.
Answer: 3
B starts at 2. Let P1 have steps a: C = B - 1 and b: B = 2C. Let P2 have steps c: D = 2B and d: B = D - 1. Here a comes before b and c comes before d. There are 6 orders:
- a b c d: C = 1, B = 2, D = 4, B = 3 3
- a c b d: C = 1, D = 4, B = 2, B = 3 3
- a c d b: C = 1, D = 4, B = 3, B = 2 2
- c a b d: D = 4, C = 1, B = 2, B = 3 3
- c a d b: D = 4, C = 1, B = 3, B = 2 2
- c d a b: D = 4, B = 3, C = 2, B = 4 4
These cover every interleaving. The distinct values are {2, 3, 4}, so the count is 3.
Answer: 3
- a b c d: C = 1, B = 2, D = 4, B = 3 3
- a c b d: C = 1, D = 4, B = 2, B = 3 3
- a c d b: C = 1, D = 4, B = 3, B = 2 2
- c a b d: D = 4, C = 1, B = 2, B = 3 3
- c a d b: D = 4, C = 1, B = 3, B = 2 2
- c d a b: D = 4, B = 3, C = 2, B = 4 4
These cover every interleaving. The distinct values are {2, 3, 4}, so the count is 3.
Answer: 3