CS GATE'14 Paper 03678678
CS GATE'14 Paper 03678678
CS GATE'14 Paper 03678678
com
Indias No.1 institute for GATE Training 1 Lakh+ Students trained till date 65+ Centers across India
1
Q. No. 1 5 Carry One Mark Each
1. While trying to collect an envelope from under the table, Mr. X fell down and
I II III
was losing consciousness.
IV
Which one of the above underlined parts of the sentence is NOT appropriate?
(A) I (B) II (C) III (D) IV
Answer: (D)
2. If she _______________ how to calibrate the instrument, she _______________ done the
experiment.
(A) knows, will have (B) knew, had
(C) had known, could have (D) should have known, would have
Answer: (C)
3. Choose the word that is opposite in meaning to the word coherent.
(A) sticky (B) well-connected (C) rambling (D) friendly
Answer: (C)
4. Which number does not belong in the series below?
2, 5, 10, 17, 26, 37, 50, 64
(A) 17 (B) 37 (C) 64 (D) 26
Answer: (C)
5. The table below has question-wise data on the performance of students in an examination.
The marks for each question are also listed. There is no negative or partial marking in the
examination.
Q.No Marks Answered
Correctly
Answered
Wrongly
Not
Attempted
1 2 21 17 6
2 3 15 27 2
3 2 23 18 3
What is the average of the marks obtained by the class in the examination?
(A) 1.34 (B) 1.74 (C) 3.02 (D) 3.91
CS-GATE-2014 PAPER-03| www.gateforum.com
Indias No.1 institute for GATE Training 1 Lakh+ Students trained till date 65+ Centers across India
2
Answer: (C)
Exp: Total question
442=88
443=132
144 = 88
132 308
Total marks obtained= (212) + (153) + (232) =133
Total Number of students=44
Average
133
3.02
44
= =
Q. No. 6 10 Carry One Mark Each
6. A dance programme is scheduled for 10.00 a.m. Some students are participating in the
programme and they need to come an hour earlier than the start of the event. These students
should be accompanied by a parent. Other students and parents should come in time for the
programme. The instruction you think that is appropriate for this is
(A) Students should come at 9.00 a.m. and parents should come at 10.00 a.m.
(B) Participating students should come at 9.00 a.m. accompanied by a parent, and other
parents and students should come by 10.00 a.m.
(C) Students who are not participating should come by 10.00 a.m. and they should not bring
their parents. Participating students should come at 9.00 a.m.
(D) Participating students should come before 9.00 a.m. Parents who accompany them should
come at 9.00 a.m. All others should come at 10.00 a.m.
Answer: (B)
7. By the beginning of the 20th century, several hypotheses were being proposed, suggesting a
paradigm shift in our understanding of the universe. However, the clinching evidence was
provided by experimental measurements of the position of a star which was directly behind
our sun.
Which of the following inference(s) may be drawn from the above passage?
(i) Our understanding of the universe changes based on the positions of stars
(ii) Paradigm shifts usually occur at the beginning of centuries
(iii) Stars are important objects in the universe
(iv) Experimental evidence was important in confirming this paradigm shift
(A) (i), (ii) and (iv) (B) (iii) only (C) (i) and (iv) (D) (iv) only
Answer: (D)
CS-GATE-2014 PAPER-03| www.gateforum.com
Indias No.1 institute for GATE Training 1 Lakh+ Students trained till date 65+ Centers across India
3
8. The Gross Domestic Product (GDP) in Rupees grew at 7% during 2012-2013. For
international comparison, the GDP is compared in US Dollars (USD) after conversion based
on the market exchange rate. During the period 2012-2013 the exchange rate for the USD
increased from Rs. 50/ USD to Rs. 60/ USD. Indias GDP in USD during the period 2012-
2013
(A) increased by 5 % (B) decreased by 13%
(C) decreased by 20% (D) decreased by 11%
Answer: (D)
Exp: Per 100 Rs final value 107 Rs
100
Per Dollars
50
final value
107
60
for 100 dollars____?
100 50 107
89.16
100 60
= =
Decreased by 11%.
9. he ratio of male to female students in a college for five years is plotted in the following line
graph. If the number of female students in 2011 and 2012 is equal, what is the ratio of male
students in 2012 to male students in 2011?
(A) 1:1 (B) 2:1 (C) 1.5:1 (D) 2.5:1
Answer: (C)
Exp: Take number of female students in 2011=100
Number of male in 2011=100
No. of female in 2012=100
No. of male in 2012=150
150
Ratio
100
= = 1.5: 1
10. Consider the equation: (7526)
8
- (Y)
8
= (4364)
8
, where (X)
N
stands for X to the base N. Find
Y.
(A) 1634 (B) 1737 (C) 3142 (D) 3162
Answer: (C)
3.5
3
2.5
2
1.5
1
0.5
0
2008 2009 2010 2011 2012
Ra
tio
of
m
ale
to
fe
m
ale
stu
de
nts
CS-GATE-2014 PAPER-03| www.gateforum.com
Indias No.1 institute for GATE Training 1 Lakh+ Students trained till date 65+ Centers across India
4
Q. No. 1 25 Carry One Mark Each
1. Consider the following statements:
P: Good mobile phones are not cheap
Q: Cheap mobile phones are not good
L: P implies Q
M: Q implies P
N: P is equivalent to Q
Which one of the following about L, M, and N is CORRECT?
(A) Only L is TRUE. (B) Only M is TRUE.
(C) Only N is TRUE. (D) L, M and N are TRUE.
Answer: (D)
Exp:
( ) [ ]
( )
g : mobile is good c : mobile is cheap
P: Good mobile phones are not cheap g c g c a b a b
Q: Cheap mobile phones are not good c g c g
Both P and Q are equivalent which means P and Q imply each other
2. Let X and Y be finite sets and f : X Y be a function. Which one of the following
statements is TRUE?
(A) For any subsets A and B of X, ( ) ( ) ( ) f A B f A f B = +
(B) For any subsets A and B of X, ( ) ( ) ( ) f A B f A f B =
(C) For any subsets A and B of X, ( ) ( ) ( )
{ }
f A B min f A , f B =
(D) For any subsets S and T of Y, ( ) ( ) ( )
1 1 1
f S T f S f T
=
Answer: (D)
Exp: ( ) ( ) ( ) f : X Y defined by f a 1, f b 1, f c 2 where = = =
{ } { }
{ } { }
( ) ( ) ( )
( ) { } ( ) { } ( ) { }
( ) ( ) { }
( )
X a, b, c Y 1, 2
Let A a, c , B b, c be subsets of X
then f A B 2 ; f A 2 ; f B 2
f A B 2 ; f A 1, 2 ;f B 1, 2
f A f B 1, 2
f A B 1
= =
= =
= = =
= = =
=
=
Options (A), (B), (C) are not true
Hence, option (D) is true
CS-GATE-2014 PAPER-03| www.gateforum.com
Indias No.1 institute for GATE Training 1 Lakh+ Students trained till date 65+ Centers across India
5
3. Let G be a group with 15 elements. Let L be a subgroup of G. It is known that L G and that
the size of L is at least 4. The size of L is _______.
Answer: (5)
Exp: Order of subgroup divides order of group (Lagranges theorem).
3, 5 and 15 can be the order of subgroup. As subgroup has atleast 4 elements and it is not
equal to the given group, order of subgroup cant be 3 and 15. Hence it is 5.
4. Which one of the following statements is TRUE about every n n matrix with only real
eigenvalues?
(A) If the trace of the matrix is positive and the determinant of the matrix is negative, at least
one of its eigenvalues is negative.
(B) If the trace of the matrix is positive, all its eigenvalues are positive.
(C) If the determinant of the matrix is positive, all its eigenvalues are positive.
(D) If the product of the trace and determinant of the matrix is positive, all its eigenvalues are
positive.
Answer: (A)
Exp: If the trace of the matrix is positive and the determinant of the matrix is negative then atleast
one of its eigen values is negative.
Since determinant = product of eigen values.
5. If V
1
and V
2
are 4-dimensional subspaces of a 6-dimensional vector space V, then the smallest
possible dimension of
1 2
V V is _______.
Answer: (2)
Exp: Let the basis of 6-dimensional vector space be {e1, e2, e3,e4, e5, e6}. In order for V1 V2 to
have smallest possible dimension V1 and V2 could be, say, {e1, e2, e3,e4} and {e3, e4, e5,
e6} respectively. The basis of V1 V2 would then be {e3, e4}. => Smallest possible
dimension = 2.
6. If
2
0
xsinx
( =
= + =
(
< <
+ =
+ + + ( =
+ + + ( = = =
CS-GATE-2014 PAPER-03| www.gateforum.com
Indias No.1 institute for GATE Training 1 Lakh+ Students trained till date 65+ Centers across India
6
7. Consider the following minterm expression for F.
( ) F P, Q, R,S 0, 2, 5, 7, 8, 10, 13, 15 =
The minterms 2, 7, 8 and 13 are do not care terms. The minimal sum of-products form for F
is
(A) QS QS +
(B) QS QS +
(C) Q R S Q R S QRS QRS + + +
(B) PQS PQS PQS PQS + + +
Answer: (B)
Exp: The K-map for the function F is as follows:-
( )
1 2
1 2
P QS and P QS
F P, Q, R,S P P
QS QS
= =
= +
= +
8. Consider the following combinational function block involving four Boolean variables x, y, a,
b where x, a, b are inputs and y is the output.
f (x, y, a, b)
{
if (x is 1) y = a;
else y = b;
}
Which one of the following digital logic blocks is the most suitable for implementing this
function?
(A) Full adder (B) Priority encoder (C) Multiplexor (D) Flip-flop
Answer: (C)
Exp: y xb xa = +
x is working as selection line, where the two input lines are a and
b, so the function ( ) F x, y, a, b can be implemented using (21)
multiplexer as follows:
9. Consider the following processors (ns stands for nanoseconds).
Assume that the pipeline registers have zero latency.
P1: Four-stage pipeline with stage latencies 1 ns, 2 ns, 2 ns, 1 ns.
P2: Four-stage pipeline with stage latencies 1 ns, 1.5 ns, 1.5 ns, 1.5 ns.
P3: Five-stage pipeline with stage latencies 0.5 ns, 1 ns, 1 ns, 0.6 ns, 1 ns.
P4: Five-stage pipeline with stage latencies 0.5 ns, 0.5 ns, 1 ns, 1 ns, 1.1 ns.
Which processor has the highest peak clock frequency?
(A) P1 (B) P2 (C) P3 (D) P4
Answer: (C)
PQ
RS RS RS RS
PQ 1
PQ 1
PQ 1
PQ 1
RS
2
P
1
P
1
I
0
I
y
x
2 1
MUX
a
b
CS-GATE-2014 PAPER-03| www.gateforum.com
Indias No.1 institute for GATE Training 1 Lakh+ Students trained till date 65+ Centers across India
7
Exp: Clock period (CP) = max stage delay + overhead
So ( )
( )
( )
( )
P1
P2
P3
P4
CP Max 1, 2, 2,1 2ns
CP Max 1, 1.5, 1.5, 1.5 1.5ns
CP Max 0.5, 1,1, 0.6,1 1ns
CP Max 0.5, 0.5,1,1,1.1 1.1ns
= =
= =
= =
= =
As frequency
1
,
C.P
so least clock period will give the highest peak clock frequency.
p3
1
So, f 1GHz
1ns
= =
10. Let A be a square matrix size n n. Consider the following pseudocode. What is the
expected output?
C = 100;
for i = 1 to n do
for j = 1 to n do
{
Temp = A[ i ] [ j ] + C ;
A [ i ] [ j ] = A [ j ] [ i ] ;
A [ j ] [ i ] = Temp C ;
}
for i = 1 to n do
for j = 1 to n do
output (A[ i ] [ j ]);
(A) The matrix A itself
(B) Transpose of the matrix A
(C) Adding 100 to the upper diagonal elements and subtracting 100 from lower diagonal
elements of A
(D) None of these
Answer: (A)
Exp: In the computation of given pseudo code for each row and column of Matrix A, each upper
triangular element will be interchanged by its mirror image in the lower triangular and after
that the same lower triangular element will be again re-interchanged by its mirror image in
the upper triangular, resulting the final computed Matrix A same as input Matrix A.
11. The minimum number of arithmetic operations required to evaluate the polynomial
( )
5 3
P X X 4X 6x 5 = + + + for a given value of X, using only one temporary variable is
_____.
Answer: (7)
CS-GATE-2014 PAPER-03| www.gateforum.com
Indias No.1 institute for GATE Training 1 Lakh+ Students trained till date 65+ Centers across India
8
Exp:
5 3
P(x) x 4x 6x 5canbe rewrittenas follows = + + +
( ) ( )
3 2
P x x x 4 6x 5 = + + +
Now using only one temporary variable t and any number of data transfer as well as memory
related operation the polynomial can be evaluated as follows
1. t x * x = [Evaluate
2
x and store in memory]
2. t t 4 = + [Evaluate
( )
2
x 4 + and store in memory]
3.
2
t x = [Retinue
2
x from memory]
4. t t *.X = [Evaluate
3
x and store in memory]
5.
( )
2
t t * x 4 = + [Evaluate
( )
3 2
x x 4 + and store in memory]
6. t 6* x = [Evaluate 6x and store in memory]
7. t t 5 = + [Evaluate ( ) 6x 5 + and store in memory]
8.
( )
3 2
t t x x 4 = + + [Retrieve
( )
2 2
x x 4 + from memory and evaluate
( ) { }
3 2
x x 4 6x 5 + + +
In the above 8 steps of evaluation, the total number of arithmetic operations required and 7 [4
Multiplications, 3 Additions]
So answer is 7 arithmetic operations.
12. Consider the following rooted tree with the vertex labelled P as the root
The order in which the nodes are visited during an in-order traversal of the tree is
(A) SQPTRWUV (B) SQPTUWRV
(C) SQPTWUVR (D) SQPTRUWV
Answer: (A)
Exp: The In order Traversal of Ternary Tree is done as follows:
Left Root Middle Right
So the nodes are visited in SQPTRWUV order.
P
Q
R
S
T
U
V
W
CS-GATE-2014 PAPER-03| www.gateforum.com
Indias No.1 institute for GATE Training 1 Lakh+ Students trained till date 65+ Centers across India
9
13. Suppose depth first search is executed on the graph below starting at some unknown vertex.
Assume that a recursive call to visit a vertex is made only after first checking that the vertex
has not been visited earlier. Then the maximum possible recursion depth (including the initial
call) is _________.
Answer: 19
Exp:
Suppose, we start DFS at vertex numbered as 1 and continue calling recursive function for
DFS on subsequent nodes numbered in ascending order.
The recursive calling sequence is shown as marked line in the above diagram which shows
maximum possible recursion depth including the initial call is 19.
14. You have an array of n elements. Suppose you implement quick sort by always choosing the
central element of the array as the pivot. Then the tightest upper bound for the worst case
performance is
( ) ( )
2
A 0 n ( ) ( ) B 0 nlogn ( ) ( ) C nlogn ( ) ( )
2
D 0 n
Answer: (A)
Exp: The Worst case time complexity of quick sort is O (n
2
). This will happen when the elements
of the input array are already in order (ascending or descending), irrespective of position of
pivot element in array.
15. The length of the shortest string NOT in the language { } ( )
over a, b = of the following
regular expression is _________. a*b* (ba)* a*
Answer: (3)
Exp: R.E= ( ) a *b* ba *a *
Length 0 is present as it accepts all length 1 strings are present ( ) a, b also aa, ab, ba, bb are
present, But ' bab' is not present. So it is 3
1
2
4
6
8 10
3
5
9
7
17 18
14 16
12
19
15
13
11
CS-GATE-2014 PAPER-03| www.gateforum.com
Indias No.1 institute for GATE Training 1 Lakh+ Students trained till date 65+ Centers across India
10
16. Let be a finite non-empty alphabet and let
*
2 be the power set of * . Which one of the
following is TRUE?
(A) Both 2 * and * are countable
(B) 2 * is countable * is uncountable
(C) 2 * is uncountable and * is countable
(D) Both 2 * and * are uncountable
Answer: (C)
Exp:
*
2
(
= + +
(
( ) P .8 .6 2.2ns 3.08ns = + =
( )
( ) c p
completion stall clock
Q 80% 1clock 20% 1 5 T
(
= + +
(
( ) P .8 .12 1ns 2ns = + =
So the value of
P 3.08ns
1.54
Q 2ns
= =
44. The memory access time is 1 nanosecond for a read operation with a hit in cache, 5
nanoseconds for a read operation with a miss in cache, 2 nanoseconds for a write operation
with a hit in cache and 10 nanoseconds for a write operation with a miss in cache. Execution
of a sequence of instructions involves 100 instruction fetch operations, 60 memory operand
read operations and 40 memory operand write operations. The cache hit-ratio is 0.9. The
average memory access time (in nanoseconds) in executing the sequence of instructions is
__________.
Answer: (1.68)
Exp:
60memory
100 instruction 40memory
Total instruction operand read
fetch operation operand write op
operation
= + +
( ) 200 instructions operations =
Time taken for fetching 100 instructions (equivalent to read)
90*1ns 10*5ns 140ns = + =
Memory operand Read operations ( ) ( ) 90% 60 *1ns 10% 60 5ns = +
54ns 30ns 84ms = + =
Memory operands write operation time ( ) ( ) 90% 40 *2ns 10% 40 *10ns = +
72ns 40ns 112ns = + =
Total time taken for executing 200 instructions 140 84 112 336ns = + + =
336 ns
Average memory access time 1.68ns
200
= =
CS-GATE-2014 PAPER-03| www.gateforum.com
Indias No.1 institute for GATE Training 1 Lakh+ Students trained till date 65+ Centers across India
23
45.
The above synchronous sequential circuit built using JK flip-flops is initialized with
2 1 0
Q Q Q 000. = The state sequence for this circuit for the next 3 clock cycles is
(A) 001, 010, 011 (B) 111, 110, 101
(C) 100, 110, 111 (D) 100, 011, 001
Answer: (C)
Exp:
2 1 0
P.S.
Q Q Q
2 2 1 1 0 0
FFinputs
J K J K J K
2 1 0
N.S.
Q Q Q
+ + +
( ) ( ) ( ) ( ) ( ) ( )
1 0 2 2 1 0
Q Q Q Q Q Q
0 0 0
1 0 0
1 1 0
1 0 0 1 0 1
1 0 1 0 0 1
0 0 1 0 1 1
1 0 0
1 1 0
1 1 1
46. With respect to the numerical evaluation of the definite integral,
b
2
a
K x dx, =
where a and b
are given, which of the following statements is/are TRUE?
(I) The value of K obtained using the trapezoidal rule is always greater than or equal to the
exact value of the definite integral.
(II) The value of K obtained using the Simpsons rule is always equal to the exact value of
the definite integral.
(A) I only (B) II only (C) Both I and II (D) Neither I nor II
Answer: ( C )
Exp:
b
2
a
x dx
let a 0, b 1
let n 4
b a 1 0
h 0.25
n 4
= =
=
= = =
x 0 0.25 0.5 0.75 1
2
y x =
0 0.625 0.25 0.5625 1
0
y
1
y
2
y
3
y
4
y
J
>
K
2
Q
2
Q
J
>
K
1
Q
1
Q
C
C C
J
>
K
0
Q
0
Q
CS-GATE-2014 PAPER-03| www.gateforum.com
Indias No.1 institute for GATE Training 1 Lakh+ Students trained till date 65+ Centers across India
24
I. By Trapezoidal rule
( ) ( )
( ) ( )
1
2
0 4 1 2 3
0
h
x dx y y 2 y y y
2
0.25
0 1 2 0.0625 0.25 0.5625 0.34375
2
= + + + + (
= + + + + ( =
II. By Simpsons
1
3
rule
( ) ( ) ( )
( ) ( ) ( )
1
2
0 4 2 1 3
0
h
x dx y y 2 y 4 y y
3
0.25 1
0 1 2 0.25 4 0.0625 0.5625
3 3
= + + + + (
= + + + + ( =
Exact value
1
1 3
2
0
0
x 1
x dx
3 3
= =
47. The value of the integral given below is
2
0
x cos xdx
(A) 2 (B) (C) (D) 2
Answer: ( A)
Exp: ( ) ( ) ( )
( ) ( )
2 2
0
0
2
x cos xdx x sin x 2x cos x 2 sin x
sin 2 cos 2sin 0 0 0 2
= +
= + + + =
48. Let S be a sample space and two mutually exclusive events A and B be such that A B S. =
If ( ) P . denotes the probability of the event, the maximum value of P(A)P(B) is ______
Answer: (0.25)
Exp: Given
( ) ( )
( ) ( )
( )
( A & B are mutual
A B S
P A B P S 1
P ly exclusi A P ve B 1
P B 1 P(A)
)
=
= =
+ =
=
Maximum value of ( ) ( ) P A P B ? =
Maximum value of P (A) [1- P (A)] =?
( )
( ) ( )
2
Let P A X
Let f x x 1 x x x
=
= =
CS-GATE-2014 PAPER-03| www.gateforum.com
Indias No.1 institute for GATE Training 1 Lakh+ Students trained till date 65+ Centers across India
25
for ( ) ( )
( )
1
f x maximum f ' x 0 1 2x 0 x
2
1
f " x 2; f " 0
2
= = =
| |
= <
|
\
( ) f x has maximum
1
At x and maximum value
2
1 1 1 1 1 1
f 1 . 0.25
2 2 2 2 2 4
=
| | | |
= = = = =
| |
\ \
49. Consider the set of all functions { } { } f : 0,1,..., 2014 0,1..., 2014 such that ( ) ( )
f f i i, = for
0 i 2014 . Consider the following statements.
P. For each such function it must be the case that for every i, f(i) = i,
Q. For each such function it must be the case that for some i,f(i) = i,
R. Each such function must be onto.
Which one of the following is CORRECT?
(A) P, Q and R are true (B) Only Q and R are true
(C) Only P and Q are true (D) Only R is true
Answer: (B)
Exp: Let us consider a function (counter example) as
( ) ( ) ( ) ( ) ( )
( ) ( )
( ) ( )
( ) ( )
f 0 1, f 1 0, f 2 3, f 3 2,....., f 2012 2013,
f 2013 2012 and f 2014 2014
Clearly f f i i for 0 i 2014
Here f i i for every i and f i i for some i
= = = = =
= =
=
=
Also f is onto
Hence, only Q and R are true
50. There are two elements x,y in a group (G,*) such that every element in the group can be
written as a product of some number of xs and ys in some order. It is known that
x * x y*y x *y*x *y y*x*y*x e = = = =
where e is the identity element. The maximum number of elements in such a group is
_________________.
Answer: (4)
Exp: x x e x is its own inverse =
CS-GATE-2014 PAPER-03| www.gateforum.com
Indias No.1 institute for GATE Training 1 Lakh+ Students trained till date 65+ Centers across India
26
( ) ( ) ( )
( ) ( ) ( )
[ ]
( ) ( ) ( ) ( )
y y e y is its own inverse
x y x y e x y is its own inverse
y x y x e y x is its own inverse
also x x e e e can be rewritten as follows
x y y x e y y e e y y e
x y y x e shows that x y and y x
=
=
=
=
= = =
=
Are each others inverse and we already know that
( ) ( ) x y and y x are inverse of its own.
As per ( ) G,* to be group any element should have
only one inverse element (unique)
This process x y y x = (is one element)
So the elements of such group are 4 which are { } x, y, e, x y
51. If G is a forest with n vertices and k connected components, how many edges does G have?
(A)
[ ]
n / k (B)
[ ]
n / k (C) n k (D) n k 1 +
Answer: (C)
Exp: Let
1 2 k
n , n ,.....n be the number of vertices respectively in K connected components of a
forest G, then
1 2 k
n 1, n 1,....., n 1 be the number of edges respectively in K connected
components and
1 2 k
n n ..... n n + + + = (number of vertices in G)
Hence, number of edges in G = number of edges in K connected components
( ) ( ) ( )
1 2 k
n 1 n 1 ...... n 1 n k = + + + =
52. Let denote the minimum degree of a vertex in a graph. For all planar graphs on n vertices
with 3, which one of the following is TRUE?
(A) In any planar embedding, the number of faces is at least
n
2
2
+
(B) In any planar embedding, the number of faces is less than
n
2
2
+
(C) There is a planar embedding in which the number of faces is less than
n
2
2
+
(D) There is a planar embedding in which the number of faces is at most
n
1 +
Answer: (A)
CS-GATE-2014 PAPER-03| www.gateforum.com
Indias No.1 institute for GATE Training 1 Lakh+ Students trained till date 65+ Centers across India
27
Exp: We know that ( ) v r e 2 e n r 2 ... 1 + = + = +
( ) Where V n number of vertices ; r number of faces and
e number of edges
Given, 3 then 3n 2e
= =
=
( ) ( )
3n
e
2
3n
n r 2 using 1
2
3n n
r n 2 r 2
2 2
n
umber of faces is atleast 2
2
+
+ +
+
53. The CORECT formula for the sentence, not all rainy days are cold is
(A) ( ) ( ) ( )
d Rainy d Cold d (B) ( ) ( ) ( )
d Rainy d Cold d
(C) ( ) ( ) ( )
d Rainy d Cold d (D) ( ) ( ) ( )
d Rainy d Cold d
Answer: (D)
Exp: Given statement is ( ) ( ) ~ d r d c d (
( ) ( )
( ) ( )
~ d ~ r d c d
d r d ~ c d
(
(
(Since p q p q and let r(d) be rainy day, c(d) be cold day)
54. Consider the following relational schema:
Employee
( )
empId, empName, empDept
Customer ( ) custId, custName, sales RepId, rating
SalesRepId is a foreign key referring to empId of the employee relation. Assume that each
employee makes a sale to at least one customer. What does the following query return?
SELECT empName
FROM employee E
WHERE NOT EXISTS (SELECT custId
FROM customer C
WHERE C. salesRepId = E. empId
AND C. rating < > GOOD)
CS-GATE-2014 PAPER-03| www.gateforum.com
Indias No.1 institute for GATE Training 1 Lakh+ Students trained till date 65+ Centers across India
28
(A) Names of all the employees with at least one of their customers having a GOOD rating.
(B) Names of all the employees with at most one of their customers having a GOOD rating.
(C) Names of all the employees with none of their customers having a GOOD rating.
(D) Names of all the employees with all their customers having a GOOD rating.
Answer: (D)
Exp: The outer query will return the value (names of employees) for a tuple in relation E, only if
inner query for that tuple will return no tuple (usage of NOT EXISTS).
The inner query will run for every tuple of outer query. It selects cust-id for an employee e, if
rating of customer is NOT good. Such an employee should not be selected in the output of
outer query.
So the query will return the names of all those employees whose all customers have GOOD
rating.
55. Let denote the Exclusive OR (XOR) operation. Let 1 and 0 denote the binary
constants. Consider the following Boolean expression for F over two variables P and Q.
( ) ( ) ( ) ( ) ( ) ( ) ( )
F P, Q 1 P P Q P Q Q 0 =
The equivalent expression for F is
(A) P Q + (B) P Q + (C) P Q (D) P Q
Answer: (D)
Exp:
( ) ( ) ( ) ( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
( ) ( )
F P, Q 1 P P Q P Q Q 0
P PQ PQ PQ PQ Q
P PQ PQ P PQ PQ PQ PQ Q PQ PQ Q
PQ PQ PQ PQ Q P PQ PQ P Q
=
= + +
( (
= + + + + + +
= + + = = + =