GATE 2017 (Session 1)
64 questions
MCQ 44 · NAT 201-mark 30 · 2-mark 34
Questions 36–40 of 64
Let G = (V, E) be any connected undirected edge-weighted graph. The weights of the edges in E are positive and distinct. Consider the following statements:
(I) Minimum spanning tree of G is always unique.
(II) Shortest path between any two vertices of G is always unique.
Which of the above statements is/are necessarily true?
(I) Minimum spanning tree of G is always unique.
(II) Shortest path between any two vertices of G is always unique.
Which of the above statements is/are necessarily true?
Answer: (A)
- (I) is true. Suppose two different MSTs and exist. Let e be the lightest edge that is in exactly one of them, say in . Adding e to makes a cycle. This cycle has an edge f that is not in (as has no cycle), so f is in exactly one tree and . Then is a spanning tree lighter than , which is impossible.
- (II) is false. Take a 4-cycle a-b-d-c with weights ab = 1, bd = 4, dc = 3, ca = 2. All weights are distinct and positive. From a to d, the path a-b-d costs and the path a-c-d costs . So there are two shortest paths.
Answer: (A)
- (II) is false. Take a 4-cycle a-b-d-c with weights ab = 1, bd = 4, dc = 3, ca = 2. All weights are distinct and positive. From a to d, the path a-b-d costs and the path a-c-d costs . So there are two shortest paths.
Answer: (A)
A multithreaded program P executes with x number of threads and uses y number of locks for ensuring mutual exclusion while operating on shared memory locations. All locks in the program are non-reentrant, i.e., if a thread holds a lock l, then it cannot re-acquire lock l without releasing it. If a thread is unable to acquire a lock, it blocks until the lock becomes available. The minimum value of x and the minimum value of y together for which execution of P can result in a deadlock are:
Answer: (D)
The locks are non-reentrant. Suppose one thread already holds lock l and tries to get l again. It blocks and waits for itself, so it never moves on. This means one thread and one lock are enough for a deadlock.
Answer: x = 1, y = 1
Answer: x = 1, y = 1
The value of
Answer: (C)
Put x = 1: the numerator is 1 2 + 1 = 0 and the denominator is 1 3 + 2 = 0. So the form is 0/0, and we use L'Hospital's rule.
Differentiate top and bottom, then put x = 1:
Answer: is 1
Differentiate top and bottom, then put x = 1:
Answer: is 1
Let p, q, and r be propositions and the expression (pq)r be a contradiction. Then, the expression (rp)q is
Answer: (D)
Read literally, cannot be a contradiction, because it is true whenever r is true. The paper means that p, q, r take values for which it is false. This means is true, and r is false.
Now r is false, so is true. That gives . So the expression is true exactly when q is true.
Answer: always TRUE when q is TRUE
Now r is false, so is true. That gives . So the expression is true exactly when q is true.
Answer: always TRUE when q is TRUE
Let u and v be two vectors in whose Euclidean norms satisfy ||u||=2|| v|| . What is the value of such that w=u+v bisects the angle between u and v ?
Answer: (A)
The bisector lies along the sum of the unit vectors: .
So w = u + 2v is the vector that bisects the angle: .
Answer: 2
So w = u + 2v is the vector that bisects the angle: .
Answer: 2