GATE 2009
66 questions
MCQ 661-mark 24 · 2-mark 42
Questions 56–60 of 66
Consider the following relational schema:
Suppliers(sid:integer, sname:string, city:string, street:string)
Parts(pid:integer, pname:string, color:string)
Catalog(sid:integer, pid:integer, cost:real) Assume that, in the suppliers relation above, each supplier and each street within a city has a unique name, and (sname, city) forms a candidate key. No other functional dependencies are implied other than those implied by primary and candidate keys. Which one of the following is TRUE about the above schema?Answer: (A)
A relation is in BCNF when, for every non-trivial dependency that holds, is a superkey. The question says the only dependencies are those implied by the primary and candidate keys.
Suppliers: the keys are sid and (sname, city). So the dependencies are sid (sname, city, street) and (sname, city) (sid, street). Every left side is a key, so it is in BCNF. Unique street names within a city do not add a dependency from street to anything.
Parts: the only dependency is pid (pname, color), and pid is the key. BCNF holds.
Catalog: the only dependency is (sid, pid) cost, and (sid, pid) is the key. BCNF holds.
Every relation is in BCNF, so the schema is in BCNF (and so also in 3NF and 2NF). Options (B), (C) and (D) all say the schema fails BCNF or a lower form, which is not so.
Answer: (A)
Suppliers: the keys are sid and (sname, city). So the dependencies are sid (sname, city, street) and (sname, city) (sid, street). Every left side is a key, so it is in BCNF. Unique street names within a city do not add a dependency from street to anything.
Parts: the only dependency is pid (pname, color), and pid is the key. BCNF holds.
Catalog: the only dependency is (sid, pid) cost, and (sid, pid) is the key. BCNF holds.
Every relation is in BCNF, so the schema is in BCNF (and so also in 3NF and 2NF). Options (B), (C) and (D) all say the schema fails BCNF or a lower form, which is not so.
Answer: (A)
Consider two transactions T1 and T2, and four schedules S1, S2, S3, S4 of T1 and T2
as given below:
Which of the above schedules are conflict-serializable?
Which of the above schedules are conflict-serializable?
Answer: (B)
A schedule is conflict serializable when its precedence graph has no cycle. Only RW, WR and WW pairs on the same item, from different transactions, add edges.
- S1: gives . also gives . But gives . Cycle, so not conflict serializable.
- S2: , and all give . This is the only edge, so S2 is conflict serializable.
- S3: , and all give . This is the only edge, so S3 is conflict serializable.
- S4: and give , but gives . Cycle, so not conflict serializable.
So S2 and S3 are conflict serializable.
Answer: (B)
- S1: gives . also gives . But gives . Cycle, so not conflict serializable.
- S2: , and all give . This is the only edge, so S2 is conflict serializable.
- S3: , and all give . This is the only edge, so S3 is conflict serializable.
- S4: and give , but gives . Cycle, so not conflict serializable.
So S2 and S3 are conflict serializable.
Answer: (B)
Frames of 1000 bits are sent over a bps duplex link between two hosts. The propagation time is 25ms. Frames are to be transmitted into this link to maximally pack them in transit (within the link).
Suppose that the sliding window protocol is used with the sender window size of , where l is the number of bits identified in the earlier part and acknowledgements are always piggy backed. After sending frames, what is the minimum time the sender will have to wait before starting transmission of the next frame? (Identify the closest choice ignoring the frame processing time.)
Suppose that the sliding window protocol is used with the sender window size of , where l is the number of bits identified in the earlier part and acknowledgements are always piggy backed. After sending frames, what is the minimum time the sender will have to wait before starting transmission of the next frame? (Identify the closest choice ignoring the frame processing time.)
Answer: (C)
Full duplex does not split the bandwidth: the link carries bps in each direction.
Step 1: frames needed to pack the link. At bps, 1000 frames of 1000 bits can be sent per second. In the 25 ms propagation time, the sender can put frames into the link. Numbering 25 frames needs bits, so .
Step 2: window. The window is frames.
Step 3: waiting time. The wait is the round trip time (RTT) minus the time spent sending the window.
Transmission time of one frame = ms, so 32 frames take 32 ms.
RTT = propagation of frame + transmission of frame + propagation of ACK + transmission of ACK
ms (the ACK is piggybacked on a frame of 1000 bits, so it also takes 1 ms).
Waiting time ms. For the first 32 ms the sender was transmitting, not waiting.
Answer: (C)
Step 1: frames needed to pack the link. At bps, 1000 frames of 1000 bits can be sent per second. In the 25 ms propagation time, the sender can put frames into the link. Numbering 25 frames needs bits, so .
Step 2: window. The window is frames.
Step 3: waiting time. The wait is the round trip time (RTT) minus the time spent sending the window.
Transmission time of one frame = ms, so 32 frames take 32 ms.
RTT = propagation of frame + transmission of frame + propagation of ACK + transmission of ACK
ms (the ACK is piggybacked on a frame of 1000 bits, so it also takes 1 ms).
Waiting time ms. For the first 32 ms the sender was transmitting, not waiting.
Answer: (C)
Frames of 1000 bits are sent over a bps duplex link between two hosts. The propagation time is 25ms. Frames are to be transmitted into this link to maximally pack them in transit (within the link).
What is the minimum number of bits (l) that will be required to represent the sequence numbers distinctly? Assume that no time gap needs to be given between transmission of two frames.
What is the minimum number of bits (l) that will be required to represent the sequence numbers distinctly? Assume that no time gap needs to be given between transmission of two frames.
Answer: (D)
In full duplex each direction has the full bps, so the bandwidth is not halved.
Transmission time of one frame .
One-way propagation time . In 25 ms the sender can put frames into the link, so 25 frames are in transit when the link is packed.
The sequence numbers must tell these 25 frames apart: . Since , .
Answer: (D)
Transmission time of one frame .
One-way propagation time . In 25 ms the sender can put frames into the link, so 25 frames are in transit when the link is packed.
The sequence numbers must tell these 25 frames apart: . Since , .
Answer: (D)
Let G(x) be the generator polynomial used for CRC checking. What is the condition that should be satisfied by G(x) to detect odd number of bits in error?
Answer: (C)
Let be the error polynomial, with one term for each bit in error. The receiver finds no error only when divides . An odd number of bit errors means has an odd number of terms, so with modulo-2 arithmetic , which is not 0.
If is a factor of , then . If divided , we would get , which is false. So can never divide such an , and every odd number of bit errors is detected.
Why the others fail:
(A) Having more than two terms does not stop from dividing some odd-weight error.
(B) not dividing for any k up to the frame length is the condition to detect all double-bit errors, because a double error is . It says nothing about odd errors.
(D) An odd number of terms gives , so is not a factor. That is the opposite of what is needed.
Answer: (C)
If is a factor of , then . If divided , we would get , which is false. So can never divide such an , and every odd number of bit errors is detected.
Why the others fail:
(A) Having more than two terms does not stop from dividing some odd-weight error.
(B) not dividing for any k up to the frame length is the condition to detect all double-bit errors, because a double error is . It says nothing about odd errors.
(D) An odd number of terms gives , so is not a factor. That is the opposite of what is needed.
Answer: (C)