GATE 2003
107 questions
MCQ 1071-mark 107
Questions 6–10 of 107
Which of the following is a valid first order formula? (Here and are first order formulae with x as their only free variable)
Answer: (D)
Test each formula.
(A) is not valid. Take the domain with true, false and false everywhere. is false, so the left side is true. But is false, so the right side is false.
(B) is not valid. Take true and false everywhere. The left side is true and the right side is false.
(C) is not valid. Take the domain with true, false, true. The inner implication is true because is true, but is false.
(D) is valid. Assume and . For any , is true and is true, so is true. So holds.
Answer: (D)
(A) is not valid. Take the domain with true, false and false everywhere. is false, so the left side is true. But is false, so the right side is false.
(B) is not valid. Take true and false everywhere. The left side is true and the right side is false.
(C) is not valid. Take the domain with true, false, true. The inner implication is true because is true, but is false.
(D) is valid. Assume and . For any , is true and is true, so is true. So holds.
Answer: (D)
Let (S,) be a partial order with two minimal elements a and b, and a maximum element c.
Let P:S {True, False} be a predicate defined on S . Suppose that P(a) = True, P(b) =False and P(x) p(y) for all x,y S satisfying xy, where stands for logical implication. Which of the following statements CANNOT be true?
Let P:S {True, False} be a predicate defined on S . Suppose that P(a) = True, P(b) =False and P(x) p(y) for all x,y S satisfying xy, where stands for logical implication. Which of the following statements CANNOT be true?
Answer: (D)
whenever means that once is true it stays true for everything above. Since is the maximum, and .
(D) asks for false for every with and . The element satisfies both conditions, so would have to be false. But is true and , so must be true. This is a contradiction, so (D) cannot be true.
The others can be true. Take with and .
(A): let be true for and and false only for . The rule holds: the only false value is at , and is minimal, so nothing true lies below it.
(B): must be false for the elements other than and ; here that is , and is false as given.
(C): the elements above other than are just itself, and is false.
Answer: (D)
(D) asks for false for every with and . The element satisfies both conditions, so would have to be false. But is true and , so must be true. This is a contradiction, so (D) cannot be true.
The others can be true. Take with and .
(A): let be true for and and false only for . The rule holds: the only false value is at , and is minimal, so nothing true lies below it.
(B): must be false for the elements other than and ; here that is , and is false as given.
(C): the elements above other than are just itself, and is false.
Answer: (D)
Let f : AB be an injective (one-to-one) function.
Define as:
g(C) = {f (x)| x C}, for all subsets C of A.
Define as :
h(D) = {x | x A, f (x) D}, for all subsets D of B.
Which of the following statements is always true?
Define as:
g(C) = {f (x)| x C}, for all subsets C of A.
Define as :
h(D) = {x | x A, f (x) D}, for all subsets D of B.
Which of the following statements is always true?
Answer: (A)
Here is the image of under , and is the set of elements of whose image lies in (a preimage). The options read against .
Proof of : take . Then for some . By the definition of , and . So . This holds for every .
The other options can fail. Take , , , .
Option B (): for , , so , which does not contain . (It would hold for all only if were onto.)
Option C (empty intersection with ): for , , , which meets .
Option D: means it never meets , so the intersection is always empty.
Answer: (A)
Proof of : take . Then for some . By the definition of , and . So . This holds for every .
The other options can fail. Take , , , .
Option B (): for , , so , which does not contain . (It would hold for all only if were onto.)
Option C (empty intersection with ): for , , , which meets .
Option D: means it never meets , so the intersection is always empty.
Answer: (A)
Consider the set of all strings over the alphabet ={0,1}. with the
concatenation operator for strings
Answer: (A)
Check the group properties for concatenation on :
- Closed: joining two strings gives a string.
- Associative: .
- Identity: the empty string works on both sides, .
- Inverse: for a non-empty string , any product has length at least 1, so it is never . So non-empty strings have no inverse.
So it is not a group, and (A) is true.
(B) is wrong, since it is not a group at all.
(C) is wrong, since is a right identity.
(D) is wrong. Removing removes the identity, and the inverses are still missing.
Answer: (A)
- Closed: joining two strings gives a string.
- Associative: .
- Identity: the empty string works on both sides, .
- Inverse: for a non-empty string , any product has length at least 1, so it is never . So non-empty strings have no inverse.
So it is not a group, and (A) is true.
(B) is wrong, since it is not a group at all.
(C) is wrong, since is a right identity.
(D) is wrong. Removing removes the identity, and the inverses are still missing.
Answer: (A)
Let G = (V,E) be a directed graph with n vertices. A path from to in G is a sequence of vertices (,,....., ) such that (,)E for all k in i through j - 1. A simple path is a path in which no vertex appears more than once.
Let A be an n x n array initialized as follows.
Consider the following algorithm
Let A be an n x n array initialized as follows.
Consider the following algorithm
for i = 1 to n
for j = 1 to n
for k = 1 to n
A [j , k] = max (A[j, k], A[j, i] + A [i, k]); Which of the following statements is necessarily true for all j and k after termination of the above algorithm?Answer: (D)
The loop is a Floyd-Warshall style update with sums: . Values only grow.
Why D holds. Claim: after iteration i, is at least the number of edges of every simple path from j to k whose middle vertices are among . For , the paths are single edges, and those have . A simple path that uses i only once splits at i into a path from j to i and a path from i to k, both with middle vertices below i. By the claim for the earlier iteration, and are at least their lengths, so the update gives the length of the whole path. After the last iteration the claim covers every simple path. So every simple path from j to k has at most edges.
Why A, B, C fail.
- Graph with one edge 1 to 2: the final array is . but there is no Hamiltonian cycle, so B fails. The longest path from 1 to 2 has length 1 but , so C fails.
- Graph with edges 1 to 2 and 2 to 1: the final array is . , so A fails.
Answer: (D)
Why D holds. Claim: after iteration i, is at least the number of edges of every simple path from j to k whose middle vertices are among . For , the paths are single edges, and those have . A simple path that uses i only once splits at i into a path from j to i and a path from i to k, both with middle vertices below i. By the claim for the earlier iteration, and are at least their lengths, so the update gives the length of the whole path. After the last iteration the claim covers every simple path. So every simple path from j to k has at most edges.
Why A, B, C fail.
- Graph with one edge 1 to 2: the final array is . but there is no Hamiltonian cycle, so B fails. The longest path from 1 to 2 has length 1 but , so C fails.
- Graph with edges 1 to 2 and 2 to 1: the final array is . , so A fails.
Answer: (D)