GATE 2005
203 questions
MCQ 2031-mark 203
Questions 31–35 of 203
Answer: (A)
Probability of getting a red ball from box P:
Now the ball is known to be red. The probability that it came from box
Correct Answer:
Answer: (C)
, where is the cumulative distribution function.
(A) is the height of the density at one point. A density value is not a probability and can even exceed 1.
(B) is a difference of two density heights. It can be negative, and it is not .
(C) The integral of from to is exactly the probability above.
(D) is a partial first moment. It equals only when covers the whole range of .
Answer: (C)
i = 0;
do {
j = i + 1;
while ((j < n) && E1) j++;
if (j < n) E2;
} while (j < n);
flag = 1;
for (j = 0; j < n; j++)
if ((j! = i) && E3) flag = 0;
if (flag) printf("Sink exists") ;
else printf ("Sink does not exist"); Choose the correct expression for .
Answer: (D)
If the graph has a sink, its column in the adjacency matrix has all 1s (except the diagonal) and its row has all 0s (except the diagonal). The algorithm first finds one candidate and then checks it, so it runs in time.
Finding the candidate. is and is . While , has no edge to , so cannot be a sink (a sink needs an edge from every other vertex), and stays a candidate. When , has an outgoing edge, so it cannot be the sink. Also all earlier cannot be the sink. So the next candidate is , which is .
Checking the candidate. The code sets and the loop clears it for any that breaks the sink rule. is a sink only if and for every . So the flag must be cleared when this fails:
Why the others fail: (A) with clears the flag only when both rules fail, so a candidate that breaks only one rule would pass. (B) is true when both sink rules hold, so it would clear the flag for a real sink. (C) is also true for a real sink (when ), so it would clear the flag wrongly.
Answer: (D) i = 0;
do {
j = i + 1;
while ((j < n) && E1) j++;
if (j < n) E2;
} while (j < n);
flag = 1;
for (j = 0; j < n; j++)
if ((j! = i) && E3) flag = 0;
if (flag) printf("Sink exists") ;
else printf ("Sink does not exist"); Choose the correct expression for and .
Answer: (C)
If the graph has a sink, its column in the adjacency matrix has all 1's (except the diagonal) and its row has all 0's (except the diagonal). The algorithm first finds one candidate and then checks it, so it runs in time.
The options give and , so we pick these. The first loop looks for a vertex with no outgoing edge to any vertex after it. must keep the scan going while there is no edge from to :
While , can still be a sink, and cannot (a sink needs an edge from every other vertex). When , has an outgoing edge, so it cannot be a sink. All earlier also cannot be a sink, because there was no edge from to them. The next possible sink is itself, so
Other options: (A) and (D) use , which scans on while has an edge to , the opposite of what is needed. (B) uses , which skips , the vertex that must be tried next.
Answer: (C)Answer: (A)
Assume bit errors are independent. A bit on link is received correctly with probability , so all bits are correct with probability . For link it is .
The packet takes with probability or with probability . These are mutually exclusive events, so their probabilities add:
Why (D) is wrong: is the probability that all bits are in error, so (D) is the probability that not all bits are in error (at least one bit is correct). That is not the same as no bit being in error.
Answer: (A)