Beruflich Dokumente
Kultur Dokumente
for
Computer Science
&
Information Technology
By
Contents
Contents
#1.
#2.
#3.
Subject Name
Mathematics
Topic Name
Page No.
1-112
1
2
3
4
Linear Algebra
Probability & Distribution
Numerical Methods
Calculus
1 28
29 57
58 73
74 112
113 177
5
6
7
8
9
10
11
12
113 136
137 140
141 148
149 150
151 156
157 160
161 174
175 177
#5.
178 210
Introduction to Operating System
Process Management
Threads
CPU Scheduling
Deadlocks
Memory Management & Virtual Memory
File System
I/O System
178
179 186
187
188 193
194 199
200 206
207 208
209 210
Theory of Computation
211 235
21
22
23
24
211 216
217 223
224 229
230 235
Finite Automata
Regular Expression
Context Free grammar
Turing Machines
#6.
Operating System
13
14
15
16
17
18
19
20
#4.
236 263
236
237 246
247 252
253 258
259 263
Digital Logic
30
31
264 289
Number Systems & Code Conversions
Boolean Algebra & Karnaugh Maps
th
th
264 268
269 275
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page I
32
33
34
#7.
#8.
Logic Gates
Logic Gate Families
Combinational and Sequential Digital Circuits
276 279
280
281 289
290 322
35
36
37
38
290 297
298 - 300
301 313
314 322
Mathematical Logic
Combinatorics
Sets and Relations
Graph Theory
#9.
Contents
323 361
ER Diagrams
Functional Dependencies & Normalization
Relational Algebra & Relational Calculus
SQL
Transactions and Concurrency Control
File Structures (Sequential files, Indexing,
B and
trees)
323 324
325 330
331 337
338 351
352 357
358 361
Computer Networks
362 396
45
46
362 363
364 - 367
47
48
49
50
51
368 373
374 379
380 390
391 393
394 396
397 409
Introduction to Compilers
Syntax Analysis
Syntax Directed Translation
Intermediate Code Generation
397
398 403
404 405
406 409
410 412
56
410 411
57
Process Modeling
412 413
58
59
60
61
Project Management
Validation and Verification
HTML Structure
XML and DTDs
414 415
416 418
419 420
421 422
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page II
Mathematics
Linear Algebra
ME 2005
1.
Which one of the following is an
Eigenvector of the matrix[
(A) [
(B) [ ]
2.
5.
]?
(C) [
(D) [
ME 2006
3.
Multiplication of matrices E and F is G.
Matrices E and G are
os
sin
E [ sin
] and
os
G
4.
sin
os
sin
(B) [ os
os
sin
os
(C) [ sin
sin
os
sin
(D) [ os
os
sin
7.
Eigenvectors of 0
1 is
(A) 0
(B) 1
(C) 2
(D) Infinite
ME 2008
8.
1 are
ME 2007
6.
The number of linearly independent
os
(A) [ sin
9.
(C) 1
(D) 2
The matrix [
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 1
10.
11.
ME 2012
15.
For a matrix,M-
(B) ( )
1 is
(A) 2
(B) 2 3
(C) 2 3
(D) 2
ME 2011
13. Consider the following system
equations:
x
x
x
x
x
x
x
The system has
(A) A unique solution
(B) No solution
(C) Infinite number of solutions
(D) Five solutions
14.
of
(D) ( )
1 , one of the
(C) ( )
(A) ( )
+, the transpose
ME 2010
12. One of the Eigenvectors of the matrix
16.
ME 2009
Mathematics
x + 2y + z =4
2x + y + 2z =5
xy+z=1
The system of algebraic equations given
above has
(A) a unique algebraic equation of x = 1,
y = 1 and z = 1
(B) only the two solutions of ( x = 1,
y = 1, z = 1) and ( x = 2, y = 1, z = 0)
(C) infinite number of solutions.
(D) No feasible solution.
ME 2013
17. The Eigenvalues of a symmetric matrix
are all
(A) Complex with non zero positive
imaginary part.
(B) Complex with non zero negative
imaginary part.
(C) Real
(D) Pure imaginary.
18.
ME 2014
19. Given that the determinant of the matrix
[
] is
12 , the determinant of
the matrix [
(A)
th
] is
(B)
th
(C)
th
(D)
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 2
20.
21.
22.
2.
3.
1 is
(A) { }
(C) 2
(B) { }
(D) 2 3
CE 2005
1.
Consider the system of equations (
)
is
s l r Let
(
)
(
) where
(
) e n Eigen -pair of an Eigenvalue
and its corresponding Eigenvector for
real matrix A. Let I be a (n n) unit
matrix. Which one of the following
statement is NOT correct?
(A) For a homogeneous n n system of
linear equations,(A
) X = 0 having
a nontrivial solution the rank of
(A
) is less than n.
(B) For matrix
, m being a positive
integer, (
) will be the Eigen pair for all i.
(C) If
=
then | | = 1 for all i.
(D) If
= A then is real for all i.
Mathematics
and
- will be
)
(C) (4 3)
(D) (3 4
(A) (2 2)
(B) (3 3
CE 2006
4.
Solution for the system defined by the set
of equations 4y + 3z = 8; 2x z = 2 and
3x + 2y = 5 is
(A) x = 0; y =1; z =
(B) x = 0; y = ; z = 2
(C) x = 1; y = ; z = 2
(D) non existent
5.
],
]are 2
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 3
8.
(B)
1
1
m trix 0
(A)
(B)
is
(D)
( )
( )
( )
( )
11.
is
15.
(C)
(D)
i
i
i
i
i
i
i
i
i
i
CE 2012
1 are
and 8
and 5
14.
(C)
CE 2008
9.
The product of matrices ( )
(A)
(C)
(B)
(D) PQ
10.
1 is
Mathematics
n
n
CE 2009
12. A square matrix B is skew-symmetric if
(C)
(A)
(D)
(B)
CE 2011
13. [A] is square matrix which is neither
symmetric nor skew-symmetric and , is its transpose. The sum and difference of
these matrices are defined as
[S] = [A] + , - and [D] = [A] , - ,
respectively. Which of the following
statements is TRUE?
(A) Both [S] and [D] are symmetric
(B) Both [S] and [D] are skew-symmetric
(C) [S] is skew-symmetric and [D] is
symmetric
(D) [S] is symmetric and [D] is skew
symmetric
1 are
CE 2013
16. There is no value of x that can
simultaneously satisfy both the given
equations. Therefore, find the le st
squares error solution to the two
equations, i.e., find the value of x that
minimizes the sum of squares of the
errors in the two equations.
2x = 3 and 4x = 1
17.
CE 2014
18.
19.
] n
], the product K JK is
(A) 915
(B) 1355
th
th
(C) 1640
(D) 2180
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 4
4.
20.
is ____________
21.
The
rank
of
the
matrix
] is ________________
CS 2005
1.
Consider the following system of
equations
in
three
real
variables x x n x
x
x
x
x
x
x
x
x
x
This system of equation has
(A) no solution
(B) a unique solution
(C) more than one but a finite number of
solutions
(D) an infinite number of solutions
2.
1
n
n
(C)
(D)
n
n
CS 2006
3.
F is an n x n real matrix. b is an n
real
vector. Suppose there are two nx1
vectors, u and v such that u v , and
Fu=b, Fv=b. Which one of the following
statement is false?
(A) Determinant of F is zero
(B) There are infinite number of
solutions to Fx=b
(C) There is an x 0 such that Fx=0
(D) F must have two identical rows
Mathematics
CS 2007
5.
Consider the set of (column) vectors
defined by X={xR3 x1+x2+x3=0, where
XT =[x1, x2, x3]T }. Which of the following is
TRUE?
(A) {[1, 1, 0]T, [1, 0, 1]T} is a basis for
the subspace X.
(B) {[1, 1, 0]T, [1, 0, 1]T} is a linearly
independent set, but it does not span
X and therefore, is not a basis of X.
(C) X is not the subspace for R3
(D) None of the above
CS 2008
6.
The following system of
x
x
x
x
x
x
x
x
x
Has unique solution. The only possible
value (s) for is/ are
(A) 0
(B) either 0 or 1
(C) one of 0,1, 1
(D) any real number except 5
7.
1 0
1 n 0
1 0
(A) One
(B) two
(C) three
(D) four
CS 2010
8.
Consider the following matrix
A=[
]
x y
If the Eigen values of A are 4 and 8, then
(A) x = 4, y = 10
(C) x = 3, y = 9
(B) x = 5, y = 8
(D) x = 4, y = 10
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 5
CS 2011
9.
Consider the matrix as given below
[
13.
14.
CS 2013
11. Which one of
x x
equal [
y y
z z
x(x
y(y
(A) |
z(z
x
(B) |
y
z
x y
(C) |
y z
z
x y
(D) |
y z
z
15.
is __________.
[
16.
],
CS 2012
10. Let A be the 2
(C) n
(D)
n
Mathematics
ECE 2005
1.
Given an orthogonal matrix
CS 2014
12. Consider the following system of
equations:
x
y
x
z
x
y
z
x
y
z
The number of solutions for this system is
__________.
A= [
]. ,
is
(A) [
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 6
Mathematics
(B) [
6.
(C) [
(A) 0
(B) 1
(D) [
2.
Let,
A=0
1 and
Then (a + b)=
(A)
(B)
3.
= 0
1.
(C)
(D)
Eigenvector is
(C) 0
(B) 0 1
(D) 0
ECE 2006
4.
the
ECE 2007
7.
It is given that X1 , X2 M are M nonzero, orthogonal vectors. The dimension
of the vector space spanned by the 2M
vector X1 , X2 XM , X1 , X2 XM is
(A) 2M
(B) M+1
(C) M
(D) dependent on the choice of X1 , X2
XM.
9.
Eigenvector
1 is
(A) 2
(B) 4
5.
1 , the Eigenvalue
to
(C) 6
(D) 8
v =0 1
=4
(C) 2
(D) 3
ECE 2008
8.
The system of linear equations
4x + 2y = 7, 2x + y = 6 has
(A) a unique solution
(B) no solution
(C) an infinite number of solutions
(D) exactly two distinct solutions
1 the
(A) 0 1
v =0
ECE 2009
10. The Eigen values of the following matrix
are
[
The matrix is
(A) 0
(C) 0
(B) 0
(D) 0
(A) 3, 3 + 5j, 6 j
(B) 6 + 5j, 3 + j, 3 j
(C) 3 + j, 3 j, 5 + j
(D) 3, 1 + 3j, 1 3j
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 7
ECE 2010
11. The Eigenvalues of a skew-symmetric
matrix are
(A) Always zero
(B) Always pure imaginary
(C) Either zero or pure imaginary
(D) Always real
ECE 2011
12. The system of equations
x y z
x
y
z
x
y
z
has NO solution for values of
given by
(A)
(C)
(B)
(D)
Mathematics
ECE 2014
16. For matrices of same dimension M, N and
scalar c, which one of these properties
DOES NOT ALWAYS hold?
(A) (M )
M
(M)
(B) ( M )
(C) (M N)
M
N
(D) MN NM
17.
18.
J
ECE\EE\IN 2012
13.
Given that A = 0
1 and I = 0
the value of A3 is
(A) 15 A + 12 I
(B) 19A + 30
(C) 17 A + 15 I
(D) 17A +21
ECE 2013
14. The minimum Eigenvalue of the following
matrix is
[
19.
20.
(A) 0
(B) 1
15.
[
]
Which is obtained by reversing the order
of the columns of the identity matrix I .
Let
I
J where
is a nonnegative real number. The value of for
which det(P) = 0 is _____.
1,
(C) 2
(D) 3
(A) 2
(B) 5
)h s
)4 5
]
(C) 8
(D) 16
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 8
EE 2005
1.
5.
If R = [
(A) ,
(B) ,
2.
(C) ,
(D) ,
(B) [
] [
] [
(C) [
] [
] [
(D) [
] [
] [
(A) [ ]
(B) [
(C) [
(B) [
(D) [ ]
] ,R=[
(C) [ ]
]
(D) [
EE 2007
6.
X = [x , x . . . . x - is an n-tuple non-zero
vector. The n n matrix V = X
(A) Has rank zero (C) Is orthogonal
(B) Has rank 1
(D) Has rank n
7.
8.
EE 2006
Statement for Linked Answer Questions 4
and 5.
4.
is
] , one of
(A) [
] ,Q=[
] [
P=[
(A) [
3.
Mathematics
] are
three vectors
An orthogonal set of vectors having a
span that contains P,Q, R is
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 9
10.
equals
(A) 511 A + 510
(B) 309 A + 104
(C) 154 A + 155
(D) exp (9A)
EE 2008
11. If the rank of a (
) matrix Q is 4, then
which one of the following statements is
correct?
(A) Q will have four linearly independent
rows and four linearly independent
columns
(B) Q will have four linearly independent
rows and five linearly independent
columns
(C) Q will be invertible
(D)
Q will be invertible
12.
13.
(A) A A+ A = A
(B) (AA+ ) = A A+
14.
=0
If I denotes identity matrix, then the
inverse of matrix P will be
(A) (
I)
(B) (
I)
(C) (
I)
(D) (
I)
(C) A+ A =
(D) A A+ A = A+
Let P be a
real orthogonal matrix. x
is a real vector [x x - with length
x
(x
x ) . Then, which one of the
following statements is correct?
(A)
x
x
where at least one
vector satisfies
x
x
(B)
x
x for all vectors x
(C)
x
x
where at least one
vector satisfies
x
x
(D) No relationship can be established
between x and
x
9.
Mathematics
EE 2009
15. The trace and determinant of a
matrix are known to be 2 and 35
respe tively Its Eigenv lues re
(A) 30 and 5
(C) 7 and 5
(B) 37 and 1
(D) 17.5 and 2
EE 2010
16. For the set of equations
x
x
x
x =2
x
x
x
x =6
The following statement is true
(A) Only the trivial solution
x
x
x
x = 0 exists
(B) There are no solutions
(C) A unique non-trivial solution exists
(D) Multiple non-trivial solutions exist
17.
An Eigenvector of
(A) ,
(B) ,
(C) ,
(D) ,
] is
-
EE 2011
18.
The matrix[A] = 0
1 is decomposed
(A) 0
th
th
1 and 0
1
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 10
(B) 0
(C) 0
(D) 0
1 and 0
1 and 0
1 and 0
23.
1
1
1
EE 2013
19.
The equation 0
x
1 0x 1
0 1 has
0 1.
(A) [ 1 1]T
(B) [3 1]T
(A) 0
(C) 0
(B) 0
(D) 0
1?
(C) [1 1]T
(D) [ 2 1]T
2.
1 and
EE 2014
21. Given a system of equations:
x
y
z
x y
z
Which of the following is true regarding
its solutions?
(A) The system has a unique solution for
any given and
(B) The system will have infinitely many
solutions for any given and
(C) Whether or not a solution exists
depends on the given and
(D) The system would have no solution
for any values of and
22.
IN 2005
1.
Identify which one of the following is an
(A) No solution
x
(B) Only one solution 0x 1
Mathematics
IN 2006
Statement for Linked Answer Questions 3
and 4
A
system of linear simultaneous
equations is given as Ax=B where
[
] n
[ ]
3.
4.
5.
For a given
that
0
matrix A, it is observed
0
1 n
Then matrix A is
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 11
2 1 1 0 1 1
1 1 0 2 1 2
10.
(A) A
1 1 0 2
1 1
(B) A
1 2 0 2 1 1
(C) A
1 2 0
02 1
2 1 1
0 2
(D) A
1 3
IN 2007
6.
Let A = [ ]
i j n with n
= i. j. Then the rank of A is
(A)
(C) n
(B)
(D) n
7.
The matrix P =[
12.
9.
)(
(D) n
IN 2011
13.
The matrix M = [
] has
Eigenvalues
. An Eigenvector
corresponding to the Eigenvalue 5 is
,
- . One of the Eigenvectors of
the matrix M is
(A) ,
(C) ,
(B) ,
(D) ,
] rotates a vector
(C)
(D)
IN 2010
11. X and Y are non-zero square matrices of
size n n. If
then
(A) |X| = 0 and |Y| 0
(B) |X| 0 and |Y| = 0
(C) |X| = 0 and |Y| = 0
(D) |X| 0 and |Y| 0
IN 2009
8.
Mathematics
IN 2013
14. The dimension of the null space of the
15.
matrix [
] is
(A) 0
(B) 1
(C) 2
(D) 3
] 0
(B) 0 1 0
th
th
1 is
(C) [ ] 0 1
j
j
(D) [ ] 0 1
j
1
1
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 12
Mathematics
IN 2014
16. For the matrix A satisfying the equation
given below, the eigenvalues are
, -[
(A) (
,)
(B) (1,1,0)
]
(C) (
)
(D) (1,0,0)
and G = [
[Ans. A]
[
Now E F = G
in onsistent
4.
5.
[Ans. A]
6.
[Ans. B]
1 Eigenv lues re 2, 2
I)
I)
( )
7.
matrix be A = 0
sin
os
/
I)
[Ans. A]
(
I)
.
olving for , Let the symmetric and real
[Ans. C]
os
Given , E = [ sin
No (
3.
sin
os
[Ans. A]
For S
( )
n ( )
( (
)
minimum of m n)
For inconsistence
( )
( )
he highest possi le r nk of is
os
[ sin
,E-
2.
th
Now |
Which gives (
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 13
Mathematics
x
[
][
[Ans. B]
Let
eigenv lues re
12.
[Ans. A]
0
1 Eigenv lues re
Eigenve tor is x
13.
[Ans. C]
[
taking K
( )
infinite m ny solutions
9.
10.
[Ans. C]
Sum of the diagonal elements = Sum of
the Eigenvalues
1 + 0 + p = 3+S
S= p 2
[Ans. B]
Eigenvalues of a real symmetric matrix
are always real
15.
[Ans. B]
0
If
[Ans. B]
( )
11.
14.
( )
[( )
) ]
16.
[Ans. A]
iven M
MM
th
[Ans. C]
The given system is
x
y z
x y
z
x y z
Use Gauss elimination method as follows
Augmented matrix is
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 14
, | -
| ]
[
So, |
[Ans. C]
Suppose the Eigenvalue of matrix A is
(
i )(s y) and the Eigenvector is
x where s the onjug te p ir of
Eigenvalue and Eigenvector is n x.
So Ax = x
and x x
king tr nspose of equ tion
x
x
[( )
n is s l r ]
x
x x x
x x x x ,
x x x x
(x x) (
re s l r )
(x x)
20.
[Ans. C]
We know that
os x
os x sin x
( ) os x
sin x ( ) os x
Hence 1, 1 and 1 are coefficients. They
are linearly dependent.
1 eigen v lues
Eigenve tor is
21.
[Ans. D]
We know that the Eigenvectors
corresponding to distinct Eigenvalues of
real symmetric matrix are orthogonal.
x
y
x
y
[ ][ ] x y
x y
x y
y
x
22.
[Ans. D]
(
)
In case of matrix PQ
CE
1.
QP (generally)
[Ans. C]
If
=
i.e. A is orthogonal, we can
only s y th t if is n Eigenv lue of
then
[Ans. A]
In an over determined system having
more equations than variables, it is
necessary to have consistent unique
solution, by definition
3.
[Ans. A]
With the given order we can say that
order of matrices are as follows:
34
Y 43
33
[Ans. A]
|
[Ans. D]
0
nnot e zero )
19.
18.
nk ( )
nk ( | )
So, Rank (A) = Rank (A|B) = 2 < n (no. of
variables)
So, we have infinite number of solutions
17.
Mathematics
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 15
(
) 33
P 23
32
P(
)
(23) (33) (32)
22
( (
)
) 22
4.
[Ans. D]
The augmented matrix for given system is
[
| ]
| ]
| ]
8.
| ]
( )
( )
( )
( )
olution is non existent for above
system.
5.
6.
7.
[Ans. B]
= Trace (A)
+ + = Trace (A)
= 2 + ( 1) + 0 = 1
Now = 3
3+ + =1
1 is
(
)
0
9.
10.
1
1
[Ans. B]
( ) P=(
(
)(
)
=(
) (I) =
)P
[Ans. B]
A=0
Characteristic equation of A is
|
|=0
(4
)( 5
) 2 5 =0
+
30 = 0
6, 5
11.
[Ans. A]
The augmented matrix for given system is
[
[Ans. A]
Inverse of 0
Mathematics
| ]
th
[Ans. D]
The augmented matrix for given system is
x
[
| ] 6y7 [ ]
z
k
Using Gauss elimination we reduce this to
an upper triangular matrix to find its rank
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 16
| ]
17.
[Ans. 16]
, , M trix , The product of matrix PQR is
, - , - , The minimum number of multiplications
involves in computing the matrix product
PQR is 16
18.
[Ans. 23]
k
[
| ]
| ]
Now if k
Rank (A) = rank (A|B) = 3
Unique solution
If k = 7, rank (A) = rank (A|B) = 2
which is less than number of variables
When K = 7, unique solution is not
possible and only infinite solution is
possible
12.
[Ans. A]
A square matrix B is defined as skewsymmetric if and only if
= B
13.
[Ans. D]
By definition A +
is always symmetric
is symmetri
is lw ys skew symmetri
is skew symmetri
Mathematics
][
K JK
-[
,
]
-
19.
[Ans. A]
Sum of Eigenvalues
= Sum of trace/main diagonal elements
= 215 + 150 + 550
= 915
20.
[Ans. 88]
The determinant of matrix is
[
14.
[Ans. B]
1 =(
15.
,(
=
i)(
i
i
1
i -
i)
i
i
i
i
i
i
1
Interchanging Column 1& Column 2 and
taking transpose
[Ans. B]
0
[Ans. 0.5]
0.5
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 17
= (
21.
)+
= 1, 6
The Eigenvalues of A are 1 and 6
[Ans. 2]
]
3.
[Ans. D]
Given that Fu =b and Fv =b
If F is non singular, then it has a unique
inverse.
Now, u =
b and v=
b
Since
is unique, u = v but it is given
th t u
v his is contradiction. So F
must be singular. This means that
(A) Determinant of F is zero is true. Also
(B) There are infinite number of
solution to Fx= b is true since |F| = 0
(C) here is n
su h the
is
also true, since X has infinite number
of solutions., including the X = 0
solution
(D) F must have 2 identical rows is false,
since a determinant may become
zero, even if two identical columns
are present. It is not necessary that 2
identical rows must be present for
|F| to become zero.
4.
[Ans. C]
It is given that Eigenvalues of A is
5, 2, 1, 4
I
Let P = 0
1
I
Eigenvalues of P : |
I|
I
|
|
I
(
)
I
I
I
Eigenvalue of P is
( 5 +1 ), ( 2+ 1), (1+ 1), (4+1 ),
( 5 1 ), ( 2 1 ),(1 1), (4 1)
= 4, 1, 2, 5, 6, 3,0,3
5.
[Ans. B]
|x
X= {x
x
x
= ,x x x - then,
[
( )
( )
]
( )
( )
]
( )
[Ans. B]
The augmented matrix for the given
system is [
| ]
| ]
|
]
[Ans. B]
0
CS
1.
)(
Mathematics
|
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 18
7.
| ]
[Ans. D]
|
|
x
y
(
)(
y)
When
(
y)
x
y
x
When
(
y)
x
y
x
x
y
Solving (1) & (2)
x
y
[Ans. D]
The augmented matrix for above system
is
[
Mathematics
| ]
| ]
( )
( )
Now as long as 5 0,
rank (A) =rank (A|B) =3
can be any real value except 5. Closest
correct answer is (D).
9.
[Ans. A]
The Eigenvalues of a upper triangular
matrix are given by its diagonal entries.
Eigenvalues are 1, 4, 3 only
[Ans. A]
10.
[Ans. D]
Eigenvalues of 0
|
| =0
Eigenvalues of 0
|
=0,1
1
| =0
=0
( )
)(
) =0
= 1, 1
n ( )
n
| =0
(
(
)
)
Eigenvalues of A are
respectively
So Eigenvalues of
)
=0
)
= i or 1
= 1 i or 1 + i
Eigenvalues of 0
)(
)(
|= 0
(
(
= 0, 0
Eigenvalues of 0
|
) =0
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 19
11.
12.
[Ans. A]
p
q
nd
Since 2
& 3rd columns have been
swapped which introduces a ve sign
Hence (A) is not equal to the problem
16.
(
)
( )
no of v ri
nique solution exists
14.
[
]
x
x
Let X = x
e eigen ve tor
x
[x ]
By the definition of eigenvector, AX =
x
x
x
x
x
x
x
x
[
] [x ]
[x ]
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
n x
x
x
x
x
x
(I) If
s yx
x
x
x
x
x
x
x
x
x
(2) If
Eigenv lue
Three distinct eigenvalues are 0, 2, 3
Product of non zero eigenvalues = 2 3 = 6
les
[Ans. 0]
The Eigenvectors corresponding to distinct
Eigenvalues of real symmetric matrix are
orthogonal
ECE
1.
2.
[Ans. A]
If the trace or determinant of matrix is
positive then it is not necessary that all
eigenvalues are positive. So, option (B), (C),
(D) are not correct
[Ans. C]
Since, ,
]
(
=I
16
[Ans. A]
We know,
[Ans. 0]
| |
[Ans. 6]
Let A =
[Ans. 1]
x
y
x
z
x y z
x
y
z
ugmente m trix is [
13.
15.
Mathematics
7=0
1
1
1
1
b
, a
60
10
1 1 21 7
a+b =
3 60 60 20
Or 2a 0.1b=0, 2a
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 20
3.
[Ans. C]
8.
[Ans. B]
Approach 1:
Given 4x + 2y =7
and 2x + y =6
(A I)=0
( 4 ) (3 ) 2 4=0
2 + 20=0 = 5, 4
4 2 x 7
2 1y 6
0 0 x 5
2 1y 6
x1
x2
Putting = 5, 0
1 =0
x + 2x = 0 x = 2x
x
x
1= 2
2 1
Hence, 0
4.
1 is Eigenvector.
[Ans. C]
Then Eigenvector is x
Verify the options (C)
5.
or 2x y=
1 We know th t it is Eigenvalue
We know
|I A|=0
2 I2 +32 =0
= 4, 8 (Eigenvalues)
For
= 4, ( I
)=0
)=0
9.
[Ans. C]
Matrix will be singular if any of the
Eigenvalues are zero.
|
|= 0
For = 0, P = 0
p
p
|p
p | =0
p p
p p
10.
[Ans. D]
Approach1: Eigenvalues exists as complex
conjugate or real
Approach 2: Eigenvalues are given by
v =0 1
For
= 8, ( I
v =0
6.
[Ans. C]
[
]
[
[Ans. C]
There are M non-zero, orthogonal vectors,
so there is required M dimension to
represent them
| =0
( )
7.
7
2
2x+y=6
Since both the linear equation represent
parallel set of straight lines, therefore no
solution exists.
Approach 3:
Rank (A)=1; rank (C)=2,
As Rank (A)
rank (C) therefore no
solution exists.
[Ans. A]
or m trix
Mathematics
11.
th
)((
,
)=0
)
j
[Ans. C]
Eigenvalue of skew symmetric matrix is
either zero or pure imaginary.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 21
12.
13.
[Ans. B]
Given equations are x y z
x
y
z
and x
y
z
If
and
,
then x
y
z
have Infinite solution
If
and
, then
x
y
z
(
) no solution
x
y
z
If
n
x
y
z
will have solution
x
y
z
and
will also give solution
et of , -
et of [
16.
[Ans. D]
Matrix multiplication is not commutative
in general.
17.
A.
=I=
Using Cauchey Hamilton Theorem,
[Ans. B]
0
Mathematics
will
Characteristic Equations is
18.
By Cayley Hamilton theorem
I
(
I)
I
14.
I
| |
[
[Ans. A]
[
20.
[Ans. B]
)
]
19.
| |
| | Product of Eigenvalues = 0
Minimum Eigenv lue h s to e
15.
[Ans. B]
,
Let
[ ]
Then AB = [4]; BA
Here m = 1, n = 4
)
And et(I
th
les
[Ans. B]
onsi er
( )
( | )
no of v r
Infinitely many solutions
21.
et(I
th
1
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 22
(not positive)
( ) is not true
(A), (C), (D) are true using properties of
Eigenvalues
22.
EE
1.
2.
[Ans. B]
]
j( )
| |
=[
Top row of
=,
[Ans. D]
Since matrix is triangular, the Eigenvalues
are the diagonal elements themselves
namely = 3, 2 & 1.
Corresponding to Eigenvalue = 2, let
us find the Eigenvector
[A - ] x = 0
x
[
][x ]
[ ]
x
Putting
in above equation we get,
x
[
][x ] [ ]
x
Which gives the equations,
5x
x
x =0
. . . . . (i)
x =0
. . . . . (ii)
3x = 0
. . . . . (iii)
Since eqa (ii) and (iii) are same we have
5x
x
x =0
. . . . . (i)
x =0
. . . . . (ii)
Putting x = k, we get
x = 0, x = k and 5x
k
=0
R= [
Mathematics
, of tor( )| |
x = k
| |=|
= 1(2 + 3) 0(4 + 2) 1 (6 2) = 1
Since we need only the top row of
, we
need to find only first column of (R)
which after transpose will become first
row adj(A).
cof. (1, 1) = + |
|=2+3=5
cof. (2, 1) =
|= 3
cof. (2, 1) = + |
i.e. x x x = k : k : 0
= :1:0
=2:5:0
x
x
[ ]=[ ] is an Eigenvector of matrix p.
x
|= +1
3.
cof. (A) = [
[Ans. A]
Rank [P|Q] = Rank [P] is necessary for
existence of at least one solution to
x q.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 23
4.
[Ans. A]
We need to find orthogonal vectors, verify
the options.
Option (A) is orthogonal vectors
(
)(
[Ans. B]
The vector (
) is linearly
dependent upon the solution obtained in
- and ,
Q. No. 4 namely ,
We can easily verify the linearly
dependence as
|
6.
7.
[Ans. B]
xy
xx
| yx
xy
xx
x n xy yx
xy
x xy
y y | |y x y |
(x y)
x y
= Positive when x and y are linearly
independent.
)
i
8.
Mathematics
9.
[Ans. A]
A=0
|A | = 0
[Ans. B]
hen n
n m trix
xx
x x
x x
x x
x x x x
x x
*
+
x x x x
x x
Take x common from 1st row,
x common from 2nd row
x common from nth row.
It h s r nk
| =0
[Ans. A]
To calculate
Start from
derived above
I = 0 which has
I
[Ans. D]
k
L(x) = |
|
x
= (x )
I)(
x
(
(
k
x )
I)
I
x
= x
=[
x k
x
L(x) = M [x ]
x
Comparing both , we get,
I)
(
I)
I
|
(
I)
I)
I
Hence Eigenvalue of M : | M
I)(
I
]
x
M=[
I)
I
)
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 24
11.
12.
13.
[Ans. A]
If rank of (5 6 ) matrix is 4,then surely
it must have exactly 4 linearly
independent rows as well as 4 linearly
independent columns.
= A is correct
=A[(
)
-A
= A[(
)
Put
=P
Then A [
] = A. = A
Choice (C)
= is also correct since
=(
)
=
I
14.
os
x in )
|| x || = x
(x in
[Ans. C]
Trace = Sum of Principle diagonal
elements.
16.
[Ans. D]
On writing the equation in the form of
AX =B
, *
nk ( )
nk( )
Number of variables = 4
Since, Rank (A) = Rank(C) < Number of
variables
Hence, system of equations are consistent
and there is multiple non-trivial solution
exists.
17.
[Ans. B]
Characteristic equation |
|
I|
(1 ) (
)(
)
is
os )
18.
[Ans. D]
, - ,L-, - Options D is correct
19.
[Ans. D]
x
x
(i)
} (i) n (ii) re s me
x
x
(ii)
x
x
So it has multiple solutions.
* +
Argument matrix C =*
[Ans. B]
Let orthogonal matrix be
os
in
P=0
1
in
os
By Property of orthogonal matrix A
I
x os
x in
So, x = [
]
x in
x os
|| x || =
(x
x
x
+ *x +
x
[Ans. D]
If characteristic equation is
=0
Then by Cayley Hamilton theorem,
I=0
=
Multiplying by
on both sides,
=
I = (
I)
[Ans. D]
Choice (A)
Since
Mathematics
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 25
20.
[Ans. D]
Eigen value
|A
Eigenvectors 0
1 n 0
Let matrix 0
x
x
10
10
I|= |
i.e., (1 ) (2 )
2
Thus the Eigenvalue are 1, 2.
If x, y, be the component of Eigenvectors
corresponding to the Eigenv lues
we
have
x
[A- I- 0
1 0y1=0
Mathematics
21.
22.
23.
IN
1.
[Ans. B]
AX=0 and (A) = 2
n=3
No. of linearly independent solutions
= n r
= 3
=1
3.
[Ans. C]
There are 3 non-zero rows and hence
rank (A) = 3
4.
[Ans. C]
Rank (A) = 3 (This is Co-efficient matrix)
Rank (A:b) =4(This is Augmented matrix)
s r nk( ) r nk (
) olution oes
not exist.
5.
[Ans. C]
We know
Hen e from the given
problem, Eigenvalue & Eigenvector is
known.
[Ans. B]
Since there are 2 equations and 3 variables
(unknowns), there will be infinitely many
solutions. If
if
then
x
y
z
x y
z
x z y
For any x and z, there will be a value of y.
Infinitely many solutions
[Ans. A]
For all real symmetric matrices, the
Eigenvalues are real (property), they may
be either ve or ve and also may be same.
The sum of Eigenvalues necessarily not be
zero.
[Ans. C]
p q
0
1
r s
( pplying p
q
r
s element ry tr nsform tions)
p
q pr qs
[
]
pr qs r
s
hey h ve s me r nk N
1
X1 , X2
1
1
2 , 1 1, 2 2
, where
1 1
P X1 X2
1 2
1 0 1 0
0 2 0 2
[Ans. B]
Given:
2.
Solving
0
& D=
0
1
Hence
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 26
1 1 1 0 2 1
A
1 2 0 2 1 1
6.
12.
[Ans. B]
A= [
]=[
A=[
[Ans. B]
Given
I
Hence rank (A) = n
Hence AX= Y will have unique solution
8.
[Ans. C]
9.
[Ans. C]
Approach 1:
13.
14.
Assume,
10
Now | I
[Ans. B]
Dim of null space [A]= nullity of A.
|
)(
- is also vector
For given A = [
I)
0
[Ans. B]
If AX =
From this result [1, 2,
for M
|
(
I)
n
For diagonal matrix Eigenvalues are
diagonal elements itself.
n(n
)
[Ans. A]
A=[ ]
i if i j
= 0 otherwise.
For n n matrix
Mathematics
)=0
[Ans. D]
11.
[Ans. C]
A null matrix can be obtained by
multiplying either with one null matrix or
two singular matrices.
]
]
( )
By rank nullity theorem
Rank [A]+ nullity [A]= no. of columns[A]
Nullity [A]= 3
Nullity , -
Approach 2:
Eigenvalues of (
I) is = 1, 1/2
Eigenvalues of (X+5I) is = 3, 2
Eigenvalues of (
I) (X+5I) is =
,
10.
15.
[Ans. A]
A=|
Characteristics equation |
|
I|
|
j
j
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 27
x
] 0x 1
Mathematics
0 1
x
x
j
j
j
j
x
] 0x 1
0 1
x
16.
[Ans. C]
A[
]=[
| | |
]
|
| |
(
| |)
=Product of eigenvalues
Verify options
Options (C) correct answer
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 28
Mathematics
(B)
(D)
ME - 2008
6.
A coin is tossed 4 times. What is the
probability of getting heads exactly 3
times?
(A)
(C)
(B)
(D)
2.
ME - 2009
7.
The standard deviation of a uniformly
distributed random variable between 0
and 1 is
(A)
(C)
(B)
(D)
ME - 2006
3.
Consider a continuous random variable
with probability density function
f(t) = 1 + t for 1 t 0
= 1 t for 0 t 1
The standard deviation of the random
variable is:
(C)
(A)
(D)
(B)
4.
(A)
(C)
(B)
(D)
ME - 2007
5.
Let X and Y be two independent random
variables. Which one of the relations
between expectation (E), variance (Var)
and covariance (Cov) given below is
FALSE?
(A) E (XY) = E (X) E (Y)
(B) Cov (X, Y) = 0
(C) Var (X + Y) = Var (X) + Var (Y)
(D)
(X Y )
( (X)) ( (Y))
8.
ME - 2010
9.
A box contains 2 washers, 3 nuts and 4
bolts. Items are drawn from the box at
random one at a time without
replacement. The probability of drawing
2 washers first followed by 3 nuts and
subsequently the 4 bolts is
(A) 2/315
(C) 1/1260
(B) 1/630
(D) 1/2520
ME - 2011
10. An unbiased coin is tossed five times. The
outcome of each toss is either a head or a
tail. The probability of getting at least one
head is________
(A)
(C)
(B)
(D)
ME - 2012
11. A box contains 4 red balls and 6 black
balls. Three balls are selected randomly
from the box one after another, without
replacement. The probability that the
selected set has one red ball and two
black balls is
(A) 1/20
(C) 3/10
(B) 1/12
(D) 1/2
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 29
ME - 2013
12. Let X be a normal random variable with
mean 1 and variance 4. The probability
(X
) is
(A) 0.5
(B) Greater than zero and less than 0.5
(C) Greater than 0.5 and less than 1.0
(D) 1.0
13.
18.
19.
20.
16.
( )
( )
( )
Mathematics
CE - 2005
1.
Which one of the following statements is
NOT true?
(A) The measure of skewness is
dependent upon the amount of
dispersion
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 30
CE - 2007
4.
If the standard deviation of the spot speed
of vehicles in a highway is 8.8 kmph and
the mean speed of the vehicles is
33 kmph, the coefficient of variation in
speed is
(A) 0.1517
(C) 0.2666
(B) 0.1867
(D) 0.3646
Mathematics
CE - 2008
5.
If probability density function of a random
variable x is
x for
x
nd
f(x) {
for ny other v lue of x
Then, the percentage probability
P.
/ is
(A) 0.247
(B) 2.47
6.
(C) 24.7
(D) 247
CE - 2009
7.
The standard normal probability function
can be approximated as
(x )
|x | )
exp(
Where x = standard normal deviate. If
mean and standard deviation of annual
precipitation are 102 cm and 27 cm
respectively, the probability that the
annual precipitation will be between
90 cm and 102 cm is
(A) 66.7%
(C) 33.3%
(B) 50.0%
(D) 16.7%
CE - 2010
8.
Two coins are simultaneously tossed. The
probability of two heads simultaneously
appearing is
(A) 1/8
(C) 1/4
(B) 1/6
(D) 1/2
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 31
CE - 2011
9.
There are two containers with one
containing 4 red and 3 green balls and the
other containing 3 blue and 4 green balls.
One ball is drawn at random from each
container. The probability that one of the
balls is red and the other is blue will be
(A) 1/7
(C) 12/49
(B) 9/49
(D) 3/7
CE - 2012
10. The annual precipitation data of a city is
normally distributed with mean and
standard deviation as 1000mm and
200 mm, respectively. The probability
that the annual precipitation will be more
than 1200 mm is
(A) < 50 %
(C) 75 %
(B) 50 %
(D) 100 %
11.
14.
15.
16.
(C)
(B)
(D)
CE - 2013
12. Find the value of such that the function
f(x) is a valid probability density function
____________________
(x
)(
f(x)
x)
for
x
otherwise
CE - 2014
13. The probability density function of
evaporation E on any day during a year in
a watershed is given by
f( )
mm d y
Mathematics
CS - 2005
1.
Box P has 2 red balls and 3 blue balls and
box Q has 3 red balls and 1 blue ball. A
ball is selected as follows: (i) select a box
(ii) choose a ball from the selected box
such that each ball in the box is equally
likely to be chosen. The probabilities of
selecting boxes P and Q are 1/3 and 2/3
respectively. Given that a ball selected in
the above process is red, the probability
that it comes from box P is
(A) 4/19
(C) 2/9
(B) 5/19
(D) 19/30
2.
otherwise
The probability that E lies in between 2
and 4 mm/day in a day in the watershed
is (in decimal) ______
(B) f(b)
th
th
f( )
(D) x f(x)dx
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 32
CS - 2006
3.
For each element in a set of size 2n, an
unbiased coin is tossed. The 2n coin
tosses are independent. An element is
chosen if the corresponding coin toss
were head. The probability that exactly n
elements are chosen is
(A) ( n )
(C) ( n )
(D)
(B) ( n )
CS - 2007
Linked Data for Q4 & Q5 are given below.
Solve the problems and choose the correct
answers.
Suppose that robot is placed on the
Cartesian plane. At each step it is easy to
move either one unit up or one unit right,
i.e if it is at (i,j) then it can move to either
(i+1,j) or (i,j+1)
4.
How many distinct paths are there for the
robot to reach the point (10,10) starting
from the initial position (0,0)?
(C) 210
(A)
20
(D) None of these
(B) 2
5.
6.
/
. / .
Wh t is
the probability that 2 appears at an
earlier position than any other even
number in the selected permutation?
(A)
(C)
(B)
(D) none of these
Mathematics
CS - 2008
7.
Let X be a random variable following
normal distribution with mean +1 and
variance 4. Let Y be another normal
variable with mean of 1 and variance
unknown
If (X
)
(Y ) the
standard deviation of Y is
(A) 3
(C)
(B) 2
(D) 1
8.
CS - 2009
9.
An unbalanced dice (with 6 faces,
numbered from 1 to 6) is thrown. The
probability that the face value is odd is
90% of the probability that the face value
is even. The probability of getting any
even numbered face is the same. If the
probability that the face is even given that
it is greater than 3 is 0.75, which one of
the following options is closest to the
probability that the face value exceeds 3?
(A) 0.453
(C) 0.485
(B) 0.468
(D) 0.492
CS - 2010
10. Consider a company that assembles
computers. The probability of a faulty
assembly of any computer is p. The
company
therefore
subjects
each
computer to a testing process. This
testing process gives the correct result for
any computer with a probability of q.
What is the probability of a computer
being declared faulty?
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 33
(A)
(B)
(C)
(D)
11.
12.
pq+(1 p)(1 q)
(1 q)p
(1 p)q
pq
CS - 2011
13. A deck of 5 cards (each carrying a distinct
number from 1 to 5) is shuffled
thoroughly. Two cards are then removed
one at a time from the deck. What is the
probability that the two cards are
selected with the number on the first card
being one higher than the number on the
second card?
(A)
(C)
(B)
(D)
14.
15.
Mathematics
CS - 2012
16. Suppose a fair six sided die is rolled
once. If the value on the die is 1,2, or 3 the
die is rolled a second time. What is the
probability that the some total of value
that turn up is at least 6?
(A) 10/21
(C) 2/3
(B) 5/12
(D) 1/6
17.
CS - 2013
18. Suppose p is the number of cars per
minute passing through a certain road
junction between 5 PM and 6 PM, and p
has a Poisson distribution with mean 3.
What is the probability of observing
fewer than 3 cars during any given
minute in this interval?
e
(A) e
(C)
e
(B) e
(D)
CS - 2014
19. Suppose you break a stick of unit length
at a point chosen uniformly at random.
Then the expected length of the shorter
stick is ________ .
20.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 34
21.
22.
23.
24.
ECE - 2006
3.
A probability density function is of the
).
form (x)
e || x (
The value of K is
(A) 0.5
(C) 0.5a
(B) 1
(D) A
4.
ECE - 2007
5.
If E denotes expectation, the variance of a
random variable X is given by
(A) E[X2] E2[X]
(C) E[X2]
(B) E[X2] + E2[X]
(D) E2[X]
6.
ECE - 2005
1.
A fair dice is rolled twice. The probability
that an odd number will follow an even
number is
2.
( )
( )
( )
( )
Mathematics
x2
1
exp
dx is
2 0
8
(A) 1
(B)
(C) 2
(D)
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 35
ECE - 2008
7.
The probability density function (PDF) of
a random variable X is as shown below.
(x)
exp( |x|)
exp( |x|) is
the probability density function for the
real random variable X, over the entire x
axis. M and N are both positive real
numbers. The equation relating M and N
is
8.
PDF
PDF
Mathematics
(A)
1
(B) 2M
x
11
The -1
corresponding
cumulative
0
distribution function (CDF) has the form
(A)
(C) M + N = 1
(D) M + N = 3
ECE - 2009
9.
Consider two independent random
variables X and Y with identical
distributions. The variables X and Y take
value 0, 1 and 2 with probabilities
CDF
N=1
(B)
conditional probability
(x y
)
|x y|
(A) 0
(C)
(B)
(D) 1
CD
F
C
D
F
10.
0
1
-1
(C)
(B)
11.
1
1
1
1
0
0
1
1
2
(C)
2
(D)
10
1
2
(A)
CDF 1
CDF
1
1
th
10
10
1
C2
2
(D)
10
1
C2
2
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 36
Consider two identically distributed zeromean random variables U and V . Let the
cumulative distribution functions of U
and 2V be F(x) and G(x) respectively.
Then, for all values of x
(x))
(A) ( (x)
(B) ( (x)
(C) ( (x)
(D) ( (x)
Mathematics
(x)) x
(x)) x
ECE - 2014
17. In a housing society, half of the families
have a single child per family, while the
remaining half have two children per
family. The probability that a child picked
at random, has a sibling is _____
18.
19.
20.
21.
22.
23.
24.
of
(x))
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 37
EE - 2005
1.
If P and Q are two random events, then
the following is TRUE
(A) Independence of P and Q implies that
probability (P Q) = 0
(B) Probability (P Q) Probability (P)
+Probability (Q)
(C) If P and Q are mutually exclusive,
then they must be independent
(D) Probability (P Q) Probability (P)
2.
EE - 2006
3.
Two f ir dice re rolled nd the sum r
of the numbers turned up is considered
(A) Pr (r > 6) =
(B) Pr (r/3 is an integer) =
(C) Pr (r = 8|r/4 is an integer) =
(D) Pr (r = 6|r/5 is an integer) =
EE - 2007
4.
A loaded dice has following probability
distribution of occurrences
Dice Value
Probability
1
2
6
If three identical dice as the above are
thrown, the probability of occurrence of
values, 1, 5 and 6 on the three dice is
(A) same as that of occurrence of 3, 4, 5
(B) same as that of occurrence of 1, 2, 5
(C) 1/128
(D) 5/8
Mathematics
EE - 2008
5.
X is a uniformly distributed random
variable that takes values between 0 and
1. The value of E{X } will be
(A) 0
(C) 1/4
(B) 1/8
(D) 1/2
EE - 2009
6.
Assume for simplicity that N people, all
born in April (a month of 30 days), are
collected in a room. Consider the event of
atleast two people in the room being born
on the same date of the month, even if in
different years, e.g. 1980 and 1985. What
is the smallest N so that the probability of
this event exceeds 0.5?
(A) 20
(C) 15
(B) 7
(D) 16
EE - 2010
7.
A box contains 4 white balls and 3 red
balls. In succession, two balls are
randomly selected and removed from the
box. Given that the first removed ball is
white, the probability that the second
removed ball is red is
(A) 1/3
(C) 1/2
(B) 3/7
(D) 4/7
ECE\EE\IN - 2012
8.
Two independent random variables X and
Y are uniformly distributed in the interval
,
-. The probability that max ,
- is
less than 1/2 is
(A) 3/4
(C) 1/4
(B) 9/16
(D) 2/3
EE - 2013
9.
A continuous random variable x has a
probability density function
+ is
f(x) e
x
. Then *x
(A) 0.368
(C) 0.632
(B) 0.5
(D) 1.0
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 38
EE - 2014
10. A fair coin is tossed n times. The
probability that the difference between
the number of heads and tails is (n 3) is
(C)
(A)
(B)
(D)
11.
12.
13.
14.
IN - 2005
1.
The probability that there are 53 Sundays
in a randomly chosen leap year is
(A)
(C)
(B)
(D)
2.
Mathematics
exp .
/ d =0.6
IN - 2006
4.
You have gone to a cyber-cafe with a
friend. You found that the cyber-caf has
only three terminals. All terminals are
unoccupied. You and your friend have to
make a random choice of selecting a
terminal. What is the probability that
both of you will NOT select the same
terminal?
(A)
(C)
(B)
(D) 1
5.
th
(A)
(C)
(B)
(D)
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 39
6.
Mathematics
IN - 2007
7.
Assume that the duration in minutes of a
telephone conversation follows the
IN - 2011
12. The box 1 contains chips numbered 3, 6,
9, 12 and 15. The box 2 contains chips
numbered 6, 11, 16, 21 and 26. Two chips,
one from each box, are drawn at random.
The numbers written on these chips are
multiplied. The probability for the
product to be an even number is
(A)
(C)
(B)
(D)
e ,x
9.
(A)
(C)
(B) 6
(D) 36
IN - 2013
13. A continuous random variable X has
probability density f(x) =
.
Then P(X > 1) is
(A) 0.368
(C) 0.632
(B) 0.5
(D) 1.0
IN - 2014
14. Given that x is a random variable in the
r nge ,
- with
prob bility density
function
___________________
IN - 2009
10. A screening test is carried out to detect a
certain disease. It is found that 12% of the
positive reports and 15% of the negative
reports are incorrect. Assuming that the
probability of a person getting a positive
report is 0.01, the probability that a
person tested gets an incorrect report is
(A) 0.0027
(C) 0.1497
(B) 0.0173
(D) 0.2100
15.
IN - 2010
11. The diameters of 10000 ball bearings
were measured. The mean diameter and
standard deviation were found to be
10 mm and 0.05mm respectively.
Assuming Gaussian distribution of
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 40
Mathematics
4.
[Ans. D]
The number of ways coming 8 and 9 are
(2,6),(3,5),(4,4),(5,3),(6,2),(3,6),(4,5),
(5,4),(6,3)
Total ways =9
So Probability of coming 8 and 9 are
[Ans. D]
5.
[Ans. D]
X and Y are independent
( ) ( ) ( ) re true
Only (D) is odd one
6.
[Ans. A]
Number of favourable cases are given by
HHHT
HHTH
HTHH
THHH
Total number of cases
= 2C1 2C1 2C1 2C1 =16
2.
[Ans. B]
Probability of defective item =
Probability of not defective item = 1 0.1
= 0.9
So, Probability that exactly 2 of the
chosen items are defective
=
( ) ( )
3.
[Ans. B]
Probability =
7.
[Ans. A]
A uniform
function
t)dt
t
t
6
t(
t)dt
t)dt
= (t
=0
t )dt
1
density
Density function
f(x) b a
0
t (
t)dt
a,x b
a x,x b
Mean E(x)=
t)dt
x(F(x))
x a
ab
2
x F(x) xF(x)
x a
x a
=
Standard deviation = v ri nce
=
and
0,x a
x a
f(x) f x dx
, axb
0
b a
xb
0,
t (
distribution
Variance = t f(t)dt
= t (
( oth defective)
S mple sp ce
( oth defective)
1
1
b
dx x.
dx
Variance x
ba
x a
x a b a
b
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 41
x3 xL
3(b a) a 2 b a
Mathematics
3
1 7
(3 3 1)
2 8
b3 a3 (b2 a2 )2
3(b a) 4 b a 2
2
3(b a)
4 b a
b2 a2 2ab
12
9.
[Ans. C]
Probability of drawing 2 washers, first
followed by 3 nuts, and subsequently the
4 bolts
10.
[Ans. D]
Required probability =
(b a)2
12
. / . /
(b a)2
12
(b a)
12
11.
[Ans. D]
Given 4R and 6B
,
-
12.
[Ans. C]
Standard deviation =
8.
10
1
12
12
[Ans. D]
Let probability of getting atleast one head
= P(H) then
P (at least one head) = 1 P(no head)
P(H)=1 P(all tails)
But in all cases, 23=8
1 7
8 8
X=0
P (H) = 1
(X
) is
Below X
(X
) has to be less than 0.5 but
greater than zero
Alternately
Probability of getting at least one head
( ) ( )
13.
1 7
1
8 8
Alternately
From Binomial theorem
Probability of getting at least one head
pq
( )
( )
X=1
[Ans. D]
A
event that he knows the correct
answer
B
event that student answered
correctly the question P(B) = ?
( )
( )
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 42
( )
he knows
correct nswer
)
(
( )
14.
( ) ( )
)
( )
[Ans. D]
x
1
2
P(x) 0.3
0.6
(x)
(x)
x
18.
V(x)
x
(
(x )
[Ans. A]
3
0.1
So from figure
Mean value = 1
V ri nce : me n x defective pieces
(x )
)
n(n
(
)
(
) (
)
(
)
(x)
x (x)
Mathematics
, (x)-
(x) ( x (x))
) ( )
( )
15.
[Ans. A]
19.
16.
Given that
x x
z
ere x
, s x gre ter th n
z
)
ence prob bility (z
17.
( ) ( )
( ) ( )
e
dz
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 43
20.
[Ans. B]
Mean m = np = 5.2
me
(x
) e
25 Calculators
23 Non-defective
2 Defective
5 Calculators
e
(x
Mathematics
)
4 Non-defective
1 Defective
CE
1.
2.
[Ans D]
A, B, C are true
(D) is not true. Since in a negatively
skewed distribution
mode > median > mean
[Ans. D]
Let the mean and standard deviation of
the students of batch C be and
respectively and the mean and standard
deviation of entire class of first year
students be and respectively
Now given,
and
Now Z =
4.
[Ans. C]
5.
[Ans. B]
Given f(x) = x for
x
= 0 else where
(
f(x)dx
x dx
=0 1
The probability expressed in percentage
P=
= 2.469% = 2.47%
6.
[Ans. A]
Given
P(private car) = 0.45
P(bus 1 public transport) = 0.55
Since a person has a choice between
private car and public transport
P(public transport) = 1 P(private car)
= 1 0.45 =0.55
P(bus) = P(bus public transport)
(bus public tr nsport)
(public tr nsport)
= 0.55 0.55
= 0.3025 0.30
Now P(metro)
= 1 [P(private car) + P(bus)]
= 1 (0.45 + 0.30) = 0.25
[Ans. B]
Since population is finite, hypergeometric
distribution is applicable
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 44
12.
[Ans. D]
ere
cm;
(
x 102)
=P.
[Ans. 6]
f(x)dx
( x
f(x)
( x
cm
6
Mathematics
)dx
x
otherwise
x7
/
[
=P(
x
)
This area is shown below:
)]
-0.44
( )
)(
= 0.5 0.3345
= 1.1655 16.55%
Closest answer is 16.7%
8.
13.
[Ans. 0.4]
(
f( )d
[Ans. C]
( )|
P(2 heads) =
9.
[Ans. C]
P(one ball is Red & another is blue)
= P(first is Red and second is Blue)
14.
=
10.
[Ans. A]
Given = 1000, = 200
We know that Z
When X= 1200, Z
Req. Prob = P (X
(Z
)
(
Z
Less than 50%
11.
[Ans. D]
(X
)
( )
(X
(X
15.
[Ans. B]
S * T+
n( )
( )
n(S)
16.
( )
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 45
no of vehicles
(
veh km
= 2.e
= 0.2707
CS
1.
[Ans. A]
P: Event of selecting Box P,
Q: Event of selecting Box P
P(P)=1/3, P(Q)=2/3
P(R/P)=2/5, P(R/Q)=3/4
P(R/P).P(P)
P(R/P).P(P) P(R/Q)P(Q)
2/51/3
4/19
2/51/3 3/ 4 2/3
P(P/R)=
2.
5.
[Ans. D]
The robot can reach (4,4) from (0,0) in
8C ways as argued in previous problem.
4
Now after reaching (4,4) robot is not
allowed to go to (5,4)
Let us count how many paths are there
from (0,0) to (10,10) if robot goes from
(4,4) to (5,4) and then we can subtract
this from total number of ways to get the
answer.
Now there are 8C4 ways for robot to reach
(4,4) from (0,0) and then robot takes the
U move from ( ) to ( ) ow from
(5,4) to (10,10) the robot has to make 5
U moves nd moves in ny order
which can be done in 11! ways
= 11C5 ways
Therefore, the number of ways robot can
move from (0,0) (10,10) via (4,4) (5,4)
move is
[Ans. C]
If f (x) is the continuous probability
density function of a random variable X
then,
(
x b) P(
x b)
b
= f x dx
3.
4.
[Ans. A]
The probability that exactly n elements
are chosen
=The probability of getting n heads out of
2n tosses
=
) . /
=
=
) (
Mathematics
(Binomial formula)
)
8C
4
[Ans. A]
Consider the following diagram
(3,3)
11C
5
8 11
4 5
20 8 11
ways
10 4 5
(0,0)
The robot can move only right or up as
defined in problem. Let us denote right
move by nd up move by U ow to
reach (3, 3), from (0,0) , the robot has to
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 46
6.
[Ans. D]
umber of permut tions with in the
first position =19!
Number of permutations with in the
second position = 10 18!
(Fill the first space with any of the 10 odd
numbers and the 18 spaces after the 2
with 18 of the remaining numbers in 18!
ways)
umber of permut tions with in rd
position =10 9 17!
(Fill the first 2 place with 2 of the 10 odd
numbers and then the remaining 17
places with remaining 17 numbers)
nd so on until is in th place. After
that it is not possible to satisfy the given
condition, since there are only 10 odd
numbers v il ble to fill before the
So the desired number of permutations
which satisfies the given condition is
8.
[Ans. C]
Let C denote computes science study and
M denotes maths study.
P(C on Monday and C on Wednesday)
= P(C on Monday, M on Tuesday and C on
Wednesday)
+ P(C on Monday, C on Tuesday and C on
Wednesday)
=1 0.6 0.4+ 1 0.4 0.4
= 0.24 + 0.16 = 0.40
9.
[Ans. B]
It is given that
P (odd) = 0.9 P (even)
Now since P(x) = 1
P (odd) + P (even) = 1
0.9 P (even) + P (even) = 1
P(even) =
/ = P (z
.z
/ = P (z
(z
) = P (z
10.
_____(i)
P(f ce
)
)
(
)
(
(0.5263)
= 0.1754
It is given that
P(even | face > 3) = 0.75
[Ans. A]
Given = 1, = 4
=2
and = 1,
is unknown
Given, P(X
) = P (Y 2 )
Converting into standard normal variates,
.z
= 0.5263
Mathematics
= 0.75
= 0.75
( )
( )
=1
f ulty
q
p
=3
not
f ulty
=0.468
[Ans. A]
The tree diagram of probabilities is
shown below
q
th
pq
th
q)(
p)
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 47
11.
[Ans. A]
If
b c
Then, no. of divisors of
(x
)(y
)(z
)
iven
o of ivisors of
(
)(
(
)(
)
13.
14.
15.
[Ans. C]
(x ) , (x)V(x)
Where V(x) is the variance of x,
Since variance is and hence never
negative,
( t le st one he d)
TT )
( )
16.
No. of divisors of
of
o of divisors of
(
)(
)
Mathematics
[Ans. B]
Required Probability
= P (getting 6 in the first time)
+ P (getting 1 in the first time and getting
5 or 6 in the second time)
+ P (getting 2 in the first time and getting
4 or 5 or 6 in the second time)
+ P (getting 3 in the first time and getting
3 or 4 or 5 or 6 in the second time)
( )
( )
( )
17.
[Ans. C]
The p.d.f of the random variable is
x
+1
P(x) 0.5 0.5
The cumulative distribution function F(x)
is the probability upto x as given below
x
+1
F(x) 0.5 1.0
So correct option is (C)
18.
[Ans. C]
e
(k)
[Ans. A]
+
The five cards are *
Sample space
ordered pairs
st
nd
P (1 card = 2 card + 1)
)( )( )( )+
*(
k
P is no. of cars per minute travelling.
[Ans. D]
y = a x is the correct expression
Since variance of constant is zero.
[Ans. A]
Let A be the event of head in one coin. B
be the event of head in second coin.
The required probability is
*
) ( )+
(
)| )
( )
(
)
( )
(
)
(both coin he ds)
For k = 2 , P(2)=
Hence
( )
e
e
th
( )
( )
e
4
th
e
5
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 48
e
(
20.
( )
(
24.
[Ans. 10]
22 occurs in following ways
6 6 6 4
w ys
6 6 5 5
w ys
[Ans. 0.25]
( ) P(S) = 1
( )
( )
(
)
utu lly exclusive (
)
( )
( )
et ( ) x; ( )
x
P(A) P(B) = x(
x)
Maximum value of y = x (
x)
dy
(
x) x
dx
= 2x = 1
x
(max)
x
21.
( )
)
e
19.
( )
Mathematics
ximum v lue of y
ECE
1.
[Ans. D]
3 1
6 2
3 1
P(even number )
6 2
Since events are independent, therefore
1 1 1
P(odd/even)
2 2 4
P(Odd number)
p
22.
2.
[Ans. A]
I
23.
ut
rom
x
th
th
dx
dx
dx
nd
x
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 49
Put
3.
in
equ tion
A
0.6
B
A P A B
We know that, P
PB
B
[Ans. C]
P x.dx 1
Ke
Mathematics
.dx 1
ax
e dx
dx
x x,for x 0
x for x 0
K K
1
a a
( )
= 0.6 0.2
= 0.12
or
( )
7.
[Ans. A]
CDF: F x
dx
For x<0, F x
x 1
dx
4.
[Ans. D]
. / ( )
P (Y/D) =
. / ( )
. / ( )
=
5.
. / ( )
=0.4
F0
1
2
For x>0, F x F0
x 1
dx
[Ans. A]
var[x]= =E[(x x)2]
Where, x=E[x]
x= expected or mean value of X defining
1 x2
x concave downwards
2 2
E[X] =
xf xdx
x
8.
[Ans. A]
x P xi x xi dx
P xdx 1
x
xiP xi
By simplifying
2
3
M N 1
9.
[Ans. B]
x+y=2
x y=0
=> x =1, y = 1
P(x=1,y=1) =
[Ans. C]
Probability of failing in paper 1,
P (A) = 0.3
th
th
= 1/16
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 50
10.
[Ans. C]
14.
[Ans. C]
P(no. of tosses is odd)
(no of tosses is
be tail always.
So probability of getting head in first two
tosses
(
)(
)(
) (
)
= (1/2)10
11.
Mathematics
[Ans. B]
Both the teacher and student are wrong
Mean =
k
= 0.1 + 0.4 + 1.2 + 0.8 + 0.5
= 3.0
E(x2) =
k
etc
So,
P(no. of tosses in odd)
[Ans. D]
P(H, H, H, T) +P (H, H, H, H )
=
13.
. /
. /
15.
[Ans. B]
( V V)
( V
V )
*z
v
v+ Linear combination of
Gaussian random variable is Gaussian
(z )
and not mean till zero
because both random variables has mean
zero hence ( )
Hence Option B is correct
16.
[Ans. D]
F(x) = P{X x}
(x)
* X x+
x
2X
3
. / =
[Ans. C]
Total number of cases = 36
Favorable cases:
(1, 1)
(2, 1)
(3, 1)
(4, 1)
(5, 1)
(6, 1)
(1, 2)
(2, 2)
(3, 2)
(4, 2)
(5, 2)
(6, 2)
(1, 3)
(2, 3)
(3, 3)
(4, 3)
(5, 3)
(6, 3)
(1, 4)
(2, 4)
(3, 4)
(4, 4)
(5, 4)
(6, 4)
(1, 5)
(2, 5)
(3, 5)
(4, 5)
(5, 5)
(6, 5)
(1, 6)
(2, 6)
(3, 6)
(4, 6)
(5, 6)
(6, 6)
Total number of favorable cases
Then probability
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 51
17.
18.
(x)
et S
x f(x)
[Ans. C]
21.
II)gives
)S
(x)
i.e. The expected number of tosses (after
first head) to get first tail is 2 and same
can be applicable if first toss results in
tail.
Hence the average number of tosses is
22.
20.
(I
(II)
(I)
f(x)
(x)
x (x)
*X is l rgest +
19.
Mathematics
(z
23.
th
dz
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 52
|x| exp 4
x
x
x exp 4
5 dx
5 dx
5 dx
2.
x exp 4
x exp 4
[ exp (
,
24.
|x| exp 4
[Ans. B]
P(A|B) =
5 dx
5 dx
x ) dx]
4/5
Parcel is
sent to R
Required probability =
R
3.
1/5
Parcel is lost
Parcel is lost
parcel
is
[Ans. C]
If two fair dices are rolles the probability
distribution of r where r is the sum of the
numbers on each die is given by
r
P(r)
4/5
that
)
( )
Parcel is sent to
Probability
1/5
Mathematics
lost
2
Probability that parcel is lost by
3
Probability that parcel is lost by
provided that the parcel is lost
4
5
EE
1.
6
[Ans. D]
(A) is false since of P & Q are
independent
pr(P Q) = pr(P) pr(Q)
which need not be zero.
(B) is false since
pr(P Q)
= pr(P) + pr(Q) pr(P Q)
(C) is false since independence and
mutually exclusion are unrelated
properties.
7
8
9
10
11
12
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 53
P(1, 5, 6) =
P(3, 4, 5) =
P(1, 2, 5) =
is correct.
[Ans. C]
x is uniformly distributes in [0, 1]
Probability density function
=
=
Mathematics
f(x) =
=1
dx
=
=
6.
[Ans. B]
Let N people in room. So no. of events that
at least two people in room born at same
date
Solving, we get N = 7
7.
[Ans. C]
(II is red|I is white)
(II is red nd I is white)
(I is white)
(I is white nd II is red)
(I is white)
8.
[Ans. B]
pr(r = 8) =
pr(r = 8 | r/4 is an integer) =
=
Choice (C) is correct.
4.
[Ans. C]
Dice value
1
2
Probability
and
is the entrie
rectangle
The region in which maximum of {x, y} is
less than
5
6
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 54
12.
Mathematics
dx
x|
dx
dx
x|
13.
p .m x,x y-
f(x)dx
by property
kx dx
k
9.
14.
[Ans. A]
(x
)
,e
10.
e dx
e -
, e -
[Ans. B]
Let number of heads = x,
Number of tails n x
ifference x (n x)or (n
x n or n
x
If x n n
x
n
x
If n
IN
1.
[Ans. D]
or x
[Ans. C]
Since the reading taken by the instrument
is normally distributed, hence
P(x
x )
Where,
[Ans. *] Range 0.13 to 0.15
Let proportionality constant = k
( dot) k ( dots)
k
( dots)
k
( dots)
k ( dots)
k
( dots)
k
k
k
k
k
k
k
k
k
rob bility of showing dots
[Ans. D]
Since leap chosen will be random, so, we
assume it being the case of uniform
probability distribution function.
Number of days in a leap year=366 days
Now
.dx
e n of the distribution
St nd rd devi tion of the
distribution.
exp(
)dx
where, n=x 10 (
kg)
and from the data given in question
dx
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 55
3.
[Ans. D]
Mean=
8.
[Ans. B]
By definition of Gaussian distribution,
total area under the curve =1. Hence half
of the area =0.5
9.
[Ans. A]
=5.9 V.
(
V
(closest answer is 0.2)
P(x)=
4.
[Ans. C]
( )
Mean =
( )
x (x)dx =
Var(x)= (x
1 2
3 3
5.
Mathematics
[Ans. A] ]
(x
(x)dx
) dx =
10.
[Ans. C]
Probability of incorrect report
11.
[Ans. C]
mm
mm
Then probability
P(x)dx 1
x dx = 6
c
1
2
6.
[Ans. A]
Probability that the sum of digits of two
dices is even is same either both dices
shows even numbers or odd numbers on
the top of the surface
( )
( )
( )
Where
( )
Probability of occurring even
number of both the dices
( )
Probability of occurring odd
number of both the dices
(
(X
where x
mm
( )
nd (
( )
12.
7.
[Ans. A]
f(x) dx=P
or
or e
.dx =P
[Ans. D]
For the product to be even, the numbers
from both the boxes should not turn out
to be odd simultaneously.
( )
( )( )
or P = .
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 56
13.
[Ans. A]
f(x)dx
e |
14.
15.
e dx
[Ans. 2]
For valid pdf
Mathematics
dx
pdf dx
;k
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 57
Mathematics
Numerical Methods
ME 2005
1.
Starting from x = 1, one step of Newton
Raphson method in solving the equation
x +3x 7=0 gives the next value (x) as
(A) x=0.5
(C) x = .5
(B) x= . 0
(D) x=2
2.
ME 2006
3.
Match the items in columns I and II.
Column I
Column II
(P) Gauss-Seidel
(1) Interpolation
method
(Q) Forward
(2) Non-linear
Newton-Gauss
differential
method
equations
(R) Runge-Kutta
(3) Numerical
method
integration
(S) Trapezoidal
(4) Linear algebraic
Rule
equation
(A)
2
(B)
2
(C)
2
(D)
2
4.
at (0 5) is
(C) y = x
(D) y = x
5
5
ME 2007
5.
A calculator has accuracy up to 8 digits
2
sinxdx
0
ME 2010
6.
Torque exerted on a flywheel over a cycle
is listed in the table. Flywheel energy (in
J per unit cycle) using impsons rule is
Angle (degree)
Torque (N-m)
0
0
60
1066
120
323
180
0
240
323
300
55
360
0
(A) 542
(C) 1444
(B) 992.7
(D) 1986
ME 2011
7.
The integral
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 58
10.
The value of .
( )
value approximate
estimate?
calculated using
12.
13.
Consider
an
equation
= t
.If x =x at t = 0 , the
CE 2005
Linked Answer Question 1 and 2
Give a>0, we wish to calculate its
reciprocal value 1/a by using Newton
Raphson Method for f(x) = 0.
2.
= (x
(B) x
= (x
x )
(C) x
= 2x
ax
(D) x
=x
in
the
(C)
(D)
CE 2007
4.
The following equation needs to be
numerically solved using the NewtonRaphson method
x3 + 4x 9 = 0 the iterative equation for
the purpose is (k indicates the iteration
level)
differential
1.
(A)
(B) 0
value)
is evaluated
ordinary
Mathematics
CE 2006
3.
A 2nd degree polynomial f(x) has values of
1, 4 and 15 at x = 0, 1 and 2 respectively.
5.
(A) x
(B) x
(C) x
=x
(D) x
CE 2008
6.
Three values of x and y are to be fitted in
a straight line in the form y = a + bx by
the method of least squares. Given
x = 6, y = 2 x =
and xy =
the values of a and b are respectively
(A) 2 and 3
(C) 2 and 1
(B) 1 and 2
(D) 3 and 2
CE 2009
7.
In the solution of the following set of
linear equation by Gauss elimination
using partial pivoting 5x + y + 2z = 34;
4y 3z = 12; and 10x 2y + z = 4; the
pivots for elimination of x and y are
(A) 10 and 4
(C) 5 and 4
(B) 10 and 2
(D) 5 and 4
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 59
CE 2010
8.
The table below given values of a function
F(x) obtained for values of x at intervals
of 0.25.
x
0 0.25
0.5 0.75 1.0
F(x) 1 0.9412 0.8 0.64 0.50
The value of the integral of the function
between the limits 0 to using impsons
rule is
(A) 0.7854
(C) 3.1416
(B) 2.3562
(D) 7.5000
CE
9.
2011
The square root of a number N is to be
obtained by applying the Newton
Raphson iterations to the equation
x
= 0. If i denotes the iteration
index, the correct iteration scheme will be
(A) x
(B) x
= (x
= (x
CE 2013
12. Find the magnitude of the error (correct
to two decimal places) in the estimation
of following integral using impsons
Rule. Take the step length as 1.___________
(x
1.
Consider
(D) x
= (x
he error in
xe dx
is 2
1
R
xn1 xn can be used to compute
2
xn
the
(A) square of R
(B) reciprocal of R
(C) square root of R
(D) logarithm of R
0 .
CE 2012
The estimate of .
1
3
for a continuous
The values of
and ( ) are 19.78 and
500.01, respectively. The corresponding
error in the central difference estimate
for h = 0.02 is approximately
(A) .
0
(C) .5
0
(B) .0
0
(D) .0
0
11.
f(x)|
series
CS 2008
2.
The minimum number of equal length
subintervals needed to approximate
3.
10.
the
= (x
0) dx
CS 2007
(C) x
Mathematics
obtained using
CS 2010
4.
Newton-Raphson method is used to
compute a root of the equation
x
13 = 0 with 3.5 as the initial value.
The approximation after one iteration is
(A) 3.575
(C) 3.667
(B) 3.677
(D) 3.607
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 60
CS 2012
5.
The bisection method is applied to
compute a zero of the function
f(x) = x
x
x
in the interval
[1,9]. The method converges to a solution
after ___________ iterations.
(A) 1
(C) 5
(B) 3
(D) 7
CS 2013
6.
Function f is known at the following
points:
x
f(x)
0
0
0.3 0.09
0.6 0.36
0.9 0.81
1.2 1.44
1.5 2.25
1.8 3.24
2.1 4.41
2.4 5.76
2.7 7.29
3.0 9.00
he value of f(x)dx computed using
the trapezpidal rule is
(A) 8.983
(C) 9.017
(B) 9.003
(D) 9.045
CS 2014
7.
The function f(x) = x sin x satisfied the
following equation:
( ) + f(x) + t cos x = 0.
The value of t is _________.
8.
Mathematics
(B) Only II
(C) Both I and II
(D) Neither I nor II
9.
= 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
then or equal to the exact value of
the defined integral
(II) The value of K obtained using the
impsons 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
ECE 2005
1.
Match the following and choose the
correct combination
Group I
Group II
(A) Newton1. Solving nonRaphson
linear equations
method
(B) Runge-Kutta
2. Solving linear
method
simultaneous
equations
(C) impsons
3. Solving ordinary
Rule
differential
equations
(D) Gauss
4. Numerical
elimination
integration
method
5. Interpolation
6. Calculation of
Eigen values
(A) A-6, B-1, C-5, D-3
(B) A-1, B-6, C-4, D-3
(C) A-1, B-3, C-4, D-2
(D) A-5, B-3, C-4, D-1
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 61
ECE 2007
2.
The equation x3 x2+4x 4=0 is to be
solved using the Newton-Raphson
method. If x=2 is taken as the initial
approximation of the solution, then the
next approximation using this method
will be
(A) 2/3
(C) 1
(B) 4/3
(D) 3/2
(A) 2
sin x
..
2 cos x
..
(C) 2
..
(D) 2
..
8.
The series
eXn
1 eXn
X2 eXn 1 Xn 1
(D) Xn1 n
Xn -eXn
ECE 2014
6.
The Taylor expansion of
is
(C) Xn1 1 Xn
ECE 2013
5.
A polynomial
f(x) = a x
a x
a x
a x a
with all coefficients positive has
(A) No real root
(B) No negative real root
(C) Odd number of real roots
(D) At least one positive and one
negative real root
(B) 2
7.
ECE 2008
3.
The recursion relation to solve x=
using Newton-Raphson method is
(A)
=e
(B)
=
e
ECE 2011
4.
A numerical solution of the equation
f(x) = x x
= 0 can be obtained
using Newton Raphson method. If the
starting value is x = 2 for the iteration,
the value of x that is to be used in the next
step is
(A) 0.306
(C) 1.694
(B) 0.739
(D) 2.306
Mathematics
converges to
(A) 2 ln 2
(B) 2
(C) 2
(D) e
EE 2007
1.
is
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 62
EE 2009
4.
Let x
7 = 0. The iterative steps for
the solution using Newton aphsons
method is given by
(A) x
= (x
(B) x
=x
(C) x
=x
(D) x
=x
EE 2013
7.
When the Newton Raphson method is
applied
to
solve
the
equation
f(x) = x
2x
= 0 the solution at the
end of the first iteration with the initial
guess value as x = .2 is
(A) 0.82
(C) 0.705
(B) 0.49
(D) 1.69
EE 2014
8.
The function ( ) =
is to be
solved using Newton-Raphson method. If
the initial value of is taken as 1.0, then
the absolute error observed at 2nd
iteration is ___________
IN 2006
1.
For k = 0
2
. the steps of
Newton-Raphson method for solving a
non-linear equation is given as
2
5
xk 1 xk xK2 .
3
3
(x
EE 2011
5.
Solution of the variables
and
for the
following equations is to be obtained by
employing the Newton-Raphson iterative
method
equation(i) 0x inx
0. = 0
equation(ii) 0x
0x cosx
0. = 0
Assuming the initial values
= 0.0 and
= .0 the jacobian matrix is
0
0.
0
0.
(A) *
(C) *
+
+
0
0.
0
0.
0 0
0
0
(B) *
(D) *
+
+
0
0
0
0
6.
Mathematics
IN 2007
2.
Identify the Newton-Raphson iteration
scheme for finding the square root of 2.
3.
(A) x
(x
(B) x
= (x
(C) x
(D) x
= 2
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 63
IN 2008
4.
It is known that two roots of the
nonlinear equation x3 6x2 +11x 6 = 0
are 1 and 3. The third root will be
(A) j
(C) 2
(B)
j
(D) 4
IN 2013
8.
While numerically solving the differential
equation
with
2xy = 0 y(0) =
using
IN 2009
5.
Mathematics
IN 2014
9.
The iteration step in order to solve for the
cube roots of a given number N using the
Newton- aphsons method is
(D) 2
(A) x
=x
(B) x
= (2x
(C) x
=x
(D) x
= (2x
x )
)
x )
)
IN 2010
6.
The velocity v (in m/s) of a moving mass,
starting from rest, is given as
=v
t.
( )
= 0 using the
Newton-Raphson method.
Let f(x) = x
x and x = 1 be the initial
guess of x. The value of x after two
iterations (x ) is
(A) 0.0141
(C) 1.4167
(B) 1.4142
(D) 1.5000
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 64
Mathematics
y = sin ( ) =
2
[Ans. C]
By N-R method ,
=x
f(x) = x
f( ) =
x =x
( )
( )
y = sin (
x =
y = sin( ) = 0
5
y = sin ( ) =
y = sin (
f (x) = x
f ( )= ,
=1
) = 0.70 0
)=
7
y = sin ( ) =
[Ans. C]
Given x y = 2
(i)
.0 x 0.0 y = b
(ii)
Multiply 0.99 is equation (i) and subtract
from equation (ii); we get
( .0
0. )x = b (2 0. )
0.02x = b
.
0.02x = b
x =
0.02
[Ans. D]
4.
[Ans. B]
Given f(x) = (x
2
)
f (x) = (x
f(x)dx = [(y
0.70 0
6.
y )
[(0
0)
0.70 0
0.70 0
[(0
y )]
7.
[Ans. C]
x
y=
( 0
0)
2(
2.7 /unit cycle.
Slope of normal = 3
( roduct of slopes = 1)
Slope of normal at point (0, 5)
y 5 = (x 0)
y= x 5
[Ans. A]
b a 2
0
h=
=
=
n
y = sin(0) = 0
0=0
[Ans. B]
ower = = Area under the curve.
h
(y
= [(y
y )
y
y )
2(0.70 0
2(y
2(y
)]
sinx dx =
5.
)=0
Trapezoidal rule
= 50 units
3.
0.70 0
(0.5) = .5
y = sin (
2.
0.70 0
1
1
x
dx = (y
= (
55)
2 )]
2
h
y
2
y )
= .
8.
[Ans. D]
By the definition only
y = sin ( ) = 0.70 0
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 65
9.
|x|dx is
h
ydx = [y
2
2(y
0.33
y ]
0.33
|x|dx =
.)
0.33
0.333
2(0.
0.
)]
13.
= . 0
10.
[ln(2.5)
2ln( . )
= .75
11.
2(ln2. )
2y
2 ln( . )
CE
1.
t|
x = 0.0
0. = 0.
= 2t
t|
f(x)dx = [y
2(y
iven in question
0
1
1
2
1
0.5
dx = [y
x
2
t
x =
2
rapezoidal rule
x
y
)dt
[Ans. C]
dx by trapezoidal rule
x
h=
[Ans. D]
The variation in options are much, so it
can be solved by integrating directly
dx
= t
dt
dx = ( t
ln( )]
2ln( .7)
Mathematics
..y
)]
a=0
i.e. f(x) =
2
3
0.33
a=0
Now f (x) =
f(x ) =
f (x ) =
2(y )]
0.
0.5]
=x
x
12.
=x
)
(
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 66
2.
[Ans. B]
For a = 7 iteration equation
Becomes x
= 2x
7x
with x = 0.2
x = 2x
7x = 2 0.2 7(0.2) = 0.12
and x = 2x
7x = 2 0.12 7(0. 2)
= 0.1392
[Ans. A]
f(x) = 1, 4, 15 at x = 0, 1 and 2
respectively
f(x)dx = (f
2f
=x
x
5.
f )
and
4.
= 30
= 5
5 =
5 ( ) =
ince = from (i)
5 ( )
=
=5
=
olving for and
(5 ) =
5
=0
= 2 and =
Alternative method
5
1
0
31
0
0
5
25
30
1
5
6
0
(x 5)(x
)=0
5x
(x 5)(x 2)(x
)=0
x=2 5
x )dx
+ =
2=
[Ans. A ]
Given f(x) = x
x
=0
f (x) = x
Newton Raphson formula is
= (i)
Also
= 5
= *x
2x
x
2a
a = 5
2a
a =
Solving (i) and (ii) a =
and a =
f(x) = 1 x + 4 x
x
[Ans. A]
Given
x 10 x + 31x 30 = 0
One root = 5
Let the roots be and of equation
ax + bx + cx + d = 0
= (
f(x )
f (x )
(x
x
)
( x
)
x
x
x
( x
)
=x
x
3.
Mathematics
6.
[Ans. D]
Y = a + bx
Given
n= x =
and xy =
th
th
y = 2 x = 14
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 67
9.
5
[0
0
| 2]
2
0
[0
5
f(x )
f(x )
=x
=x
2x
2x
[x
10.
[Ans. D]
Error in central difference formula is
(h)
This means, error
If error for h = 0.03 is 2
0
then
Error for h = 0.02 is approximately
(0.02)
2
0
0
(0.0 )
11.
[Ans. D]
Exact value of .
| 2]
2
[0
0
2
/2
Now to eliminate y, we need to compare
the elements in second column at and
below the diagonal element Since a = 4
is already larger in absolute value
compares to a = 2
The pivot element for eliminating y is
a = 4 itself.
The pivots for eliminating x and y are
respectively 10 and 4
8.
[Ans. A]
x
[Ans. A]
The equation is
5x + y + 2z = 34
0x + 4y 3z = 12
and 10x 2y + z =
The augmented matrix for gauss
elimination is
5
2
[0
| 2]
0
2
Since in the first column maximum
element in absolute value is 10 we need
to exchange row 1 with row 3
Mathematics
dx = .0
=
=
0.5
]
[2
0. 7
= .
So, the estimate exceeds the exact value by
Approximate value Exact value
= 1.1116 1.0986
=0.012(approximately)
12.
4
266
[Ans. A]
I = h(f
=
0.
= 0.7 5
2f
0.25(
0.
0.
0.5)
(x
f )
2
= [( 0
0)dx
2
2(2 )
)]
= 2 5.
The value of integral
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 68
(x
0) dx = *
=2
x
5
0x+
3.
[Ans. A]
+
, x = 0.5
2 =
=x =
2 = + R
=R
=
So this iteration will compute the square
root of R
= +
=
8 = 4 +9
=
4.
= = 1.5
[Ans. A]
Here, the function being integrated is
f(x) = xe
f (x) = xe + e = e (x + 1)
f (x) = xe + e + e = e (x + 2)
Since,
both
are
increasing
functions of x, maximum value of f ( ) in
interval 1
2, occurs at = 2 so
(
)|
(2
max |f
=e
2) = e
Truncation Error for trapezoidal rule
= TE (bound)
[Ans. D]
y=x
dy
= 2x
dx
f(x)= x
x
= .5
5.
(b a) max |f ( )| 1
(2 1) [e (2 + 2)]
Now putting
= 57 7
)=5
f(x )
2
oot lies between and
x =(
)=2
f(x ) 0
2
After ' ' interations we get the root
x =(
=
max |f ( )|
[Ans. B]
f( ) = 5
f( ) = 5
72
)
)
f(
0 f(
0
is number of subintervals
= . 07
max |f ( )|
Where
(x
2=+
=
= 1000 e
At convergence
x
=x =
=
Given x
2.
)/
[Ans. C]
5
Magnitude of error
= 2 5.
2 . = 0.5
CS
1.
Mathematics
6.
[Ans. D]
h
f(x)dx = [f(0)
2
=
0
[
.
.
0.
f( )
2(0.0
0.
. . 7.2 )
2(f )]
]
5 . ]
= 9.045
h=
Now, No. of intervals,
=
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 69
7.
8.
9.
ECE
1.
2.
[Ans. ]
Given (x) + f(x) + t cos x = 0
and f(x) = x sin x
f (x) = x cos x + sin x
f (x) = x ( sin x) + cos x + cos x
= 2 cos x x sin x
= 2 cos x f (x)
2 cos x f (x) + f(x) +t cos x = 0
2 cos x = tcos x t = 2
[Ans. A]
f(x) = 0.75x
2x
2x
f (x) = 2.25x
x 2
x =2 f = 2 f =
f
x =x
=0
f
f = f = 2
f
x =x
=2
f
f = 2 f =
f
x =x
=0
f
Also, root does not lies between 0 and 1
So, the method diverges if x = 2
nly ( )is true.
x1 2
3.
1 x n
4.
x1 x0
e
e
e xn
1 exn
[Ans. C]
x
f(x )
f (x )
=x
f(2) = (2
) = 2
f (2) =
=2
and
= .
5.
[Ans. D]
f(x) = a x
a x
a x
a x a
If the above equation have complex roots,
then they must be in complex conjugate
pair, because its given all co-efficients are
positive ( they are real )
So if complex roots are even no. (in pair)
then real roots will also be even.
ption ( )is wrong
From the equation
( 0)
roduct of roots =
As no. of roots = 4,
Product of roots < 1
either one root 0
(or)
Product of three roots < 0
ption ( )is rong.
Now, take option (A),
Let us take it is correct .
Roots are in complex conjugate pairs
=
Product of roots
0
| | | |
0 which is not possible
ption (A) is wrong
orrect answer is option ( )
[Ans. C]
By definition (& the application) of
various methods
4=0
Next approximation x1 x0
8 4
12 3
[Ans. C]
Given : f(x)= x e
By Newton Raphson method,
f(x )
x
x
=x
=x
f (x )
[Ans. C]
For value of K if trapezoidal rule is used
then the value is either greater than
actual value of definite integral and if
impsons rule is used then value is exact
Hence both statements are TRUE
[Ans. B]
y(t) =x3 x2 + 4x
x0 = 2
Mathematics
f x0
f ' x0
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 70
6.
[Ans. A]
sin x 2 cos x
x
= (x
)
7.
[Ans. B]
8.
[Ans. D]
2(
x
2
Put x =
as given,
x = [e ( 2)
]/e
= 0.71828
[Ans. C]
=e
.. = e
u(t)
x
2
. . x in
t
[Ans. D]
Here,
x = e u(t) dt = f(t) dt
At t = 0.01, x = Area of trapezoidal
=
x
f(x y) =
=(
)x
h
4.
5.
=[
=*
( )
f(x ) = e
f(x ) = e
6.
0x cos x
0x sinx
20x
0sinx
]
0cosx
0
0
is
0
+
0
[Ans. D]
x
x
x
=0
(x
)(x
)=0
x
=0 x
=0
x=
x= j
=x
(
The matrix at x = 0 x =
( )
[Ans. B]
u(x x ) = 0x sin x
0. = 0
v(x x ) = 0x
0x cosx
0. = 0
The Jacobian matrix is
u
u
x
x
v
v
[ x
x ]
[Ans. A]
Here
f(x) = e
f (x) = e
The Newton Raphson iterative equation is
=x
= *x
2
o maximum permissible value of is 2 .
i.e. x
[Ans. A]
since h = here
= x
=x
= 0.0099
or stability |
f(0.0 )] =
= [f(0)
2.
i=0
x =
as e =
EE
1.
Now put
3.
Mathematics
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 71
7.
[Ans. C]
x =x
=
.2
f(x )
f (x )
( .2)
2( .2)
( .2)
2
4.
[Ans. C]
Approach- 1
Given, x3 6x2 + 11x 6 = 0
Or (x 1)(x 3)(x 2) = 0
x= 1, 2, 3.
= 0.705
8.
f(x )
=
f (x ) e
=
(e
Approach- 2
For ax3 +bx2 + cx +d = 0
If the three roots are p,q,r then
Sum of the roots= p+q+r= b/a
Product of the roots= pqr= d/a
pq+qr+rp=c/a
)
e
5.
[Ans. D]
dx
x
=
dt
f(x, y) =
e
= 0. 7 0.
= 0.0
Absolute error at 2nd itteration is
|0 0.0 | = 0.0
IN
1.
=x
h
=(
[Ans. A]
As k xk+1 xk
xk = x
h (x y ) = x
)x
2.
3.
h(
or stability |
x = x
x =5
x =5
Mathematics
= 1.70
[Ans. A]
Assume x =
f(x) = x
=0
f(x )
x
=x
= [x
f (x ) 2
6.
[Ans. A]
dv
=v t
dt
t
v dv
=v t
dt
0 0 0 0+0 0. = 0
0.1 0 0+0.1 0. = 0.0
7.
[Ans. C]
f(x) = x
x
f (x) = x
= g(x)
x = initial guess
g (x) = x
g (x )
x =x
g (x )
2
]
x
[Ans. C]
Given p(x) = x + x + 2
There is no sign change, hence at most 0
positive root ( rom escartes rule of
signs)
p( x) = x
x+2
There is one sign change, hence at most 1
negative root ( rom escartes rule of
signs)
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 72
=
x =x
= .5
= .
= .5
g(x )
g (x )
0.75
7
8.
[Ans. D]
dy
= 2xy x = 0 y = h = 0.2
dx
y =y
h. f(x y )
(0.2)f(0 ) =
=
and y = y
[f(x y ) f(x y )]
(0. )[f(0 ) f(0.2 )]
=
= 0.
is the value of y after first step, using
Eulers predictor corrector method
9.
[Ans. B]
For convergence
x
Mathematics
= x =x x=
x =
(2x
x=
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 73
Mathematics
Calculus
ME 2005
1.
ME 2006
2.
be
(A)
(B)
8.
(A)
(C)
(B)
(D)
What is q?
(A)
(C) X
(D) 8
)
(A)
(C)
(B)
(D)
10.
(A) 0
(B)
is equal to
11.
(C)
(D) 1
)(
(D) Zero
(B)
|(
(C)
(D)
(C) 2 (
ME 2007
(B) 2
6.
leads to
(A) 4y
(B) 16y
(C) 0
(D)
dt is:
9.
4.
By a change of variables
x(u,v) = uv, y(u,v) = v/u is double
integral, the integral f(x,y) changes to
f(uv, u/v) ( ). Then, ( )
(A) 2 v/u
(C) v
(B) 2 u v
(D) 1
I = (
2x2 7x 3
, then limf(x) will
x 3
5x2 12x 9
Assuming i =
3.
5.
If f( x ) =
7.
th
th
)
(
)|
|
)
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 74
12.
If
y (2) =
(A) 4 or 1
(B) 4 only
13.
, then
14.
20.
21.
Let
(C) 1
(D) 1/ln2
y2 4x and x2 4y is
(A)
(B) 8
23.
(C)
(D) 16
z2 1 xy is
(A) 1
is
(A) 4
(C) 1
(B) 2
(D) 1
at x=2, y=1?
ME 2009
22. The area enclosed between the curves
What is
(A) 0
(B) ln2
(B)
16.
(A)
(C)
(B)
(D)
between x = 0 and x = 1 is
(A) 0.27
(C) 1
(B) 0.67
(D) 1.22
15.
19.
(C) 1 only
(D) Undefined
ME 2008
Mathematics
(C)
(D) 2
(B)
24.
17.
18.
The value of
(A)
(B)
x+2y=2
0
(A)
(B)
(C)
(D) 1
(C)
(D)
25.
is
th
(A)
(C)
(B)
(D) 1
equal to
(A) 7
(C) 3
(B) 4
(D) 0
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 75
ME 2010
26. Velocity vector of a flow field is given as
The function
(A)
o
o
(C)
(D)
(B)
o
o
except at x = 3/2
(C)
o
o
except at x = 2/3
(D)
o
o
28.
29.
ME 2012
33. Consider the function ( )
in the
interval
. At the point x = 0,
f(x) is
(A) Continuous and differentiable.
(B) Non continuous and differentiable.
(C) Continuous and non differentiable.
(D) Neither continuous nor
differentiable.
R
R
R
R
34.
R
R
ME 2011
30. If f(x) is an even function and is a positive
real number, then ( )dx equals
31.
What is
(A)
(B)
32.
36.
is
(C)
(D)
(C)
(B)
(C)
is
(A)
(B)
has
(C)
(D)
37.
equal to?
( )
(C) 0
(D) 1
(C) 1
(D) 2
R except at x = 3
(D)
/ is
35.
(A) 0
(B)
.
(A) 1/4
(B) 1/2
Mathematics
ME 2013
38. The following surface integral is to be
evaluated over a sphere for the given
steady velocity vector field
defined with respect to a
cartesian coordinate system having i, j and
k as unit base vectors.
(
(D)
th
th
)
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 76
45.
is
(A)
(C)
(B)
(D)
46.
) is
(A) 0
(C) 5
(B) 3
(D) 6
(C) 3
(D)Not defined
47.
ME 2014
40.
is
(A) 0
(B) 1
41.
42.
/ is equal to
(A) 0
(B) 0.5
43.
)
)
)
(
(A) 3
(B) 0
48.
(C) 1
(D) 2
(C) (
(B) (
(D) .
(A)
)
/
).
(
(
CE 2005
1.
Value of the integral (
(C) 1
(D) 2
Curl of vector
(A) (
(B) (
(C)
(D)
44.
Mathematics
2.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 77
CE 2006
3.
What is the area common to the circles
o
2
(A) 0.524 a
(C) 1.014 a2
(B) 0.614 a2
(D) 1.228 a2
4.
CE 2007
5.
Potential function is given as
=
. When will be the stream
function () with the condition
= 0 at x = y = 0?
(A) 2xy
(C)
(B)
+
(D) 2
6.
Evaluate
(C)
(D)
(A)
(B)
7.
10.
12.
transformed to
(A)
(B)
9.
(C)
(D) 18
parabola is y = 4h
(A)
(D)
(C)
= 0 by substituting
(C)
where x is the
= 0 can be
(D)
14.
The
is
(A) 2/3
(B) 1
(C) 40.5
(D) 54.0
(B) 2
is
CE 2010
13. A parabolic cable is held between two
supports at the same level. The horizontal
span between the supports is L. The sag at
the mid-span is h. The equation of the
CE 2008
+
A velocity is given as
= 5xy + 2 y2 + 3yz2 . The divergence
The equation
The value of (
(A) 13.5
(B) 27.0
CE 2009
11. For a scalar function
f(x, y, z) = + 3 + 2 the gradient at
the point P (1, 2, 1) is
(A) 2 + 6 + 4
(C) 2 + 12 + 4
(D)
(B) 2 + 12 4
8.
Mathematics
15.
th
(C) 3/2
(D)
Given a function
( )
The optimal value of f(x, y)
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 78
CE 2013
21.
CE 2011
16.
22.
(C) a
(D) 2a
and
R
.
The area of the parallelogram is
Q
(C) 1
(D)
24.
25.
(C) 1
(D)
R
P
( )
wh
(A) ad bc
(B) ac+bd
(A) 0
(B)
(C) ad + bc
(D) ab cd
dx is
(A) 1
(B) 0.5
(A) sec
(B)
(C) 1
(D) 8/3
23.
20.
(A)
(B)
Wh ho
h
o such that
the function defined below is continuous
?
f(x)={
18.
The value of
(A) 0
(B) 1/15
CE 2014
(A) 0
(B) a/2
17.
Mathematics
26.
(C) o
(D)
(C)
(D)
The expression
(A) log x
(B) 0
th
th
(C) x log x
(D)
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 79
CS 2005
1.
Let G(x)
CS 2010
1
g(i)xi where |x|<1.
2
(1 x) i0
What is g(i)?
(A) i
(B) i+1
(C) 2i
(D) 2i
CS 2007
2.
Consider the following two statements
about the function f(x) =|x|:
P: f(x) is continuous for all real values of x
Q: f(x) is differentiable for all real values
of x
Which of the following is true?
(A) P is true Q is false
(B) P is false Q is true
(C) Both P and Q are true
(D) Both P and Q are false
CS 2008
3.
4.
x sinx
equals
Lim
x x cosx
(A) 1
(B) 1
(C)
(D)
Let
P=
7.
(A) 0
(B) 1
(C)
(D) 1
(A) 0
(B) 2
(C) i
(D) i
CS 2012
9.
Consider the function f(x)= sin(x) in the
interval x , -. The number and
location(s) of the local minima of this
function are
(A) One , at
(B) One , at
(C) Two , at and
(D) Two , at and
CS 2013
10. Which one the following function is
continuous at x =3?
(A) ( )
(B) ( )
(C) ( )
(D) ( )
CS 2014
11. Let the function
( )
CS 2009
6.
/ ?
CS 2011
8.
Given i = , what will be the
evaluation of the definite integral
Mathematics
(
(
Where
evaluates to
o
o (
o (
)
)
)
)
(
(
)|
)
(C) ln2
(D)
ln 2
.
th
th
h h
th
( )
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 80
13.
14.
(A)
h h
( )
I only
II only
Both I and II
Neither I nor II
(B)
(C)
(D)
ECE 2006
2.
As x is increased from
function f x
e
1 ex
3
The integral sin d is given by
3.
1
2
2
(B )
3
(A)
(B)
, the
to
is equal to_______.
15.
Mathematics
4
3
8
(D)
3
(A)
(C)
(D)
ECE 2005
1.
The derivative of the symmetric function
drawn in given figure will look like
(C)
P ds , where P is a vector, is
4.
equal to
(A) P dl
(C) P dl
(B) P dl
(D)
Pdv
5.
th
2
(A) P P P
(C) 2P P
2
(B) P P
(D) P 2P
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 81
ECE 2007
6.
For the function
, the linear
approximation around = 2 is
(A) (3 x)
(B) 1 x
ECE 2008
12. Consider points P and Q in the x y plane,
with P=(1,0) and Q=(0,1). The line
Q
(C) 3 2 2 1 2 x e
(D)
7.
8.
9.
10.
14.
15.
16.
17.
(A) 0.5
(B) 1
11.
13.
Consider the function f(x) =
x 2.
The maximum value of f(x) in the closed
interval [ 4,4] is
(A) 18
(C) 2.25
(B) 10
(D) Indeterminate
sin /2
lim
is
0
(C) 2
(D) not defined
Y
3
2
) along
(
the semicircle with the line segment PQ as
its diameter
(A) Is
(B) Is 0
(C) Is 1
h
1
1
Mathematics
(A) 1.0
(B) 2.5
(C) 4.0
(D) 5.0
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 82
21.
ECE 2009
18. The Taylor series expansion of
sinx
at x is given by
x
(A) 1
x 2 .....
3!
(B)
2
x
1
.....
(C)
2
x
1
.....
3!
19.
3!
.....
(C)
(D)
ECE 2010
20. If
(A) 0
(B)
is
(C) 10V
(D) 15V
ECE\IN 2012
23. The direction of vector A is radially
outward from the origin, with
where
and K is
constant. The value of n for which
. A = 0 is
(A) 2
(C) 1
(B) 2
(D) 0
ECE\EE 2012
24. The maximum value of
( )
in the interval
[1,6] is
(A) 21
(C) 41
(B) 25
(D) 46
ECE 2013
25. The maximum value of unit which the
approximation
holds to within
10% error is
(A)
(C)
(B)
(D)
26.
, then has a
maximum at
minimum at
maximum at
minimum at
ECE 2011
22. Consider a closed surface S surrounding a
volume V. If is the position vector of a
point inside S, with the unit normal of S,
3!
(D) 1
If
(A)
(B)
(C)
(D)
Mathematics
is
(A) 0
(B) 1/3
(C) 1
(D) 3
(C) 1
(D) 2
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 83
27.
Mathematics
34.
35.
, magnitude
30.
For
function ( )
(A)
o
(B)
o
The value of
(A)
(B)
(B)
2.
3.
If S =
/ is
31.
32.
in the interval
EE 2006
4.
A surface S(x, y) = 2x + 5y 3 is
integrated once over a path consisting of
the points that satisfy
(x+1)2+ (y 1)2 = . The integral
evaluates to
(A) 17
(C) /17
(D) 0
(B) 17/
5.
33.
(A)
(B)
(C)
(D)
(C)
(D)
(A)
The expression V = R (
th
(A) R (
(B) R (
(C)
(D)
th
R) h
R )
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 84
EE 2007
6.
EE 2010
The integral
equals
(A)
(B) 0
) o
EE 2009
8.
f(x, y) is a continuous function defined
over (x, y) [0, 1] [0, 1]. Given the two
constraints, x > and y > , the
volume under f(x, y) is
(A)
(B)
(C)
9.
10.
11.
a minimum
a discontinuity
a point of inflection
a maximum
13.
(A) 0
(B) 1
, is equal to
(C) e
(D) 1/e
EE 2011
14. The two vectors [1, 1, 1] and [1, a,
where a = .
(A)
(B)
(C)
(D)
has
12.
)
(
At t = 0, the function ( )
(A)
(B)
(C)
(D)
(C) (1/2) o
(D) (1/2)
EE 2008
7.
Consider function f(x)= (
) where
x is a real number. Then the function has
(A) only one minimum
(B) only two minima
(C) three minima
(D) three maxima
(D)
Mathematics
15.
],
/, are
orthonormal
orthogonal
parallel
collinear
EE 2013
16. Given a vector field
, the line integral
F(x, y) = (
)
(
)
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 85
(B)
(C) (
(
(D)
19.
20.
21.
23.
( )
Where f and
v are scalar and vector fields respectively.
If
h
is
(A)
(B)
(C)
(D)
24.
EE 2014
18. Let ( )
. The maximum value of
the function in the interval (
) is
(A)
(C)
(B)
(D)
The line integral of function
, in the
counterclockwise direction, along the
circle
is
(A)
(C)
(B)
(D)
Minimum of the real valued function
(
) occurs at x equal to
( )
(A)
(C) 1
(B)
(D)
IN 2005
1.
A scalar field is given by f = x2/3 + y2/3,
where x and y are the Cartesian
coordinates. The derivative of f along the
line y = x directed away from the origin,
at the point (8, 8) is
( )
substitution u = (
2.
( ) (
( ) (
( ) (
(A)
(B)
(A)
(B) 0
3.
( )
is
(C) f(1)
(D) f(0)
(C)
(D)
is
2
4.
o . /
(D)
(A) R
22.
(C)
. The
Mathematics
(B) R
5.
(C) R
(D) R
If f =
+
+
where ai (i = 0 to n) are constants,
then
is
(A)
(B)
th
th
(C) nf
(D) n
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 86
6.
0
(A)
(C)
(B)
. /
(D)
. /
IN 2006
7.
The function
(
) is
approximated as
where is in
radian. The maximum value of for
which the error due to the approximation
is within
(A) 0.1 rad
(C) 0.3 rad
(B) 0.2 rad
(D) 0.4 rad
()
( )
(A) (
()
))
(B) (
()
))
()
))
()
))
()
(D) (
) ( )
( ))
( ))
13.
The expression
(A)
(B) x
14.
Given y =
(A)
(B)
10.
(C)
(D)
(C) 12
(D) 13
15.
(A) Indeterminate
(B) 0
(C) 1
(D)
IN 2009
16. A sphere of unit radius is centered at the
origin. The unit normal at a point (x, y, z)
on the surface of the sphere is
(A) (x, y, z)
(C) .
/
IN 2007
9.
The value of the integral
dx dy is.
is equal to
(A) 0
(B) 4
(B) .
(C)
(D)
is.
IN 2008
12. Consider the function y = x2 6x + 9. The
maximum value of y obtained when x
varies over the interval 2 to 5 is
(A) 1
(C) 4
(B) 3
(D) 9
(C)
8.
Mathematics
(D) .
IN 2010
17. The electric charge density in the region
R:
is given as
( )
, where x and y are in
meters. The total charge (in coulomb)
contained in the region R is
(A)
(C)
(B)
(D) 0
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 87
18.
The integral
evaluates to
(A) 6
(B) 3
19.
/ sin(t) dt
23.
24.
Given
()
()
o .
(C) 1.5
(D) 0
converges to
(A) cos (x)
(B) sin(x)
(C) sinh(x)
(D)
IN 2011
20.
The series
for
(A)
(B)
Mathematics
The
o w
(A) A circle
(B) A multi-loop closed curve
(C) Hyperbola
(D) An ellipse
converges
(C)
(D)
IN 2013
21. For a vector E, which one the following
statement is NOT TRUE?
(A)
E
E
o o
(B) If
E
E is called conservative
(C) If
E
E is called irrotational
(D)
E
E
-rotational
IN 2014
22. A vector is defined as
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 88
Mathematics
=
=
0 o
[Ans. A]
[Ans. D]
o
9.
[Ans. B]
10.
[Ans. B]
(
For V to be max
Hence, h
3.
[Ans. A]
. /
=
(
=
=
11.
4.
[Ans. A]
(
[Ans. A]
I= (
=2
[Ans. B]
Let the vectors be
)
( )( )( )
= 2
6.
[Ans. A]
A Line integral and a surface integral is
connected by stokes theorem
7.
[Ans. B]
[Ans. B]
[Ans. A]
Given:
I=
For
0 1
]
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 89
13.
14.
[Ans. B]
Since interval given is bounded, so
minimum value of functions is 1.
= 0
) |
L=
[Ans. D]
To see whether the integrals are bounded
or unbounded, we need to see that the
o
h
h
interval of integration. Let us write down
the range of the integrands in the 4
options,
Thus, (D) , i.e.,
[Ans. B]
h
19.
o
(
). (
( )
( )
( )
( )
Coefficient of (x- )
Now f(x)= ex
(x)= ex
(a)= ea
( )
[Ans. D]
div {(
(
[Ans. C]
Taylor series expansion of f(x) about a is
given by
( )
dx is unbounded.
along a vector
(2x
(
(
16.
[Ans. B]
Let x= a3 a=2
=1.22
15.
).dx
= (
L=
L = (
=
18.
= (
[Ans. D]
h
Mathematics
)
(
)}
(
)
=3
21.
[Ans. C]
=
Hence at (1,1,2),
Directional derivative =
17.
[Ans. A]
I = .dx dy
The limit of y is form 0 to
and limit
of x from 0 to 2
I =
( )
(
(
)(
)
)
/
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 90
22.
[Ans. A]
Given:
23.
y2 4x
x2 4y
Mathematics
[Ans. A]
Short method:
Take a point on the curve z = 1, x = 0,
y=0
Length between origin and this point
)
(
)
(
) =1
(
This is minimum length because all
options have length greater than 1.
(4,4)
(0,0)
24.
x4
4x
16
[Ans. B]
Y
or x4 64x
or x(x 64) 0
3
or x3 64
or x 4
x = cos
y=sin
y 4
Required area = .
Path is x2 y2 1
R e
(x y)2 1 2sin cos
2 x3
2 x3 2
3 120
4
64
(4)3 2
3
12
32 16 16
3 3 3
cos2
(1 sin2)d
2 0
0
=
Alternately
For point where both parabolas cut each
other
1 1
1
2 2 2 2
Alternately
Given: x2 y2 1
Put x=cos , and y=sin
y2 4x, x2 4y
x 4 4x
2
= 1 sin2
or x2 8 x
or x4 64x
or x3 64
x 4,0 ,(4,0)
x2
dx
0 4
1
2
4x
0
cos2
1 1
2 0 2 2 2
Required area
4
2 x3 16
2 x3 2
3 120 3
25.
[Ans. C]
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 91
3z 2x 2yz
30.
||
31.
(
27.
( )
[Ans. D]
Standard limit formulae
32.
[Ans. B]
33.
[Ans. C]
The function is continuous in [ 1, 1]
It is also differentiable in [ 1, 1] except at
x = 0.
Since Left derivative = 1 and
Right derivative = 1 at x = 0
34.
[Ans. B]
[Ans. C]
R, and
R, except at
35.
[Ans. D]
( )
( )
( )
( )
f(x) has a point of inflection at x =0.
36.
[Ans. A]
[Ans. D]
,
29.
( )
28.
[Ans. D]
If f(x) even function
||
* +
[Ans. D]
Mathematics
[Ans. D]
Volume from x = 1 to x = 2,
th
th
)
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 92
38.
37.
[Ans. A]
By Gauss Divergence theorem,
( )
Mathematics
( )
( )
( )
[Ans. A]
The area enclosed is shown below as
shaded
( )
( )
(
Now, x = 0
which is point Q(0,0)
and x = 1
which is point
P(1,1)
So required area is
39.
[Ans. C]
( ) ( )
Using Integration by parts
Here,
f=ln(x) and dg=
and g=
* +
o
( ) ( )
* +
[
th
th
( )
]
)
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 93
40.
[Ans. A]
o
[Differentiating both
o
o
Hospital method]
o w
. /
45.
41.
Mathematics
[Ans. D]
o
o
o
( )
( )
( )
[Ans. B]
G
o
46.
[Ans. C]
Div
[Ans. B]
(
)
)
( )
,
o ( )( )
( )
o ( )( )
43.
47.
-
ho
[Ans. B]
Let
(
o (
[Ans. A]
[
[
]
)
48.
)]
()
[
,
(
44.
)
(
(
)
)
)]
(
,
(
[Ans. B]
)]
,
)
[
th
th
]
-
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 94
CE
1.
((
( )
= y and
)-
( )
. /
. /
[Ans. D]
Since the position of rail engine S(t) is
continuous and differentiable function
according to Lagranges mean value
theorem more
)
o )
o
(t) = v(t) =
*
(
( )
)+
m/sec
kmph
4.
[Ans. C]
f = 2 +3
= 126 kmph
Where v(t) is the velocity of the rail
engine.
3.
= 2y
h o
I=
= xy
Here I = (
2.
Mathematics
[Ans. D]
h
o h
r=2acos
(i) r = a represents a circle with centre
(
)
(ii) r = 2acos represents a circle
symmetric about OX with centre at
( )
The circles are shown in figure below. At
h
o o
o
P
y Q
3
(
)
(
)
( )
( )
( )
( )
5.
[Ans. A]
Potential function,
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 95
8.
Integrating
[Ans. D]
Put
wh
Mathematics
( )
[Ans. B]
Let I()
= (
dx ( )
=
) [ from eqn(i)]
o )1
=
dI =
Integrating, I =
( )
() ( )
+C=0
C=
()
( )
I(0) =
But from equation (i), I(0) =
dx
dx =
h
h
[Ans. D]
=5 +2
+ 3y
( )
9.
[Ans. C]
=0
If = 0
= 5y + 4y + 6yz
At(1, 1, 1)
div ( ) = 5.1 + 4.1 + 6.1.1
= 15
o
Since P and Q are non-zero vectors
o
0
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 96
10.
[Ans. A]
Since the limit is a function of x. We first
integrate w.r.t. y and then w.r.t. x
)
[Ans. D]
Length of curve f(x) between x = a and
x = b is given by
13.
Mathematics
+
Here,
4h ( )
= 8h
Since
(
and y = h at x =
* ( )
*
( )+
(Length of cable)
ho
11.
[Ans. B]
f = + 3 +2
f = grad f = i
+j
[Ans. A]
15.
[Ans. A]
( )
+k
14.
[Ans. B]
(
Putting,
o
(
Given,
+
.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 97
+
.
ho
and get
+
.
Since,
We have either a maxima or minima at
o ()
18.
[Ans. A]
19.
o -
[Ans. A]
Area = | |
R (
)
o
, we can use
Since,
Mathematics
minimum equal to
16.
R
R
[Ans. B]
Let I =
Since ( )
I=
( )
20.
[Ans. B]
21.
[Ans. B]
( )
( )
( )
(i) + (ii) 2I =
2I =
2I = |
I = a/2
17.
[Ans. C]
For a function f(x) to be continuous,
at x=a
( )
( )
o
(
If f(x) is continuous at x=
. /
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 98
Mathematics
[Ans. 12]
o )
( )
o ( )
( )
[
22.
Magnitude of acceleration
[Ans. C]
(
)
(
25.
[Ans. B]
We have
)
( )
, ow
( )
=1+0=1
Hence correct option is (C)
23.
( )
( )
[Ans. A]
(4, 3)
a
(2, 2)
b
( )
0.5
(1, 0)
0.5
o wh
o ordinate points are
given is given by
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 99
26.
[Ans. A]
=
4.
=1
[Ans. A]
P=
= log x
1
n 1 r
Cr xr
n
1 x r0
r 0
r 0
r 0
i 0
5.
= 12
g(i) =i+1
24
48
+ 37
48 x = 0
x=
=2
[Ans. A]
f(x)= |x|
Continuity: In other words,
f(x) = x o
x for x< 0
Since,
=
=0 ,
f (x) is continuous for all real values of x
Differentiability:
96x
48
= 36
Now at x = 0
=
48
At 2 also
0 (using
calculator)
There are 3 extrema in this function
( )
6.
( )
[Ans. D]
Since ( )
R h
So |x| is continuous but not differentiable
at x=0
3.
x (12 48x 48 ) = 0
x = 0 or 12 48x 48 = 0
4x 4 = 0
()
[Ans. D]
y = 3 16
r 1 xr i 1 xi
1)
w h
(
r1 Cr xr r1 C1xr
1
21 r
Cr xr
1 x 2 r0
Putting n=2,
2.
=
Q=
[Ans. B]
w h a =1, l=2k 1
P= (
CS
1.
Mathematics
I =
=
= (
)
(
Since tan (A B) =
[Ans. A]
=
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 100
Mathematics
9.
[Ans. B]
f(x) = sin x
( )
o
( )
o
(
(
)
)
(
(
)
)
( )
At
. /
gives maximum
value
=,
)-
At
= ln ( sec ) ln (sec 0)
= ln ( )
= ln (
. /
value
( )
10.
)0=
[Ans. A]
For x =
7.
[Ans. B]
(
8.
) [
*(
) +
) +
.
11.
[Ans. C]
By Mean value theorem
12.
[Ans. A]
Define g(x) = f(x) f(x + 1) in [0, 1]. g(0)
is negative and g(1) is positive. By
intermediate value theorem there is
(
)
h h g(y) = 0
That is f(y) = f(y + 1)
Thus Answer is (A)
13.
[Ans. 2]
*
w
+
*
w +
For min
maximum non common
elements must be there
*
+
must be common to any 2 elements
of V1
(
)minimum value = 2
o
o
+
[
-(
, f(x) =
For x = , f(x) = 3 1 = 2
For x = 3, f(x) = 2
(
) (
) = f(3)
[Ans. D]
gives minimum
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 101
14.
Mathematics
[Ans. 4]
(
)
o
o ()
o
o
)
ECE
1.
[Ans. C]
dy
0 for x< 0
dx
dy
0 for x> 0
dx
o
Substituting the limits
o ()
o ( )
2.
[Ans. A]
Given,
f x
f ' x
1 e .e e
1 e
3.
= x cos
x 2
2x
ex
1 ex
Let cos = t
At
o
o
o
[Ans. A]
[Ans. C]
= o ( ) o
=
LHS = I + II =
15.
ex
1 ex
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 102
8.
Mathematics
[Ans. A]
Given, f x x2 x 2
df x
0
dx
4.
2x 1=0
[Ans. A]
o h o
)
1
2
d2f x
= 2 ve
dx2
So it shows only minima for interval
[ 4, 4], it contains a maximum value that
will be at x= 4 or x=4
f( 4)=18 and f(+4)=10
5.
6.
[Ans. D]
From vector triple product
(
)
(
)
(
)
Here,
(
)
(
)
(
)
(
)
( )
[Ans. D]
y f x ; x 0,
[Ans. A]
( )
f x0
2
x x0 f' x0 x x0 f'' x0
......
e (x 2)(e
2
x0
or 0 lim y
x 2
)
x
2
e ......
2
x 22 ......
e2 3 x
7.
9.
10.
lim
0
ex e x
ex ex
x x2 x3
e 1 ..........
1 2 3
11.
ex 1
[Ans. B]
Two points on line are ( 1, 0) and (0, 1)
Hence line equation is,
y y
y 2 1 x c
x2 x1
y x c
y x 1 ( )
x x2 x3
..........
1 2 3
x2 x4
..........
ex ex
2 4
x x
e e
x3 x5
x ..........
3 5
1
or cot h (x)=
sin /2
1 sin /2
lim
0 2
/2
1 sin /2 1
= lim
2 0 /2 2
[Ans. C]
coth (x)=
[Ans. A]
2
2
5
I ydx x 1dx 2.5
2
1
1
1
x
(Since at x=1,y=2)
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 103
12.
[Ans. B]
Taking f(x, y)= xy, we can show that,
xdx+ydy, is exact. So, the value of the
integral is independent of path
15.
Mathematics
[Ans. A]
(0, 1)
4
I 4x3 10 2x dx 4x3 160x4 dx
0
0
1
4x4 160 5
=
x 33
5 0
4
(1, 0)
[Ans. A]
f(x)= +
(x)=
=0 x=0
(x)= +
>0 x R.
Hence minimum at x=0
f(0)=1+1=2
Alternatively:
For any even function the maxima &
minima can be found by
A.M. >= GM
=> exp(x) + exp( x) 2
Hence minimum value = 2
17.
[Ans. B]
[ |
13.
16.
| ]
[Ans. B]
Let f(x) ex sinx
o
2
x a
f x f a x a f'a
f''a
2!
where, a=
2
x
f x f x f'
f''
2!
Coefficient of (x )2 is
f ''
2
[Ans. A]
o
Thus, (
( )w
o ( )w
o ( )w
)w
h
h
h
[ |
| ]
o
ow
ow
ow
ow
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 104
18.
21.
[Ans. D]
sinx = x
= (x )
y=
or
19.
sin x = (x )
or
=1
)
(
= 1
)
(
....
(
)
...
....
( )
....
Therefore, at
22.
( )
and is the position vector)
23.
has a maximum.
[Ans. D]
Apply the divergence theorem
[Ans. C]
[Ans. A]
. /
* +
)
)
25.
[Ans. B]
( )
)]
(
(
)]
[Ans. C]
( )
, ( )
( )
( )
. /
24.
]
]
. /
along PQ y =1 dy =0]
= [
Since
[Ans. D]
o h o
=
20.
[Ans. A]
....
sin (x )
or
Mathematics
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 105
30.
[Ans. C]
E o
E o
31.
[Ans. *] Range
( )
(
)
( )
=1+1+1
=3
[Ans. D]
o h o
h
integral of a
32.
33.
)
)
)
)
[Ans. C]
Let x (opposite side), y (adjacent side)
and z (hypotenuse side) of a right angled
triangle
29.
(
)
( )
h
28.
to 0.01
( )
[Ans. D]
27.
26.
Mathematics
Given
)(
[Ans. A]
o
( )
( )
( )
Since ( ) is negative, maximum value of
f(x) will be where ( )
o
0(
o
( )
( )
( )
oh
( (
(
th
th
)(
))
)
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 106
34.
Now at x = 2
(2) =
(
)
=
(
)
= 2
<0
At x = 2 we have a maxima.
3.
At (1, 1),
[Ans. D]
5.
[Ans. D]
We consider options (A) and (D) only
because which contains variable r.
By integrating (D), we get
6.
[Ans. D]
By property of definite integral
)
)
=3
)
( )
(
On simplification we get option (D)
[Ans. C]
Grad u =
At (1, 3) Grad u =
,( )
7.
[Ans. B]
f(x) = (
)
(x) = 2(
)
=4x(
) =0
x = 0, x = 2 and x = 2 are the stationary
points.
(x) = 4[x(2x) +(
) ]
= 4[2
= 4 [3
= 12
(0) =
< 0, maxima at x = 0
(2) =(12)
= 32 > 0, minima at x =
( 2) =12(
)
= 32 > 0; minima at x =
There is only one maxima and only two
minima for this function.
=
2.
4.
EE
1.
[Ans. C]
At (1, 1, 1)
| |
35.
Mathematics
[Ans. A]
f(x) =
(x) =
( )
=
(
)
Putting ( (x) = 0
(
)=0
(
)=0
x = 0 or x = 2 are the stationary points.
Now,
(
) (
(x) =
)(
)
=
(
(
))
=
(
)
(
)=2
At x = 0,
(0) =
Since (x) = 2 is > 0 at x = 0 we have a
minima.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 107
8.
Mathematics
= ,
=, (
= (
[Ans. A]
))
) =1
14.
[Ans. B]
Dot product of two vectors
=1+a+ =0
So orthogonal
15.
[Ans. C]
f(x) =
( )
( )
So the equation f(x) having only maxima
at x = 1
16.
[Ans. B]
9.
10.
[Ans. C]
( )
( )
( )
( )
( )
[Ans. D]
=(
)
(
(
) = (0, 2)
(
) = (2, 0)
Equation of starting line
11.
)
y = 2 x and dy = dx
17.
o
( )
.(
||
(
(
=0
||
) /
is undefined
[Ans. A]
Div ( )
=.
Discontinuous
/(
18.
= 1+1+1= 3
13.
[Ans. D]
But at
12.
[Ans. B]
(
y = 2 x , dy = dx
=(
(
)
Putting
[Ans. B]
P=
th
[Ans. A]
( )
o
M
th
) (
) (
(
( )
th
) (
) (
)
(
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 108
)
)
19.
Mathematics
[Ans. B]
/1
)( )(
23.
[Ans. A]
( )
( )
( )
24.
[Ans. B]
( )
( )
)(
(
( )
( )
( )
)
)
20.
[Ans. C]
( )
( )
(
)
For number of values of
)
o
( ) (
( ) (
( )
( )
)
( )
( )
M
21.
[Ans. B]
IN
1.
G
o
[Ans. A]
(
(
22.
[Ans. 2]
(
o .
/.
2.
[Ans. D]
Using L Hospital Rule., numerator
becomes =
th
th
()
= ( )
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 109
3.
[Ans. B]
Mathematics
When
( )
will be
And when
f(x)
( )
.
7.
-1
[Ans. B]
Error,
4.
[Ans. A]
(t) =x (t) +y (t) +
Let R
z (t)
( ) =K (constant)
|R
i.e., (t) + (t) + (t) = constant.
On analyzing the given (A) option, we find
(t)
that R
( )
[Ans. C]
Given :
f=
+
where,
+
(i=0 to n) are constant.
+(n 1)
+
and
=0+
(n 1)
+n
+
= ,
= nf
6.
[Ans. B]
( )
8.
[Ans. B]
()
When
( )
( )
( )
When
( )
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 110
()
14.
()
Mathematics
[Ans. B]
Given y = x2 + 2x + 10
= 2x + 2
( ) -
|
From equation (i)
()
()
()
()
15.
[Ans. C]
By definition
16.
[Ans. A]
()
Unit vector=
=xi+yj+zk
and
17.
[Ans. C]
R:
Y
( )
1
1
,
[Ans. D]
10.
[Ans. A]
This is a standard question of
differentiability & continuity
Area =
[Ans. C]
y=
=(
- o
9.
11.
+1
( )
Total charge =
=
=
18.
).(cos x + sin x) = 0
tan x = 1
Or x =
coulomb.
[Ans. B]
We know that
() (
( )wh
. /
y will be maximum at x =
y=
19.
=
12.
13.
[Ans. C]
y(2) =
y(5) =
[Ans. B]
Expansion of sin x
........
( )
( )
20.
[Ans. B]
In a G.P
[Ans. C]
y=
y=
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 111
21.
[Ans. D]
.E=0 is not irrational (it is solenoidal)
22.
[Ans. 1]
From Gauss divergence theorem, we have
/dxdydz
Mathematics
[Ans. C]
24.
[Ans. D]
o .
23.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 112
DSA
3.
4.
5.
6.
7.
8.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 113
9.
10.
11.
DSA
13.
CS- 2006
14. Consider the polynomial
p(x) = a0 + a1x + a2x2 + a3x3,where
ai
0,
i. The minimum number of
multiplications needed to evaluate p on
an input x is
(A) 3
(C) 6
(B) 4
(D) 9
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 114
15.
16.
17.
(A) n =
(B)
n =
(C)
n =
(D) T (n) =
(log log n)
(log n)
(n)
(n)
19.
20.
}
The set Z computed by the algorithm is
(A) ( X Y )
(B) ( X Y )
(C) ( X Y ) ( Y X )
(D) ( X Y ) ( Y X )
18.
DSA
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 115
22.
DSA
CS- 2007
23. In the following C function , let n m,
int gcd(n, m)
{
if (n % m == 0) return m;
n = n % m;
return gcd(m, n);
}
How many recursive calls are made by
this function?
(A) log n
(C) (log log n)
(B) (n)
(D) (n )
24.
25.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 116
26.
27.
28.
DSA
31.
CS- 2008
29. The following C function takes a singlylinked list of integers as a parameter and
rearranges the elements of the list. The
function is called with the list containing
the integers 1, 2, 3, 4, 5, 6, 7 in the given
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 117
33.
5. k = ( i + j)/2;
6. if (Y[k] < x) i = k; else j = k;
7. } while ((Y[k] != x) && (i < j));
8. if Y k == x printf x is in the rr y ;
9 else printf x is not in the rr y ;
10. }
34.
35.
36.
When n =
for some k
0, the
recurrence relation
T(n) = T(n / 2) + n , T (1) = 1
evaluates to
(A) n (log n +1) (C) n log n
(B) n log n
(D) n log n
37.
DSA
th
A.
B.
n
e
C.
D.
E.
(A)
(B)
n
n log n
1.0000001n
A,D,C,E,B
D,A,C,E,B
th
in
(C) A,C,D,E,B
(D) A,C,D,B,E
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 118
38.
39.
40.
DSA
(B) ? is = get h r
? 2 is getchar (c)
(C) ? is ! =\n
? 2 is putchar (c);
(D) ? is
= get h r
? 2 is putchar (c);
CS- 2009
41. The running time
represented by the
relation:
n
T(n)={
( )
n
! = \n
! = \n
of an algorithm is
following recurrence
n
otherwise
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 119
CS- 2010
43. What does the following program print?
# include <stdio . h>
void f ( int *p, int *q)
{
p = q; *p = 2;
}
int i = 0, j = 1 ;
int main ( )
{
f( &i, &j);
printf %d %d\n, i, j ;
return 0;
}
(A) 2 2
(C) 0 1
(B) 2 1
(D) 0 2
44.
45.
DSA
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 120
CS- 2011
Common Data for Question 47 and 48:
Consider the following recursive C
function that takes two arguments.
unsigned int foo (unsigned int n, unsigned
int r) {
if (n>0)return ((n%r)+foo (n/r, r));
else return 0;
}
47.
48.
49.
50.
51.
fragment of C
54.
;
2011
011
Four matrices
, ,
nd
of
dimensions
p q, q r, r s nd s t
respectively can be multiplied with
several ways with different number of
total scalar multiplications. For example
when multiplied as
(
), the total
number of scalar multiplications is
DSA
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 121
DSA
End A1
Procedure A2;
V r
Procedure A21;
V r
Call A1;
End A21
Call A21;
End A2
Call A1;
End main;
Consider the calling chain:
m in A
A
A
A
The correct set of activation records along
with their access links is given by
(A)
(A)
Main
A1
A2
(C)
A21
(B)
FRAME
POINTER
(D)
A1
ACCESS
LINKS
(B)
56.
Main
A1
A2
(C)
A21
(B)
FRAME
POINTER
(D)
A1
ACCESS
LINKS
(C)
57.
Main
A1
FRAME
POINTER
A2
A21
ACCESS
LINKS
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 122
DSA
Main
A1
A2
61.
62.
A21
FRAME
POINTER
A1
ACCESS
LINKS
n =
CS- 2013
58. Consider the following function;
int unknown (int n){
int i, j, k=0
for (i =n/2; i<=n; i++)
for (j=2; j<=n; j=j*2)
k=k+n/2;
return (k ) ;
}
The return value of the function is
(A)
n )
(C)
n
(B)
n log n
(D)
n log n
59.
(A)
(B)
log n
n
n log n
(C)
(D)
n )
log n
63.
64.
CS- 2014
60. There are 5 bags labeled 1 to 5. All the
coins in a given bag have the same weight.
Some bags have coins of weight 10 gm,
others have coins of weight 11 gm. I pick
1, 2, 4, 8, 16 coins respectively from bags
1 to 5. Their total weight comes out to
( )
+
+
0/1
65.
th
0/1 0/1
0/1 0/1
0/1 0/1
0/1
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 123
3)
67.
DSA
68.
69.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 124
70.
71.
72.
(C) X is de l red s h r X
8
(D) X is de l red s h r X
73.
DSA
75.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 125
76.
DSA
if (listA[k] == x)
return(k);
else
return
;
}
Which one of the following statements
about the function ProcessArray is
CORRECT?
(A) It will run into an infinite loop when
x is not in list A.
(B) It is an implementation of binary
search.
(C) It will always find the maximum
element in list A.
(D) It will return
even when x is
present in list A.
[Ans. C]
n =
n
n
By M sters method, = , =
n
=n
f n = (n
[Ans. B]
It would require n rr y of size n to
store temporary results.
0< = I<n
4.
[Ans. D]
The time complexity of computing the
transitive closure of a binary relation on a
set of n elements is O(n3). Apply the
w rsh lls algorithm to compute the
transitive closure. The algorithm contains
three nested for loops each having
frequency n so time complexity is O(n3)
5.
[Ans. C]
int (*f) (int *);
returns type int, (*f) is a pointer to a
function and the argument is (int *), an
integer pointer. So, int (*f) (int *) means a
pointer to a function that takes an integer
pointer as an argument and returns an
integer.
=n
)
n = (n
logn)
= nlogn
So, it is also O nlogn & O n
but not n
2.
3.
[Ans. C]
double foo (int n)
{
int i ;
double sum ;
if (n ==0)return;
else {sum = 0;
for (i = 0 ; i <n; i++)
sum = sum +foo (i);
return (sum);
}
}
The size of recursion stack space is not
more th n n!
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 126
6.
[Ans. C]
The abstract data type (ADT) refers to a
programmer defined data type together
with a set of operations that can be
performed on that data So, the choice (C)
is correct.
7.
[Ans. C]
A common property of logic programming
languages and functional languages is both
are declarative because we declare any
statement before we will use it.
8.
[Ans. B]
Properties of object oriented
Programming language
- Abstraction
- Inheritance
- Polymorphism
- Encapsulation
9.
[Ans. C]
When we dont de l re fun tion spe ify
the prototype), the default rule is that the
function (foo in our case) would have
been assumed to be int, even though it
really returns a double. This will generate
compiler warning and our program will
have undefined behavior.
[Ans. D]
The function foo is recursive function
When we call foo(a, sum) = foo (2048, 0)
k
j
sum
k = 2048%10
j = 204
sum = 0+8 = 8
= foo(204, 8)
k = 204%10 = 4
j = 20
sum = 8+4 = 12
foo(20, 12)
k = 20%10 = 0
j=2
sum = 12+0 = 12
foo(2,12)
k = 2%10 = 2
j=0
sum = 12+2 = 14
foo(0,14) function will be terminated and
value of k will print in stack way i.e. 2, 0, 4,
8. Value of sum as computed within the
fun tion foo is
From s it is ll y
value parameter passing, the change
DSA
[Ans. A]
There are 500 students and the score
range is 0 to 100. We need to print the
frequency of those students whose score is
above 50. So frequency range contains
scores from 50 to 100, so an array of 50
numbers is suitable for representing the
frequency.
12.
[Ans. D]
The given problem is job scheduling
problem 9 tasks are , ,
, .
J is initially empty then according to
deadlines it includes
{ , , , , , , }.
So
nd
nt e in lude in J
13.
[Ans. A]
Total profit earned by an algorithm
=
8
=
14.
[Ans. A]
Use the Hornor algorithm.
1st iter a3*x ----------------- 1 multiplication
2nd iter (a2 + a3*x)*x ----------------- 1
multiplication
3rd iter (a1 + (a2 + a3*x)*x)*x ------ 1
multiplication
4th iter a0 + (a1 + (a2 + a3*x)*x)*x
15.
[Ans. B]
Scan each element from right to left.
Make First element as largest element.
If any other larger elements found, then
mark it as leader element & make this
element as largest element.
Repeat above steps for rest of the
elements
10.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 127
16.
[Ans. C]
If n is a power of 2, then
j = n+
20.
[Ans. C]
Given i < n, j < m and a [i] < b[j] for
this a[n 1] < b[j]
So if
i<n
then
k = m + i 1 b[m 1}
i
and if i < m
then
k = n + j 1 a[n 1] < b[j]
It means either one of these two are
applicable
It is the code for merging two sorted
arrays
21.
[Ans. B]
S2 and S3 are correct statements.
22.
[Ans. C]
If each
and
is either 0 or 1 and the
numbers are stored in an array then the
algorithm can find the largest span (i, j) on
average in n time because this is only
need of search.
23.
[Ans. A]
Just draw the recursion tree for some
value of n and m. You will observe that the
height of this tree never going to be more
than logn.
24.
[Ans. D]
Get the recurrence relation initially and
solving it will give you the order.
T(n) = T(n) + n O(log log n)
25.
[Ans. B]
T(n) = O n quite clear as loop will run
for n in worst case if number is prime
number. However if number is divisible by
, ,
et ) then loop will run only
for one iteration. That means number of
iterations is varied from 1, n . Thus B is
the answer.
17.
18.
19.
[Ans. D]
The statement inside the
similar to X OR operation
set o t ined is X Y
X
It is equivalent to (X Y
for loop is
such that the
Y
Y X ).
[Ans. B]
n = ([n])
;
=
m = logn
=
en me S m =
S m = S m
S m = m
ording to master's theorem
So, S m = logn s m = logn
DSA
[Ans. B]
Sw p
ix
i
iy
i
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 128
26.
[Ans. D]
To compute f(5), initially r=5.
f
= 8
n
:f n
f
f n
f n
f n
1
27.
30.
[Ans. C]
To find an integer appears more than n/2
times minimum comparisons are of order
just check first,last and middle
element and 1/4 ,3/4 index element
31.
[Ans. D]
So we need to identify the correct order of
relative growth rates of the given
functions
Either we use L hospital rule to compute
the above or we may simplify the
functions so that growth rate can be
proved with obvious reasons.
h(n) can be written in form of
as
follows:
h(n) =
The following is the growth rates in
increasing order, h(n) < f(n) < g(n). Thus
D is the answer.
32.
[Ans. B]
Function f1 contain recursive function so
its running time must be O(2n) but f2 have
not.
Alternately
f1 has complexity of O(2n), while f2 has a
loop from 2 to N , so the complexity of it is
O(n)
33.
[Ans. C]
When solved .
f
=
f
= f
f
= f
f
= f
.
.
.
f 8 =
Now for f ,
x
= y
x
= y
In loop
x
=
y
x
=
y
[Ans. B]
When we apply the divide and conquer
method such that dived n into two parts of
n/2 then recurrence equations is
T(n) = 1 for n = 2
T(n) = 2T(n/2)+2 for n > 2
The solution of T(n) is
n = n
=
28.
29.
omp risons
[Ans. D]
Let the increment of j is , , , , for
some value of i so according to the
question for
while loop:
n or i log n
One extra comparison required for the
termination of while loop. So total number
of comparisons
=i
= log n
DSA
[Ans. B]
If there are even number of nodes in the
linked list , given program interchanges
values of successive numbered nodes
respectively i.e. interchanges values of
nodes. If there are odd number of nodes in
the linked list last node value remain
unchanged, all other nodes values are
interchanged as given in program.
Current values are
1,2,3,4,5,6,7
After interchange
2,1,4,3,6,5,7
th
th
f
f
f
=
=
=
=
th
=
=
=
z
z
=
=
z
z
=
=
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 129
=60
log
35.
36.
[Ans. C]
In C option when we give x =4 (say )the
working is as follows.
I iteration
k = (0+9)/2=4
(y[4]<x) true
i=4 [j =9]
II iteration
k= (4+9)/2=6
(y[6]<x) true
i=6
[j =9]
III iteration
k= (6+9)/2 =7
(y[7]<x) true
i =7
[j=9]
IV iteration
k= (7+9)/2=8
(y[8]<x) true
i =8
[j = 9]
V iteration
K=(8+9)/2=8
(y[8]<x) true
i =8
[j = 9]
remains in loop forever as condition
(4[8]! = x &&i<j) is always true.
[Ans. A]
If increase i to k+1 when y [k] <x and
decrease j to k1 then the program works
properly. Otherwise, above scenario does
not happen and moreover the element at k
position will be checked for equality in
the while condition.
= log =
f n
n
n
=
=
n
.
.
x8 =
34.
DSA
h n =
n =
, Where i =0
n = log n
n =f n
n
= n
log n
37.
[Ans. C]
Here, n< n log9 n< en
So
n log n
e n log n
38.
[Ans. A]
a= (x > y) ? ((x > z) ? x : z) : ((y>z) ? y : z)
In C ? : is tern ry oper tor the synt x
is (exp 1 ? exp2 : exp3). It means if exp 1 is
true print exp2 else exp3.
Let x = 3, y = 4, z = 2.
=
?(
?
): ((4 > 2) ? 4 : 2)
a = (3 > 4) ? 3 : 4
a=4
39.
[Ans. B]
f(c, b, a ) is called by the main () function
the graphical execution of the program is
given below.
in
f
[Ans. A]
T(n)=
n
n
T(1)=1
Comparing it with T(n) = aT (n/b) +f(n)
We get , a= ; = ; f n = n
py
z
th
th
z=
ppz
y
= 9
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 130
int y, z;
ppz = ppz
;
z = ppz = ;
py = py
;
y = py =
x=
=
return x y z = 9
40.
41.
[Ans. D]
Here we re using the = oper tor whi h
h s less priority th n ! = oper tor
So (C = getchar( ) ) has to be in brackets
and reversing the string we use function
putchar(c) for printing the character.
43.
[Ans. D]
i, j variables are global to main function p
and q will also be pointing to same
memory location where i and j
respectively, when f (& i , & j) is called up.
Now p = q statement will move p to the
memory location being pointed by q
Thus, * p = 2 will replace 1 by 2.
There is no change in the value of variable
i (which is still 0);
44.
[Ans. C]
a [ ]=
12
[Ans. A]
Complexity is decided for large values of n
only. So, T(n) = T( )+ cn for n>3.
[Ans. B]
x = 15
fun , &x
fun
13
11
So
,
first this call
Thus the number stored in the array & we
can access these by using
f ,
Using
sters theorem,
Here, a=1, b=3, log = log =
f n = n= n
Sin e log = n is elow f n = n
his elongs to se III of m ster s theorem,
Where the solution is
n = (f n ) = n
42.
DSA
so
f
f
,n
f
,n
let &x =
,n
f
{odd}
{odd}
{even}
,n
f
{even}
,n
{odd}
{even}
,
t = 5,
return 8
f = 5+3, *f_p = 5
t = 3,
return 5
f = 3+2, *f_p = 3
t = 2,
return 3
f = 2+1, *f_p = 2
t = 1,
return 2
f =1+ 1, *f_p = 1
fun ,
fun ,
]+]
]+
]+
=
=
fun ,
fun ,
45.
[Ans. D]
*f_p = 1
return 1
So fun (5, &x) will return 8 and it will be
printed.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 131
[Ans. D]
In given program we take the test cases
and apply
From If all values are equal means
a = b = c = d, a = b condition satisfied. S1
and S4 executed
From When all a, b, c, d distinct:
S , S not execute, S and executes.
From
When a = b, S execute but c = d.
S will not execute but S and S executes.
Here no need of
because we get these
result from above two.
From
If a! = b and c = d, S will not
execute and S and S execute.
All of S , S , S , S will execute and
covered by ,
nd .
47.
[Ans. B]
foo(345, 10)
=5+foo(34,10)
=5+4+foo(3,10)
=5+4+3+foo(0,10)
=12
48.
[Ans. D]
foo(513,2)
=1+foo(256,2)
=1+foo(128,2)
=1+foo(64,2)
=1+foo(32,2)
=1+foo(16,2)
=1+foo(8,2)
=1+foo(4,2)
=1+foo(2,2)
=1+foo(1,2)
DSA
=1+1+foo(0,2)
=2
49.
[Ans. A]
nlogn
n
(sin e
n )
logn)
exponenti l
n logn
f ,f ,f ,f
50.
n (sin e logn
[Ans. C]
p
= E
p
= A
p p
=
p
p p
= p
It prints the su string of GA E
starting at index 4.
51.
[Ans. C]
We
get
minimum
number
of
multiplications ((M1 (M2 M3)) M4).
Total number of multiplications
=
8
= 9
52.
[Ans. C]
Switch statement case A matches initially
and all other cases are executed from
there on as there is no Bre k in ses
Output C
Choi e A
Choice B No Choice
There is no break in between the case
statements.
53.
[Ans. C]
Avg case running time always less than
(or) equal to worst case Time.
A n =O w n
By definition of asymptotic notation.
Average lies always between the best and
the worst case inclusive.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 132
54.
[Ans. D]
MOV
(L-R)
OH
, L, ,
n =
to k.
Return Value
=
no of outer loops
n
n
=
(
) logn
OH
, , L,
[Ans. C]
If any variable is static, then it retains its
v lue ross fun tion lls V ri le in
ptrFun is static and local, so the update of
this variable is available across different
invocations of function ptrFun, but as it is
a local variable its update will not affect
the value of variable a present in main.
Uninitialized global variables have 0 as
their default value.
56.
[Ans. D]
If the variables are auto, these variables
will be reinitialized in every function calls.
Now the variables are all auto storage
class. Their lifetime is local.
57.
[Ans. D]
[Ans. B]
f(5, 5)
{
c = 4;
x = 6;
return f(6, 4) * x;
}
f(6 , 4){
c = 3;
x = 7;
return f(7, 3) * x;
}
f(7, 3)
{
c = 2;
x = 8;
f( 8, 2) * x
}
f(8, 2)
{
c=1;
x=9;
f(9, 1) * x;
}
f (9,1){
c = 0;
return 1;
}when c=1, x=9
So, 9* 9 * 9 * 9 = 6561
60.
[Ans. 12]
No. of coins picked having 10 gm weight
= 18
No. of coins picked having 11 gm weight
= 13
1 + 4 + 8 = 13 (Bag no. 1, 3, 4 are having
11 gm coins)
So
=
A1
A2
A21
ACCESS
LINKS
no of inner loops
59.
Main
A1
is added
= O n logn .
55.
FRAME
POINTER
DSA
[Ans. B]
Outer loop execute for
Iter tions .
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 133
61.
3.
4.
If n = 100 then
=
=
62.
n
( )
[Ans. 150]
From 9 you can go to either 10 or 15
(shortcut)
So
T(9) = 1 + min (T(10), T(15))
So
y = 10, z = 15
or y = 15, z = 10
So yz = 150
67.
[Ans. D]
Statement
s nf % d, & i ;
and
s nf % d, pi ;
are equivalent, because, of the statement
int *pi = & i;
So execution of the program will print 5
more than the integer value entered
68.
[Ans. A]
First loop is calculating sum of all element
of the array in Y.
Second loop is calculating sum of sub
array in Z and if it is greater than Y, then it
is updating Y by new larger sum.
So till the end we will have maximum sum
of element Y of any sub array of array E.
69.
[Ans. C]
Let n=4
When i=1; j=1: number of multiplications:
3
When i=1; j=2; number of multiplications:
2
When i=1; j=3; number of multiplications:
1
When i=1; j=4; number of multiplications:
0
logn
By
sters method, = , =
So, log =1
So,
= n log
So, se of m sters theorem pplies
T(n)= (n)
63.
[Ans. 34]
x=4
A = qpqrr
B = pqpr qrp
B = pqprqrp
B = pqp rqrp
y=3
So x + 10y = 4 + (10 3) = 34
64.
[Ans. 6]
+
+
+
1
2
0
1
1
2
=
=3+3=6
65.
66.
[Ans. A]
n =
DSA
[Ans. D]
1. Recursion cannot be implemented
with only static allocation (TRUE)
2. Garbage collection is not essential for
recursion implementation
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 134
71.
[Ans. 9]
num = num
me ns divide num er y .
while
: count = 1; num = 217
while
: count = 2; num = 108
while
8 : count = 3; num = 56
while
: count = 4; num = 27
while
: count = 5; num = 13
while
: count = 6; num = 6
while
: count = 7; num = 3
while
: count = 8; num = 1
while
: count = 9; num = 0
while
meout of loop
Count = 9
[Ans. A]
Three address code to access arr [n]
t = size of word
t =t
n
t = rr t
In given ode in question
t =i
It is equivalent to
t =
t =i t
So the rr y is de l red s int nd first
index is of 32 size
So Option (A) is correct
73.
74.
[Ans. D]
When j = 50
i = j printf statement executes;
k = f (50)
So j = 50 again and the recursion
continues for ever.
untime stack exhaust & it will run into
infinite loop.
[Ans. B]
p=n
=
=
n n
n
n
n n
n
! !
DSA
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 135
75.
[Ans. A]
Initially A[i][j] is interchanged with A[j][i].
But again when processing A[j][i], it is
again interchange A[i][j]. So the matrix
remains the same once block is executed.
76.
[Ans. B]
3 7 9 10 13 16 18
0 1 2 3
4 5
6
Case 1: (found case)
Let x = 10
i = 0, j = 6
k = 6/2 = 3
10 < = list A[3]
j=
=
list A[3] < =10
i = 3 + 1 =4
i = j exit loop
list A [3] = = 10
return
Bin ry se r h
Case 2: (not found case)
Let x = 11
i = 0, j = 6
1st iteration: k = 6/2 = 3
11 = list A
list A[3] < = 11
i=3+1=4
i = j (true)
2nd iteration: k = (6 + 4)/2 = 5
11< = list A[5]
j=51=4
list A
=
i==j
3rd iteration:
k = (4 + 4)/2 = 2
11 < = list A[4]
j=41=3
i = j (exit loop)
list A [k] ! = x
return
(Binary search)
th
th
DSA
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 136
DSA
CS-2007
3.
The following postfix expression with
single digit operand is evaluated using a
stack
8 2 3 ^ / 2 3 * + 5 1 *
Note that ^ is the exponentiation
operator. The top elements of the stack
after the first * is evaluated are
(A) 6, 1
(C) 3, 2
(B) 5, 7
(D) 1, 5
CS-2006
2.
An implementation of a queue Q, using
two stacks S1 and S2, is given below
void insert(Q, x)
{
push (S1,x);
}
void delete (Q)
{
if (stack-empty(S2)) then
if (stack-empty(S1)) then
{
printf(Q is empty);
return;
}
else while(!stack-empty (S1))
{
x = pop (S1);
push (S2, x);
}
x = pop (S2);
}
Let n insert and m ( n) delete operations
be performed in an arbitrary order on an
empty queue Q. Let x and y be the number
of push and pop operations performed
respectively in the process. Which one of
the following is true for all m and n?
(A) n + m x < 2n and 2m
y n+m
(B) n
m
n and m
y
n
(C) 2m x < 2n and 2m y n + m
(D) 2m x < 2n and 2m y 2n
4.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 137
CS-2012
5.
Suppose a circular queue of capacity
(n 1) elements is implemented with an
array of n elements. Assume that the
insertion and deletion operations are
carried out using REAR and FRONT as
array index variables, respectively.
Initially, REAR = FRONT = 0. The
conditions to detect queue full and queue
empty are
(A) full: (REAR+1) mod n = = FRONT
empty: REAR = = FRONT
(B) full: (REAR+1) mod N = = FRONT
empty:
(FRONT+1) mod n = = REAR
(C) full: REAR = = FRONT
empty:
(REAR+1) mod n = = FRONT
(D) full: (FRONT+1) mod n = = REAR
empty: REAR = = FRONT
CS-2013
6.
Consider the following operation along
with Enqueue and Dequeue operations on
queues, where k is a global parameter.
MultiDequeue (Q){
m = k;
while (Q is not empty) and (m >0) {
Dequeue (Q)
m=m1
}
}
What is the worst case time complexity of
a sequence of n queue operations on an
initially empty queue?
(A) (n)
(C) (n )
(n
)
(B)
(D) (n )
DSA
CS-2014
7.
Suppose a stack implementation supports
an instruction REVERSE, which reverses
the order of elements on the stack, in
addition to the PUSH and POP
instructions. Which one of the following
statements is TRUE with respect to this
modified stack?
(A) A queue cannot be implemented
using this stack.
(B) A queue can be implemented where
ENQUEUE takes a single instruction
and DEQUEUE takes a sequence of
two instructions.
(C) A queue can be implemented where
ENQUEUE takes a sequence of three
instructions and DEQUEUE takes a
single instruction.
(D) A queue can be implemented where
both ENQUEUE and DEQUEUE take a
single instruction each.
8.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 138
DSA
[Ans. C]
To push
2
3
2
1
2
f(s)
ma
ma
ma
ma
ma
(f(s)
(f(s)
(f(s)
(f(s)
(f(s)
0)
0)
0)
0)
0)
=
(
)=
5.
=
(
)=
=
[Ans. A]
So given condition can be specified as
full: (REAR + 1) mod n = FRONT
empty : REAR = FRONT
FRONT
2.
3.
[Ans. A]
The order in which insert and delete
operations are performed matters here.
The best case: insert and delete operations
are performed alternatively. In every
delete operation , 2 pop and 1 push
operations are performed. So, total m+n
push (n push for insert () and m push for
delete ()) operations and 2m pop
operations are performed.
The worst case: First n elements are
inserted and then m elements are deleted.
In first delete operation, n+1 pop
operations and n push operation are
performed. Other than first, in all delete
operations, 1 pop operation is performed.
So, total m+n pop operations and 2n push
operations are performed (n push for
insert () and m push for delete ())
8
8
^
2 ^3
=8
/
8 8
=1
*
2 3
=6
queue
full
6.
[Ans. A]
Since the queue is empty initially, the
condition of while loop never becomes
true. So, for n operations, the time
complexity is (n)
7.
[Ans. C]
Queue can be implemented as below
ENQUEUE: REVERSE; PUSH; REVERSE (3
instructions)
DEQUEUE: pop (single instruction)
8.
[Ans. 7]
( )=
an e e itten as fo o s
)
P(x) = (
Now using only one temporary variable t
and any number of data transfers as well as
memory related operations, the polynomial
can be evaluated as follows
a. t = x * x
[Evaluate and store in memory]
b. t = t
[Evaluate (
) and store in memory]
c. t =
[Retrieve from memory]
d. t = t * x
[Evaluate and store in memory]
FRONT/REAR
queue
empty
[Ans. A]
3
REAR
[Ans. B]
As the elements are deleted from front and
inserted from the rear in the reverse order
in which element are deleted (because of
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 139
e.
f.
g.
DSA
t=t*(
)
[Evaluate (
) and store in
memory]
t=6*x
[Evaluate 6x and store in memory]
t=t+5
[Evaluate 6x + 5 and store in memory]
t = t + (
)
[Retrieve (
) from memory
)
and evaluate { (
]
In the above 8 steps of evaluation, the
total number of arithmetic operation
required are 7
[4 Multiplications, 3 Additions]
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 140
DSA
Trees
CS-2005
1.
How many distinct binary search trees
can be created out of 4 distinct keys?
(A) 5
(C) 24
(B) 14
(D) 42
2.
3.
4.
5.
CS-2006
7.
A scheme for storing binary trees in an
array X is as follows. Indexing of X starts
at 1 instead of 0. The root is stored at
X [1]. For a node stored at X[i], the left
child, if any is stored in X [2i] and the
right child, if any in X [2i + 1]. To be able
to store any binary tree on n vertices, the
minimum size of X should be
(A) log2 n
(C) 2n + 1
(B) n
(D)
8.
9.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 141
CS-2007
10. Consider the following C program
segment where Cell Node represents a
node in a binary tree
struct CellNode {
struct CellNode * leftchild;
int element;
struct CellNode *rightchild;
};
int GetValue (struct CellNode * ptr) {
int value = 0;
if(ptr != NULL) {
if((ptr
leftchild == NULL) &&
(ptr rightchild == NULL))
value =1;
else
value
= value + GetValue(ptr leftchild)
+GetValue(ptr rightchild);
}
return(value);
}
The value returned by GetValue when a
pointer to the root of a binary tree is
passed as its arguments is
(A) The number of nodes in the tree
(B) The number of internal nodes in the
tree
(C) The number of leaf nodes in the tree
(D) The height of the tree
11.
12.
13.
DSA
CS-2008
15. You are given the post-order traversal, P
of a binary search tree on the n elements
, , ., n. You have to determine the
unique binary search tree that has P as its
post-order traversal. What is the time
complexity of the most efficient algorithm
for doing this?
(A) (log n)
(B) (n)
(C) (n log n)
(D) none of the above, as the tree cannot
be uniquely determined
16.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 142
17.
DSA
CS - 2011
21. We are given a set of n distinct elements
and an unlabeled binary tree with n
nodes. In how many ways we can
populate the tree with the given set so
that it becomes a binary search tree?
(A) 0
(C) n!
(B) 1
(D)
.
CS-2012
22. The worst case running time to search for
an element in a balanced binary search
tree with n2n elements is
(A) (n log n)
(C) (n)
(B) (n n)
(D) (log n)
18.
19.
23.
CS-2010
20. In a binary tree with n nodes, every node
has an odd number of descendants. Every
node is considered to be its own
descendant. What is the number of nodes
in the tree that have exactly one child?
(A) 0
(C) (n 1)/2
(B) 1
(D) n 1
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 143
CS-2013
24. The preorder traversal sequence of a
binary search tree is 30, 20, 10, 15, 23, 25,
39, 35, 42. Which one the following is the
postorder traversal sequence of the same
tree?
(A) 10, 20, 15, 23, 25, 35, 42, 39, 30
(B) 15, 10, 25, 23, 20, 42, 35, 39, 30
(C) 15, 20, 10, 23, 25, 42, 35, 39, 30
(D) 15, 10, 23, 25, 20, 35, 42, 39, 30
25.
Struct treeNode
{
treeptr leftMostChild, rightSibling;
};
int DoSomething (treeptr tree)
{
int value=0;
if (tree != NULL) {
if (tree leftMostChild == NULL)
value = 1;
else
value
= DoSomething(tree leftMostChild);
value = value +
DoSomething(tree rightSibling);
}
return(value);
}
When the pointer to the root of a tree is
passed as the argument to DoSomething,
the value returned by the function
corresponds to the
(A) number of internal nodes in the tree.
(B) height of the tree.
(C) number of nodes without a right
sibling in the tree.
(D) number of leaf nodes in the tree.
CS-2014
26. Consider the following rooted tree with
the vertex labeled P as the root:
P
DSA
W
The order in which the nodes are W
visited
during an in order traversal of the tree
is
(A) SQPTRWUV
(C) SQPTWUVR
(B) SQPTUWRV
(D) SQPTRUWV
27.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 144
DSA
2.
[Ans. B]
n
=
n
[Ans. C]
The number of internal nodes of a
complete k- ary tree of height h is
7.
[Ans. B]
The root of the tree is stored at X [1]
Left X[i] stored at X[2i]
Right X[i] stored at X [2i+1]
If tree is complete Binary tree minimum it
require n consecutive memory locations
of
x, x[1],..x[n 1], x[n].
8.
[Ans. C]
=n
)
= n(
Here is the number of leaves at height
h
3.
4.
[Ans. A]
The inorder traversal of a binary search
tree is always in sorted order or in
increasing order of a given sequence. So,
the in order traversal of the tree T is
9,10,15,22,23,25,27,29,40,50,60,95
[Ans. D]
5
8
( ) Possible
4
7
[Ans. B]
Draw the tree as per the definition and
count the nodes.
dif =2
dif =2
dif =0
dif =1
dif =2
dif =0
dif =1
dif =0
( ) not Possible
dif =2
dif =2
dif =2
dif =1
dif =0
( ) Possible
dif =2 dif =0
dif =1
dif =0
6.
( ) possi le
possible( )
Possible
5.
9.
[Ans. B]
If a tree of height 4 will be down.
In which at third level 3 nodes can have
2- children 5- nodes can have one
children to fulfill the given requirement.
No. of leaf nodes will be 11
[Ans. C]
If we insert the number x, first it becomes
the root of resulting B.S.T. There should
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 145
DSA
a
fcg
nodes in right
subtree
dbe
nodes in
left subtree
1 2
10.
11.
12.
3 4
5 6
10 11
[Ans. C]
The given routine will return the number
of leaf nodes in the tree
Since the function is recursive, the left
child invoked function of a node will
return number of leaves in left subtree,
right child invoked function will return
number of leaves in right subtree.
Both will e added and returned
total number of leaves.
[Ans. C]
Maximum nodes in binary tree of height
0= 1= (
)
Maximum nodes in binary tree of height
1= 3= (
)
Maximum nodes in inary tree of height
h=(
)
13.
Postorder will be : d e b f g c a
14.
[Ans. C]
For a complete n ary tree where each
node has n children or no children,
following relation holds L = (n 1) *I +1,
where L is the number of leaf nodes and
I is the number of internal nodes. Let us
find out the value of n for the given data :
L = 41, I = 10 implies
41 = 10* (n
)
n=
15.
[Ans. B]
We have post order traversal and the tree
is Binary Search tree. So, in order
traversal of Binary Search Tree is
sequence order , , ,..,n. By using
inorder, postorder can construct unique
Binary Tree with in O (n) time.
16.
[Ans. D]
Last element of postorder search must
match with the first element of pre-order
search. That means first is postorder,
second is preorder and third one is
inorder.
Formula =
=
e f
[Ans. B]
3 unlabeled nodes
Possible Binary tress total = 5
[Ans. A]
Inorder : d b e a f c g
Preorder : a b d e c f g
As a is the first node in pre-order, it must
be the root of the tree So, according to
inorder,
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 146
17.
[Ans. A]
DSA
I.
18.
0
ncorrect
[Ans. C]
(A) It is incorrect because in order
sequence of BST gives sorted list in
increasing order.
(B) In preorder sequence of BST, root
will be processed first. So 439 should
be the first no in sequence. So it is
not true
(C) Corrrect.
121
II.
97
195
52
242
381
1
472
(D) Incorrect
149 root, then it should come at the
end of sequence.
But option C can be possible, where
97 is left child of root and 52 is left
child of it.
52 will be leaf node
orrect
.
19.
0
[Ans. B]
Consider keys 3, 4, 5
3,4,5
3,4,5
3
4
3,4,5
5
4
5
3,4,5
3,4,5
5
4
4
5
0
orrect
20.
0
0
0
[Ans. A]
Now, if any of the nodes is having exactly
one child then, it will be having even
number of descendant (2) because each
node is also its own descendent, which is
not possible in this tree structure. Hence,
zero is right.
ncorrect
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 147
21.
[Ans. B]
n = {1 , 2 , 3}
30
20
23
42
22.
[Ans. C]
Time = O (log2n 2n)
= O (log n log
)
= O (log
)
= O (n)
23.
[Ans. A]
E.g.
h =
max(0, 0) h = 0 ,
return
max(h , h )
h = 0, h = 0
15
[Ans. C]
Upper bound is O(n), because if the BST is
skewed tree then time is equal to number
of elements
26.
[Ans. A]
Inorder traversal of m ary tree:
f T , T , , Tm are su trees then
inorder traversal is
visit (T1)
visit (root)
visit (T ,,Tm)
Follow inorder for T ,..,Tm.
According to this logic, inorder traversal
of given tree is
SQPTRWUV
27.
[Ans. D]
At every node, if left sibiling = null,
value =1 & it is added to Dosomething
(right sibiling).
If right sibiling = null then value = 0 is
returned & it is added to value.
Value = 1 + 0 = 1
It is counting number of leaf nodes.
0
Return 0
Return 0
another e.g.
right)
height(n right))
return
return 0,
35
25.
Return 0
(height(n
39
10
return (
DSA
[Ans. D]
Postorder travel sequences
15, 10 ,23, 25, 20, 35, 42, 39, 30
Preorder
30, 20, 10, 15, 23, 25, 39, 35, 42
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 148
6.
DSA
CS-2009
3.
What is the maximum height of any
AVL-tree with 7 nodes? Assume that the
height of a tree with a single node is 0.
(A) 2
(C) 4
(B) 3
(D) 5
CS-2010
4.
Consider a -tree in which the maximum
number of keys in a node is 5. What is the
minimum number of keys in any non-root
node?
(A) 1
(C) 3
(B) 2
(D) 4
CS-2014
5.
Consider a rooted n node binary tree
represented using pointers. The best
upper bound on the time required to
determine the number of subtrees having
exactly 4 nodes is (
) Then the
value of a + 10b is _________.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 149
DSA
[Ans. A]
Consider a B tree of order 4.
5.
[Ans. 1]
To find subtrees from a tree of n nodes, it
takes O(n) [Dynamic Programming]
So
(
)
a = 1 and b = 0
So
a + 10 b = 1 + (10
6.
[Ans. 110]
Out of n number of balanced binary
search trees, to search for a number L in
tree, the time required is = O(log n).
From L, to sum up of m elements the time
needed is = m
Total time complexity = O
The given function
=
a = 0, b =1, c = 1, d = 0
2.
[Ans. A]
Cost of searching BST :
Best case O (min height);
Worst case O (max height ) = O(n)
where n is total number of nodes. Worst
case can occur if the BST is skewed, but
AVL tree is always height balanced
3.
[Ans. B]
+
0 1
+
+ 1
1
1
+
1
0
0
4.
0) = 1
1
1
0
OR
x hei ht
3
1
0
[Ans. C]
As per
tree definition each node has to
be full or atleast 50% of its total capacity.
Here, order of B+ tree
= maximum of keys in a node +1 =6 (say b)
So, minimum number of keys in any
internal node is ceiling(b/2)=3
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 150
DSA
Priority Queues
CS 2005
1.
A priority-Queue is implemented as a
Max-Heap. Initially it is 5 elements. The
level- order traversal of the heap is given
below: 10, 8, 5, 3, 2.
Two new elements 1 and 7 are inserted
in the heap in that order. The level-order
traversal of the heap after the insertion of
the element is
(A) 10, 8, 7, 5, 3, 2, 1
(B) 10, 8, 7, 2, 3, 1, 5
(C) 10, 8, 7, 1, 2, 3, 5
(D) 10, 8, 7, 3, 2, 1, 5
2.
4.
5.
6.
7.
(B)
i 1
(D) lo i
8.
9.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 151
CS 2007
10. Consider the process of inserting an
element into a Max Heap, where the Max
Heap is represented by an array. Suppose,
we perform binary search on the path
from the new leaf to the root to find the
position for the newly inserted element,
the number of comparisons performed is
(A) (log2 n)
(C) (n)
(B) (log2 log2 n)
(D) (n log2 n)
(A)
10
(B)
10
10
(D)
CS 2011
14. A max-heap is a heap where the value of
each parent is greater than or equal to
value of its children. Which of the
following is a max-heap?
(C)
5
1
CS 2009
Statement for linked answer Questions
12 & 13
Consider a binary max-heap implemented
using an array
13.
CS 2008
11. We have a binary heap on n elements and
wish to insert n more elements (not
necessarily one after another) into this
heap. The total time required for this is
(A) (log n)
(C) (n log n)
(B) (n)
(D) (n2)
12.
DSA
10
CS - 2014
15. A priority queue is implemented as a
Max-Heap. Initially, it has 5 elements. The
level-order traversal of the heap is: 10, 8,
5, 3, 2. Two new elements 1 and 7 are
inserted into the heap in that order. The
level-order traversal of the heap after the
insertion of the elements is:
(A) 10, 8, 7, 3, 2, 1, 5
(B) 10, 8, 7, 2, 3, 1, 5
(C) 10, 8, 7, 1, 2, 3, 5
(D) 10, 8, 7, 5, 3, 2, 1
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 152
DSA
[Ans. D]
3.
[Ans. D]
The 3 ary max heap
root
10
Heap after
inserting the 5
elements
5
8
root
10
Heap after inserting 1
4.
[Ans. A]
After inserting 7, 2, 10, 4 the resultant
heap become
10, 7,9, 8, 3, 1, 5, 2, 6, 4
8
2
10
root
Heap after inserting 7
and heapify
10
7
8
5.
2.
[Ans. D]
Complete binary tree array
representation
[Ans. A]
The algorithm as follows:
Prepare a heap of lists that means each
node will have a list. And treat the first
element as the key of each respective node.
Perform deleteMin, which will return list
whose first element is smallest among all.
Then delete the current list first element
and insert the same list now based on next
list element.
Perform these steps
repeatedly until heap is empty completely.
Preparing heap step will take O(logn) as
there are logn list. Each deleteMin and
insert will take O(loglogn) as the height of
heap is O(loglogn). There will be n such
operation. Thus, A is correct choice.
1
4
3
9
7
th
1
0
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 153
[Ans. B]
It is the complexity to adjust the tree to
satisfy heap property that will be equal to
the height of the tree.
That is O(logn)
7.
[Ans. C]
0
Index min
= (20 + 21+22+ 23 + ------------+ 21-1)
since index starts with 0
Indexmin = 2
9 10 11 12 13 14
3
0 1
Level 1 = 2
= 21
evel 0 = 20
DSA
8.
[Ans. C]
{23, 17, 14, 7, 13, 10, 1, 5, 6, 12}
Level 2 = 4
= 22
23
17
Level 3 = 8
= 23
14
15 16 17 18
Level 4 = 16
Maximum no. of nodes at level 1 is 21 = 24
10
12
Max heap
9.
[Ans. A]
MAX heap used to identity max element in
O (1) time. So, to identify min element
require O (n), to apply the linear search.
10.
[Ans. A]
Inserting an element into a max heap
takes O(1) times. When we perform a
binary search on the path from the new
leaf to the root to find the position for the
newly inserted element takes (log n) as
expected.
level0 1
level1 2
level2 4
13
level3 8
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 154
11.
[Ans. B]
If we have a binary heap on n elements
and we wish to insert n more elements
then we call a recursive function to build
heap
which
is
responsible
for
constructing the heap
The time spend by build heap is of the
order of the sum of heights of all the
vertices. But at most 2 vertices are
of height i. so the total time spent by build
heap is
12.
n
i
2
13
10
After heafying:
14
12
13
8
10
15.
[Ans. A]
Level order traversal is: 10, 8, 5, 3, 2
So the tree will be
12
[Ans. D]
Delete 25 : Replace it by 12
10
[Ans. B]
The structure of a heap is near-complete
binary tree. All levels except the last level
must be completely full. Option A does
not have this property, whereas options C
and D violate max-heap property that
every node must have higher value than it
children.
16
14
12
10
5
16
14
13
14.
25
13.
12
14
[Ans. C]
In a max-heap, parent node should have
value greater than or equal to both its
children
13
DSA
10
After heafying:
16
5
12
14
13
10
8
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 155
DSA
10
Heapify
5
Final tree
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 156
DSA
Sorting Algorithms
CS 2006
1.
Which one the following inplace sorting
algorithms needs the minimum number
of swaps?
(A) Quick-sort
(C) Selection sort
(B) Insertion sort
(D) Heap sort
2.
CS-2007
3.
Which of the following sorting algorithms
has the lowest worst case complexity?
(A) Merge sort
(C) Quick sort
(B) Bubble sort
(D) Selection sort
CS-2008
4.
Consider the Quicksort algorithm.
Suppose there is a procedure for finding a
pivot element which splits the list into
two sub lists each of which contains at
least one-fifth of the elements. Let T(n) be
the number of comparisons required to
sort n elements. Then
(A) T(n) 2T (n/5) + n
(B) T(n) T(n/5) + T(4n/5) + n
(C) T(n) 2T (4n/5) + n
(D) T(n) 2T (n/2) + n
CS-2009
5.
What is the number of swaps required to
sort n elements using selection sort, in the
worst case?
(A) (n)
(C) ( )
(B) (n log n)
(D) (
g )
6.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 157
CS-2013
9.
Which one of the following is the tightest
upper bound that represents the number
of swaps required to sort n numbers
using selection sort?
(A) ( g )
(C) (
g )
(B) ( )
(D) ( )
10.
DSA
12.
13.
(D) ( g )
CS-2014
11. Let P be a quick sort program to sort
numbers in ascending order using the
first element as the pivot. Let t and t be
the number of comparisons made by P for
the inputs [1 2 3 4 5 ] and [4 1 5 3 2]
respectively. Which one of the following
holds?
(A) t
(C) t
t
(B) t
t
(D) t
t
2.
[Ans. C]
In selection sort, minimum number of
swaps taken compared to other sorting
techniques.
No. of swaps = O(n)
No. of comparisons = O( )
In every pass, it constructs sorted subarrays and places the next element in
proper position in the sorted sub array.
So, we need only 1 swap in every pass
( (i
))
he s uti
f the ( )
(
g )
But to calculate median every time [pass]
it require at least (n2) time. Total time
requireme t ( 2).
[Ans. C]
If the median of n elements can be found
in O(n) time and we select the median as
pivot. Then quicksort of n elements of an
array [ ]
[ ] as f
s We
permute the elements in the array so that
for some index j with value v all the
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 158
3.
4.
[Ans. A]
Sorting
Algorithm
Merge sort
Quick sort
Selection sort
6.
[Ans. B]
Selection sort
Selects the next big element and swaps
with initial elements
Comparisons O ( )
Swaps O(n)
10.
[Ans. C]
If we have an array of x elements then
time complexity to sort x elements using
heap sort is (x g x).
We need to find value of x so that time
complexity to sort x elements gets ( g )
We can direct discard option (A) & (D).
Now check option (C)
g
g
[
g(
)]
g g
g g
[Ans. B]
If we want to sort n elements with the
help of Quicksort algorithm. If pivot
elements which split the list into two sublists each in which one list contains one
fifth element or n/5 and other list
contains 4n/5 and balancing takes n. So
( )
( / ) (4 / )
[Note : n
5.
9.
Worst case complexity
(with n input)
O(nlogn)
Bubble sort
g(
[Ans. A]
In each pass there can be at most 1 swap.
There are n such passes in selection sort
i.e. maximum n swaps will happen in
worst case.
[Ans. B]
The relation T(n) = T(n/4)+T(3n/4)+n
The pivot element is selected in a such
way that it will divide the array into 1/4th
and 3/4th always solving this relation
given (n log n).
7.
[Ans. A]
The algorithm uses dynamic program
paradigm.
8.
[Ans. B]
In merge sort algorithm no. of splits are
proportional to height and in each level
work done is .
ta ime C mp exity ( log n)
DSA
g g
(
( g )
pti (C) is c rrect
]
)
11.
[Ans. C]
First input [1 2 3 4 5 ] is the worst case of
quicksort and it will require more no.of
comparisons than input 2 [4 1 5 3 2]
12.
[Ans. 358]
When we are merging two sorted lists of
lengths m and n, the maximum number of
comparisons will be m+n 1. Also the
worst case merging is done by merging
the two smallest length sequences.
The given lengths of sequences are: L1:20,
L2:24, L3:30, L4:35, L5:50.
Step1: The number comparisons in
merging sequences L1, L2 is
( 0
4
) 4 (Sequence L6)
Step2: The number comparisons in
merging sequences L3, L4 is
(30+35 1)=64 (sequence L7)
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 159
DSA
[Ans. A]
The worst case time complexity of quick
sort is ( ) irrespective of whether pivot
element is first element or middle element
or last element. If the input array is such
that middle element is the minimum or
maximum one, then the worst case can
occur
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 160
DSA
Graph Algorithms
CS 2005
1.
An undirected graph G has n nodes. Its
adjacency matrix is given by an n n
square matrix whose
(i) diagonal elements are 0s and
(ii) non-diagonal elements are 1s.
Which one of the following is TRUE?
(A) Graph G has no minimum spanning
tree (MST).
(B) Graph G has a unique MST of cost
n 1.
(C) Graph G has multiple distinct MSTs,
each of cost n 1.
(D) Graph G has multiple spanning trees
of different costs.
5.
6.
1
1
a
f
5
2.
3.
CS 2006
4.
Consider a weighted complete graph G on
the vertex set {v1, v2, . , vn} such that the
weight of the edge (vi, vj) is 2| i j|. The
weight of a minimum spanning tree of G is
(A) n 1
(C) . /
(B) 2n 2
(D) n2
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 161
8.
CS - 2007
9.
In an unweighted, undirected connected
graph, the shortest path from a node S to
every other node is computed most
efficiently, in terms of time complexity by
(A) Dijkstras algorithm starting from S
(B) Warshalls algorithm
(C) Performing a DFS starting from S
(D) Performing a BFS starting from S
10.
12.
DSA
14.
15.
respectively.
Which of the following is the Huffman
code for the letters a, b, c, d, e, f?
(A) 0, 10, 110, 1110, 11110, 11111
(B) 11, 10, 011, 010, 001, 000
(C) 11, 10, 01, 001, 0001, 0000
(D) 110, 100, 010, 000, 001, 111
What is the average length of the correct
answer to above question?
(A) 3
(C) 2.25
(B) 2.1875
(D) 1.9375
Consider the DAG with
V = {1, 2, 3, 4, 5, 6}, shown below
2
11.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 162
CS 2008
16. The most efficient algorithm for finding
the number of connected components in
an undirected graph on n vertices and m
edges has time complexity:
(A) (n)
(C) (m + n)
(B) (m)
(D) (mn)
17.
(A) MNOPQR
(B) NQMPOR
2
d
3
g
12
21.
e
1
20.
(C) QMNPRO
(D) QMNPOR
(A) (a, h ), (d ,f ), (f ,c ), (g ,i ), ( d ,a ),
(g, h), ( c ,e ), (f ,h )
(B) (c ,e ), (c, f ), (f, d ), (d ,a ), (a ,b ),
(g ,h ), (h ,f ), (g ,i )
(C) (d ,f ), (f ,c ), (d ,a ), ( a ,b ), (c ,e ),
(f ,h ), (g ,h ), (g ,i )
(D) (h ,g), (g ,i ), (h ,f ), (f ,c ), (f ,d ),
(d ,a ), (a ,b ), (c, e)
g
3
18.
b
10
d
2
DSA
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 163
22.
23.
26.
CS 2009
24. Consider the following graph:
5
4
d
5
6
6
5
3
27.
4
f
c
6
c
Which of the following is NOT the
sequence of edges added to the minimum
spanning tree using Kruskals algorithm
(A) (b,e) (e,f) (a,c) (b,c) (f,g) (c,d)
(B) (b,e) (e,f) (a,c) (f,g) (b,c) (c,d)
(C) (b,e) (a,c) (e,f) (b,c) (f,g) (c,d)
(D) (b,e) (e,f) (b,c) (a,c) (f,g) (c,d)
3
25.
DSA
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 164
Let
be a problem that belongs to the
class NP. Then which one of the following
is TRUE?
(A) There is no polynomial time
algorithm for
(B) If
can be solved deterministically
in polynomial time, then P = NP
(C) If
is NP-hard, then it is NP
complete
(D)
may be undecidable
CS - 2011
Linked Answer Question Q.32 and Q.33
An undirected graph G(V, E) contains
n(n>2) nodes named v , v , , v . Two
nodes v , v are connected if and only if
0<| i j | 2. Each edge (v , v ) is
assigned a weight i + j. A sample graph
with n = 4 is shown below.
7
CS 2010
Common Data for Questions 29 and 30:
Consider a complete undirected graph
with vertex set {0, 1, 2, 3, 4}. Entry
in
the matrix W below is the weight of the
edge {i,j}.
0 1 8 14
1 0 12 4 9
W = 8 12 0 7 3
1 4 7 02
[4 9 3 2 0]
29.
31.
32.
33.
30.
DSA
of
.A
3
What will be the cost of the Minimum
Spanning Tree (MST) of such a graph with
n nodes?
(C) 6n 11
(A) (11n
5n)
(D) 2n 1
(B) n
n 1
The length of the path from v to v in the
MST of previous question with n = 10 is
(A) 11
(C) 31
(B) 25
(D) 41
CS 2012
34. Consider the directed graph shown in the
figure below. There are multiple shortest
paths between vertices S and T. Which
one will be reported by Dijkstras shortest
path algorithm? Assume that, in any
iteration, the shortest path to a vertex v is
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 165
2
2
1
4
S
7
D
4
5
5
T
(A) SDT
(B) SBDT
35.
(C) SACDT
(D) SACET
DSA
CS 2014
38. Let G be a graph with n vertices and m
edges. What is the tightest upper bound
on the running time of Depth First Search
on G, when G is represented as an
adjacency matrix?
(A) (n)
(C) ( )
(B) (n m)
(D) ( )
39.
NP
P
NPC
(B)
CS 2013
36. What is the time complexity of Bellman
Ford single source shortest path
algorithm on a complete graph of n
vertices?
(A) ( )
(C) ( )
(B) ( log )
(D) ( log )
NP
NPC
(C)
37.
P = NP
NPC
(D)
P = NP = NPC
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 166
40.
41.
42.
(x x ) (x x ) (x x ) is a
Boolean formula and it is in 2CNFSAT.
The decision problem 2CNFSAT is
(A) NP-Complete.
(B) Solvable in polynomial time by
reduction
to
directed
graph
reachability.
DSA
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 167
DSA
[Ans. C]
Use induction on the number of vertices.
Consider
4 4
matrix
and
the
corresponding graph G.
011 0
100 1
100 1
01 10
1
3
4
2
[Ans. D]
In Dijkstras algorithm for single source
shortest path when we implement the
algorithm using the binary heap data
structure then total updates of E edges
require O(logv) time and total spent time
becomes O(|E|log|V|) but of |E| is much
less than |V|2 then time
O(E+ V) log V
3.
[Ans. D]
If k edges are marked as tree edges then
k + 1 vertices are connected to each
other. That means n k 1 vertices are
not connected with any of k + 1 vertices.
Now we can maximize number of
components only if all n k 1 vertices
are isolated.
Therefore, n k 1 + 1 = n k
This 1 is for the component having k+1
vertices
4.
2|
2|
2 |1|
2|n
2(n
1|
1)
2n
5.
[Ans. C]
Heap or priority queue are very neat data
structures allowing :
Add an element to heap with an
associated priority.
Remove the element from the heap or
priority queue that has the highest
priority, and return it.
Peak at the element with highest
priority without removing it.
A simple way to implement a heap or
priority queue data type is to keep a list of
elements, and search through the list for
the highest priority which taken O(n)
time to implement Dijkstras shortest
path algorithm on unweighted graph.
6.
[Ans. D]
In the Kruskals algorithm we will start
with the edge with minimum weight and
add the edges in non-decreasng order if it
does not form a cycle.
(A) (a b), (d f), (b f), (d c), (d, e)
1 + 1 + 2 + 2 + 3 =9
(B) (a b), (d f), (d c), (b f), (d, e)
1 + 1 + 2 + 2 + 3 =9
[Ans. B]
Given vertex set of G = {v1 , v2 , , vn}
Weight of an edge = 2 |i j| : (vi , vj) G
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 168
[Ans. D]
Let the node u has some n adjacent
nodes, numbered 1 to n. In that case, to
make u as a leaf node of the tree.
We must discover all the adjacent
nodes of (u) first and next come to (u)
In that process let us say we have first
discovered the node (1) [Each of the
nodes 1, 2, 3 .. n must be of at least
2nd degree nodes. Since if any one of them,
say node p is of degree 1 it is already a
leaf node and it cant be. If its is , then our
node u cant be a leaf node then we have
to go through u to get to p]
fter discovering the first adjacent
node , we have to go on discovering nodes
except u till al the adjacent nodes of u are
discovered.
9.
[Ans. D]
In an unweighted graph performing a BFS
starting from S takes O(n) time if graph
contains n vertices. Dijkstras algorithm
only finds the single source shortest path
and takes O(n ) time but it is good for
weighted graph. Warshalls algorithm for
all pair shortest path takes O( ) time but
it is also applicable for weighted graph.
10.
[Ans. D]
Consider the following graph. Only one
edge is needed to be removed for
converting it into spanning tree. We have
n choices for removing the edges.
f
a
c
d
b
11.
[Ans. D]
Termination time of vertex which is
coming earlier is more than that of the
vertex which is coming later
12.
[Ans. D]
w be the minimum weight among all edge
weights in an undirected connected
graph. e is the specific edge of weight w. It
may be possible that another edge in the
graph having weight w which had been
added to minimum spanning tree and
when we add e to minimum spanning tree
it from a simple circuit. So we cant
include e in every minimum spanning
tree.
13.
[Ans. A]
6
5
u
5
3
4
DSA
, , ,
[Ans. D]
As per the time slices, the discovery time
for Q is before the exit of P. And discovery
of R happens only when Q and P finishes,
which clearly indicates that the P and Q
are connected but not R
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 169
1
1
1
1
14.
19.
[Ans. C]
Prims algorithm
Prims algorithm starts at an random
vertex. Then edges added to this tree one
by one. The next edge (i, j) to be added is
such that i is a vertex already included the
tree, j is a vertex not yet included and the
cost of (i, j) is minimum among all edges.
Here, when we start with the minimum
cost edge (a,b) so after (a,b) , (b,c) must
be added to the tree in (A) option (d,f) is
added which is according to Krushkals
algorithm and not Prims.
So, we take next minimum edge, i.e. (d,f).
Now starting with this, we select
minimum cost edge from which is (f,c).
Thus, in this way , we move we move on
selecting next minimum cost edge at each
node such that circuit is formed.
Hence answer is (d,f), (f,c), (d,a), (a,b),
(c,e), (f, h), (g,h), (g,i)
20.
[Ans. A]
A vertex-induced subgraph (sometimes
simply called an "induced subgraph") is a
subset of the vertices of a graph G
together with any edges whose endpoints
are both in this subset.
Now take any graph with 4 or 5 vertices
that follows given properties and you can
observe that the option (A) is not true.
21.
[Ans. B]
When the input is encoded in binary,
subset sum problem is NP complete.
22.
[Ans. B]
X[i, j] (2< = i < = n and a < =j<=w), is
true , if any of the following is true
1
f
[Ans. D]
The average length of the tree is
1
5
1.9375
15.
[Ans. D]
In topological sorting the partial ordering
of the DAG, must be preserved i.e, if a b
in the DAG, then in the topological order,
b must come after a, not before. Consider
the ordering 3 2 4 1 6 5 .
1 4 in the given DAG but 4 comes before
1 in 3 2 4 1 6 5 order which means that 3
2 4 1 6 5 is not a topological order of the
given DAG.
16.
[Ans. C]
The most efficient algorithm for finding
the number of connected components
(articulation point) in an undirected
graph on n vertices and m edges using
depth first search take O(m + n) time.
ssume n m.
17.
[Ans. C]
The BFS using Queue data structure is
QMNPRO
18.
DSA
[Ans. C]
In given graph, the graph is directed and
from vertex a to all the vertices there exist
a weighted path. So Dijkstras single
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 170
23.
24.
25.
26.
27.
28.
29.
0
8
1
1
[Ans. D]
After adding (b,e) one can add either (e,f)
or (a,c)
Kruskals algorithm works based on
greedy strategy (picks minimum weight
edge).
Weight of edge (a,c) is less than (b,c). So it
cannot come after (b,c)
12
9
4
7
[Ans. B]
Bellman-Ford shortest path algorithm
always finds whether any negative
weighted cycle which is reachable from
the source.
1
3
[Ans. B]
From vertex 1 to vertex 2 we choose the
path
1
[Ans. B]
(i, j) values can be computed in a row
major order or column major order of
L[M, N].
[Ans. C]
It is given that
NP
If
is NP-hard, and since it is given
that
NP this means that
is
NP-complete
Choice C is correct.
[Ans. D]
0 1 2 3 4
8 1 4
0 0 1
1 1 0 12 4 9
W
2 8 12 0 7 3
7 0 2
3 1 4
4 [4 9
3 2 0]
We draw a graph
[Ans. C]
The entry X[n, W] is true, because we find
the weight W of subset of S which
contains n elements.
[Ans. C]
l(i, j)
0 if either i 0 or j 0
l(i 1, j 1);
if i, j>0 and x,i 1,j 1max(l(i 1, j), l(i, j 1));
if i, j>0 and x,i 1,j 1expr2 max(l(i 1, j), l(i, j 1))
DSA
So weight = 1+4+3 = 8
31.
th
[Ans. B]
If X and Y be two different maximum
possible weights then we can say like
either X and Y both will be equal or the
difference between them will be because
of a . Because all other numbers are
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 171
[Ans. B]
Minimum spanning tree for 2 nodes
would be
(v1) (v2)
Total weight 3
Minimum spanning tree for 3 nodes
would be
(v1) (v2)
|
(v3)
Total weight= 3 + 4 = 7
Minimum spanning tree for 4 nodes
would be
(v1) (v2) (v4)
|
(v3)
Total weight= 3 + 4 + 6 = 13
Minimum spanning tree for 5 nodes
would be
(v1) (v2) (v4)
|
(v3)
|
(v5)
Total weight= 3 + 4 + 6 + 8 = 21
Minimum spanning tree for 6 nodes
would be
(v1) (v2) (v4) (v6)
|
(v3)
|
(v5)
Total weight= 3 + 4 + 6 + 8 + 10 = 31
We can observe from above examples that
when we add kth node, the weight of
spanning tree increases by 2k 2. Let T(n)
be the weight of minimum spanning tree.
T(n) can be written as
T(n) = T(n 1) + (2n 2) for n > 2
T(1) = 0, T(2) = 0 and T(2) = 3
DSA
6 here cost
13
16
13
33.
[Ans. C]
Any MST which has more than 5 nodes
will have the same distance between v5
and v6 as the basic structure of all MSTs
(with more than 5 nodes) would be
following.
(v1) (v2) (v4) (v6) . (more even
numbered nodes)
|
(v3)
|
(v5)
|
.
.
(more odd numbered nodes)
Distance between v5 and v6
= 3 + 4 + 6 + 8 + 10 = 31
34.
[Ans. D]
A B
S 4
B
A
C
E
D
7
7
7
7
7
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 172
35.
[Ans. D]
E.g.
2
37.
[Ans. A]
1. We can use Depth irst Search
Algorithm to check it there is a cycle
in an undirected graph. If we
encounter any back edge in Depth
first search then given undirected
graph has a cycle. DFS can be done in
O(| | | |) time for graph G ( , ).
So, it is in P.
2. P NP,So, it is also in NP
3. NP-Complete problem
NP by
definition every problem in NP can be
solved in polynomial time using nondeterministic alogrithms.
So, Answer is (A) i.e., 1, 2 and 3 are true.
38.
[Ans. C]
DFS visits each vertex once and as it visits
each vertex, we need to find all of its
neighbors to figure out where to search
next. Finding all its neighbors in an
adjacency matrix requires O(V) times, so
overall the running time will be O( )
39.
[Ans. D]
Then all NP & NPC problems can be
reduced to P problems. Because to
compute the largest clique is NPC
problem.
40.
[Ans. B]
BFS is used in shortest path problems. So
it finds the shortest path from source
vertex to each and every vertex of a graph
41.
[Ans. 19]
c
3
MST
2
a
2
4 T
E.g.
2
2
4
2 4
MST
2
2
T
2
DSA
[Ans. C]
In a complete graph total no of edges is
n(n 1)
2
Time complexity of Bellman-ford
algorithm for a graph having n vertices
and m edges = O (nm)
18
21
15
8
12
20
17
19
th
16
th
14
13
11
th
10
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 173
DSA
[Ans. B]
2CNFSAT problem is solvable in
polynomial time by reduction to Directed
Graph Reachability.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 174
DSA
Hashing
CS 2007
1.
Consider a hash table of size seven, with
starting index zero, and a hash function
(3x+4) mod 7. Assuming the hash table is
initially empty, which of the following is
the contents of the table when the
sequence 1, 3, 8, 10 is inserted into the
table using closed hashing? Note that
denotes an empty location in the table
(A)
(B)
(C)
(D)
CS 2009
2.
The keys 12, 18, 13, 2, 3, 23, 5 and 15 are
inserted into an initially empty hash table
of length 10 using open addressing with
hash function h(k) = k mod 10 and linear
probing. What is the resultant hash table?
(A) 0
(B) 0
1
1
2 2
2 12
3 23
3 13
4
4
5 15
5 5
6
6
7
7
8 18
8 18
9
9
(C)
0
1
2
3
4
5
6
7
8
9
(D)
12
13
2
3
23
5
18
15
0
1
2
3
4
5
6
7
8
9
CS 2010
Statement for Linked Answer Questions
3 and 4:
A hash table of length 10 uses open
addressing with hash function
h(k) = k mod 10, and linear probing.
After inserting 6 values into an empty
hash table, the table is as shown below.
0
1
2 42
3 23
4 34
5 52
6 46
7 33
8
9
3.
4.
12,2
13,3,23
5,15
18
CS 2014
5.
Consider a hash table with 9 slots. The
hash function is (k) = k mod 9. The
collisions are resolved by chaining. The
following 9 keys are inserted in the order:
5, 28, 19, 15, 20, 33, 12, 17, 10. The
maximum, minimum and average chain
lengths in the hash table, respectively, are
(A) 3, 0, and 1
(C) 4,0 and 1
(B) 3, 3, and 3
(D) 3,0 and 2
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 175
6.
DSA
2.
[Ans.B]
Size of hash table = 7
h(x) = (3x+4) mod 7
h(1) = (3.1+4) mod 7 = 7 mod 7
= 0; insert at 0th location.
h(3) = (3.3+4) mod 7 =13 mod 7
= 6; insert at 6th location.
h(8) = (3.8+4) mod 7 =28 mod 7
= 0; 0th position is already filled by
element 3 so insert 8 at next free
location which is 1st position
h(10) = (3.10+4) mod 7 =34 mod 7 = 6
but 6th position is already filled with
element 3. So insert 10 at next free
location which is 2nd position
1 8 10
3
0 1 2
3 4
5 6
[Ans. C]
12 mod 10 = 2
18 mod 10 = 8
13 mod 10 = 3
2 mod 10 = 2 collision
(2+1)mod 10 = 3 again collision
(using linear probing)
(3+1)mod 10 = 4
3 mod 10 = 3 collision
(3+1) mod 10 = 4 collision
(using linear probing)
(4+1) mod 10 = 5
23 mod 10 = 3 collision
(3+1) mod 10 = 4 collision
(4+1) mod 10 = 5 again collision
(5+1) mod 10 = 6
5 mod 10 = 5 collision
(5+1) mod 10 = 6 again collision
(6+1) mod 10 = 7
15 mod 10 = 5 collision
(5+1) mod 10 = 6 collision
(6+1) mod 10 = 7 collision
[Ans. C]
h (46) = 6, location 6 is free hence get
placed
h (34) = 4, location 4 is free hence get
placed
h (42) = 2, location 2 is free hence get
placed
h (23) = 3, location 3 is free hence get
placed
h (52) = 2, location 2 is not free as 42 is
already there. Linear probing will return
index 5. Hence, 52 will be placed at 52.
h (33) = 3, linear probe will return
index 7
4.
[Ans. C]
Please notice 52 cannot be appear in any
of first three position of any input
sequence otherwise we will not get the
needed hash table. Also, 33 can only
appear
in
the
last
position.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 176
DSA
[Ans. A]
Slot Keys
Collisions
at slots
8
0
17
1
28
2
19
1
3
20
2
4
10
1, 2, 3
5
5
6
15
7
33
6
8
12
5, 6, 7
Total no of collision = 10
Average =
6.
[Ans. A]
Collision resolution method: Chaining
As the 1st 3 slots must be empty
Probability to fill 1st element =
(
)
Probability to fill 2nd element
=
( Collision resolution is chaining.
Same slot call be filled again )
Probability to fill 3rd element =
( ollision resolution is chaining. Same
slot call be filled again
Total probability
(
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 177
Operating System
[Ans. A]
ls passwd will give the same information.
2.
[Ans. A]
SIGKILL is signal which is generated by
Ctrl-C and this signal will execute in
kernel mode.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 178
Operating System
Process Management
CS 2005
1.
Consider the following code fragment:
if (fork( ) == 0)
* a = a + 5; printf (%d, %d\n, a, &a); +
else { a= a 5;
printf (%d, %d\n, a, &a); +
Let u and v be the values printed by the
parent process and x and y be the values
printed by the child process. Which one of
the following is TRUE?
(A) u = x + 10 and v = y
(B) u = x +10 and v y
(C) u + 10 = x and v = y
(D) u + 10 = x and v y
2.
3.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 179
Exit
Terminated
7.
Operating System
CS - 2007
8.
Two processes P1 and P2 need to access a
critical section of code. Consider the
following synchronization construct used
by the processes:
/* P1 */
while (true) {
wants1 = true;
while (wants2 == true);
/* Critical Section */
wants1 = false;
}
/* Remainder section */
/* P2 */
while (true) {
wants2 = true;
while (wants1 == true);
/* Critical Section */
wants2 = false;
}
/* Remainder section */
Here, wants1 and wants2 are shared
variables,which are initialized to false.
Which one of the following statements is
TRUE about the above construct?
(A) It does not ensure mutual exclusion
(B) It does not ensure bounded waiting
(C) It requires that processes enter the
critical section in strict alternation
(D) It does not prevent deadlocks but
ensures mutual exclusion
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 180
9.
10.
11.
Operating System
CS - 2008
12. A process executes the following code for
(i = 0; i < n; i ++) fork ( );
The total number of child processes
created is
(A) n
(C) 2
(B) 2
1
(D) 2
1
13.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 181
if (s < 0) {
Vb (Xb);
Pb(Yb);
}
else Vb(Xb);
V(s): Pb(Xb);
s = s + 1;
if (s <= 0)
Vb (Yb);
Vb (Xb);
The initial values of Xb and Yb are
respectively
(A) 0 and 0
(C) 1 and 0
(B) 0 and 1
(D) 1 and 1
CS 2009
14. In the following process state transition
diagram for a uniprocessor system,
assume that there are always some
processes in the ready state:
B
Start
Running
Ready
E
Terminated
Blocked
Process P0
while (true) {
wait (S0);
print 0
release (S1);
release (S2);
}
Process P1
wait (S1);
release (S0);
Process P2
wait (S2)
release (S0);
CS 2010
15. Consider the methods used by processes
P1 and P2 for accessing their critical
sections whenever needed, as given
below. The initial values of shared
boolean variables S1 and S2 are randomly
assigned.
Method used by P1 Method used by P2
while (S1 = = S2);
critical Section
S1= S2;
Operating System
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 182
Operating System
(C)
ExitX(R, S) {
P(S);
V(R);
}
EntryY(R, S){
V(S);
P(R);
}
(D)
ExitX(R, S) {
V(R);
P(S);
}
EntryY(R, S){
V(S);
P(R);
}
20.
(B)
ExitX(R, S) {
V(R);
V(S);
}
EntryY(R, S) {
P(R);
P(S);
}
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 183
Operating System
CS - 2014
21. Consider the procedure below for the
Producer-Consumer problem which uses
semaphores:
semaphore n = 0;
semaphore s = 1;
void producer()
void consumer()
{
{
while (true)
while(true)
{
{
Produce();
semWait(s);
SemWaits(s);
semWait(n);
addToBuffer();
removeFromBuffer();
semSignal(s);
semsignal(s);
semSignal(n);
consume();
}
}
}
}
[Ans. C]
fork ( ) will returns 0 for child . So, parent
is printing 5 less than a & child is
printing 5 more. So, regarding the values
u +10 =x
Regarding the addresses v = y, though the
physical addresses of child Process &
Parent Process are different, yet &a
refers to the logical addresses of the
process which will be same for both Child
& Parent Processes. Physical Address will
be generated at runtime and it will be
known to Memory Management Unit Only
and CPU is totally unaware of Physical
address.
2.
[Ans. C]
As semaphore X = 0, the process calling
P(X) must wait until another process calls
V(X).
P1
calling V(X) first, So P1 need not
starve and it is independent and can run
multiple times.
P2
calling P(X) first, So P2 must wait
until P1 comes. So P2 will starve.
3.
[Ans. B]
Consider the possible solution
X Y=0
P1
P2
wait(X)
use R1
use R1
signal (X)
use R2
wait (Y)
Signal(Y)
useR2
wait(X)
use R3
use R3
signal(X)
use R4
wait(Y)
Signal (Y)
use R4
Total no. of binary semaphore = 2
4.
[Ans. A]
void P (binary- semaphore * S){
unsigned y;
unsigned * x = & (S value);
do {
fetch and set x, y;
} while(y);
}
void V(binary- semaphore * S)
* S value = 0;+
}
fetch and set instruction always sets
the memory location x = 1 and fetches the
old
value
of
x
and
y.
The
binarysemaphore * S takes only two value
either 0 and 1. When we initialize S = 0
then in statement 3 this value will be
started at location x and fetch and-set
instruction change the value of x= 0 to
x = 1 and y becomes 0. If there are more
than two processes and context switching
between processes is disabled in P then
this implementation doesnt work
properly and cant synchronize the
processes
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 184
5.
[Ans. C]
As Switching from Running to Ready is
not allowed It is not a non-Preemptive
Scheduling.
6.
[Ans. B]
The barrier implementation may lead to a
deadlock if two barrier invocations are
used in immediate succession which is
due to line 3 and 7.
7.
[Ans. B]
At the beginning of the barrier the first
process to enter in the line 8 the barrier
waits until process_arrived becomes zero
before proceeding to execute P(S)
8.
[Ans. D]
It ensures Mutual Exclusion, but it doesnt
prevent deadlock.
Wants1 Wants2 RESULT
True
True
Deadlock
True
False
P1
False
True
P2
False
False
No Process will enter
into Critical Section
9.
[Ans. C]
After execution of
if (critical_flag== False). If P1 preempts
and P2 starts . Then for P2 also line
if (critical_ flag == False)
Condition will be true. And P1, P2 both
will access critical_ region concurrently.
But here there is no any deadlock chance
10.
[Ans. C]
S1 = Wait (wrt)
To block writers
accessing the buffer.
S2 = Signal (mutex)
To allow other
readers to access the readcount shared
variable.
S3
wait (mutex)
To block other
readers in accessing the readcoun shared
variable
S4 = Signal (wrt)
To allow writer to
proceed as all readers are done with
reading.
11.
Operating System
12.
[Ans. B]
Fork ( ) system call creates the child
process initially number of processes is 0.
After first fork ( ), it creates a single
process. After second fork ( ), it creates
one parent and two child processes. After
n fork ( ), the total number of processes is
2 but we subtract the main process then
the total number of child processes is
2
1.
13.
[Ans. C]
In given code, P(s) decrements the value
of semaphore and V(s) increment the
value of semaphore. P &V are wait and
signal operations on binary semaphore.
X &Y are binary semaphores. To avoid
the mutual exclusion condition if the
value of X is 1 and the value of Y = 0
then P(s) and V(s) work properly.
14.
[Ans. C]
Transition C indicates that OS uses
preemptive scheduling. II is also true.
15.
[Ans. A]
It ensures Mutual Exclusion.
S1 S2 RESULT
1
1
P2
1
0
P1
0
1
P1
0
0
P2
It doesnt ensure progress, consider the
following cases:If P1 is the only process if (S1=S2), then
it must wait indefinitely for P2
If P1 is the only process if (S1! = S2),
then it will execute only once and makes
(S1 = S2), if P1 wants to execute for the
second time, then it must wait indefinitely
for P2
We can conclude the Progress condition is
not achieved .
16.
[Ans. A]
When S =1, S = 0
So firstly the value of S and S = 0, P and
P not execute. The value of S = 1, So it
can execute, process P . Now value of
S = 0 and it prints zero one time when it
calls release (S1) call then the value of S1
increases by 1. So P executes. It makes
[Ans. C]
So, its output is :
a1 b1 c1
a2 b2 c2
a3 b2 c3
a4 b1 c3
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 185
2. Start with Y
P(s)
s=0
ead x = 0 ,old valuex=x 2 x= 2
Store it to memory
V(s) s = 1
3. Again start with X,
So it will write
x = 1 in memory.
V(s) s = 2
4. Same procedure for W and Z.
Start with W.
Preempt after read and then execute Z
and again execute W.
So final value in x will be 2.
[Ans. C]
fork (); 1
fork (); 2 = 7
fork (); 4
Total no of child processes after n fork ( )
calls = (2
1)
18.
[Ans. B]
Assume P1 executes until while condition
and preempts before executing L = 1.
Now P2 executes all statements, hence
L = 0. Then P1 without checking L it
makes L = 1 by executing the statement
where it was preempted.
It takes a non-zero value (L = 1) when
the lock is actually available (L = 0).
19.
[Ans. C]
Here take any sequence of operations of
process X and process Y, first process X
will wait for S which is incremented by
process Y and then process Y waits for R
which is incremented by process X.
There is no sequence of operations in
which the value of R or S overlaps.
Hence both process executes one after
another.
So option (C) is correct.
[X & Y] should run in strict alteration
manner
20.
[Ans. D]
X
W
Y
Z
1
P(s)
P(s)
P(s)
P(s)
2
R(x)
R(x)
R(x)
R(x)
3
x=x+1 x=x+1 x=x 2 x=x 2
4
Store
Store
Store
Store
to MM to MM to MM to MM
5
V(s)
V(s)
V(s)
V(s)
1. Start with X.
P(s)
S=1
ead x = 0
x=x+1 x=1
Before storing it to memory, preempt
this process
Operating System
21.
th
[Ans. C]
semaphore n = 0;
semaphore s = 1;
The given solution will lead to deadlock in
the following case: if consumer starts
first.
Consumer calls
semWait(s) s = s 1 = 0 Consumer
is allowed
Consumer calls
semWait(n) n = n 1 =0 1 = 1
Consumer is Blocked on semWait (n)
Now producer started and called
semWait(s) s = s 1 = 0 1= 1
Blocked on semWait(s)
Now Both producer & Consumer are
blocked Deadlock.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 186
Operating System
Threads
CS 2007
1.
Consider the following statements about
user level threads and kernel level
threads. Which one of the following
statements is FALSE?
(A) Context switch time is longer for
kernel level threads than for user
level threads
(B) User level threads do not need any
hardware support
(C) Related kernel level threads can be
scheduled on different processors in
a multiprocessor system
(D) Blocking one kernel level thread
blocks all related threads
CS - 2011
2.
Let the time taken to switch between user
and kernel modes of execution be t1 while
the time taken to switch between two
processes be t2. Which of the following is
TRUE?
(A) t1 > t2
(B) t1 = t2
(C) t1 < t2
(D) nothing can be said about the relation
between t1 and t2
3.
CS 2014
4.
Which one of the following is FALSE?
(A) User level threads are not scheduled
by the kernel.
(B) When a user level thread is blocked,
all other threads of its process are
blocked.
(C) Context switching between user level
threads is faster than context
switching between kernel level
threads.
(D) Kernel level threads cannot share the
code segment
2.
[Ans. D]
In kernel level threads, if the blocking
system call comes, the kernel can
schedule another thread in the
application for execution. So, statement
(D) is false about kernel level threads. It
is true for user level threads
3.
[Ans. A]
Threads are called light weight processes
because they only need storage for stack
and registers. They dont need separate
space for other things.
4.
[Ans. D]
All types of threads share code segment.
So operation (D) is false
All other statements are true.
[Ans. C]
Process
switching
includes
mode
switching. Context switching can occur
only in kernel mode. So t2 will include t1
in itself
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 187
Operating System
CPU Scheduling
CS 2005
1.
We wish to schedule three processes
P1, P2 and P3 on a uni-processor system.
The priorities, CPU time requirements
and arrival times of the processes are as
shown below.
Process
Priority
P1
10
(highest)
9
P2
P3
8
(lowest)
CPU
time
required
20 sec
Arrival
time
(hh:mm:ss)
00:00:05
10sec
00:00:03
15 sec
00:00:00
5.
CS 2006
2.
Consider three CPU intensive processes,
which require 10, 20 and 30 time units
and arrive at times 0, 2 and 6
respectively. How many context switches
are needed if the operating system
implements a shortest remaining time
first scheduling algorithm? Do not count
the context switches at time zero and at
the end
(A) 1
(C) 3
(B) 2
(D) 4
3.
Process
P1
P2
P3
Arrival
time
Priority
0
2
3
2
3(lowest)
1(highest)
Burst
durations
(CPU,
I/O,CPU)
1, 5, 3
3, 3, 1
2, 3, 1
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 188
CS 2007
6.
Group-1 contains some CPU scheduling
algorithms and Group-2 contains some
applications. Match entries in Group-1
entries in Group-2
Group-1
Group-2
P. Gang
1. Guaranteed
scheduling
Scheduling
Q. Rate
2. Real time
Monotonic
Scheduling
Scheduling
R. Fair Share 3. Thread
Scheduling
Scheduling
(A) P 3; Q 2; R 1
(B) P 1; Q 2; R 3
(C) P 2; Q 3; R 1
(D) P 1; Q 3; R 2
7.
Execution time
20
25
10
15
Arrival time
0
15
30
45
(A)
(B)
(C)
(D)
Operating System
I only
I and III only
II and III only
I, II and III
CS - 2011
10. Consider the following table of arrival
time and burst time for three processes
P0, P1 and P2.
Process
Arrival time Burst time
P0
0 ms
9 ms
P1
1 ms
4 ms
P2
2 ms
9 ms
The pre-emptive shortest job first
scheduling algorithm is used. Scheduling
is carried out only at arrival or
completion of processes. What is the
average waiting time for the three
processes?
(A) 5.0 ms
(C) 6.33 ms
(B) 4.33 ms
(D) 7.33 ms
CS 2012
11. Consider the 3 processes, P1, P2 and P3
shown in the table
Process
Arrival
Time unit
time
required
P1
0
5
P2
1
7
P3
3
4
The completion order of the 3 processes
under the policies FCFS and RR2 (round
robin scheduling with CPU quantum of 2
time units) are
(A) FCFS: P1, P2, P3 RR2: P1, P2, P3
(B) FCFS: P1, P3, P2 RR2: P1, P3, P2
(C) FCFS: P1, P2, P3 RR2: P1, P3, P2
(D) FCFS: P1, P3, P2 RR2: P1, P2, P3
CS 2013
12. A scheduling algorithm assigns priority
proportional to the waiting time of a
process. Every process starts with
priority zero (the lowest priority ). The
scheduler reevaluates the process
priorities every T time units and decides
the next process to schedule. Which one
of the following is TRUE if the processes
have no I/O operations and all arrive at
time zero?
(A) This algorithm is equivalent to the
first come first serve algorithm.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 189
15.
CS 2014
13. Consider the following set of processes
that need to be scheduled on a single CPU.
All the times are given in milliseconds.
Process
Arrival
Execution
Name
Time
Time
A
0
6
B
3
2
C
5
4
D
7
6
E
10
3
Using the shortest remaining time first
scheduling algorithm, the average process
turnaround time (in msec) is ___________
14.
Operating System
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 190
Operating System
[Ans. D]
For non pre emptive.
e
e
Total time spent = 47
Idle time = 2+3 = 5
Percent of time CPU is IDLE =
=
5.
[Ans. A]
idle no pro e
v
k
k
d
[Ans. A]
k
Group 1
P. dGang scheduling
Q.k Rate Monotonic Scheduling
Total time = 33 3 = 30
2.
[Ans. B]
Let three processes are
Process
Arrival time
6.
Burst
time
0
10
2
20
6
30
The Gannt chart for SRTF scheduling
algorithm is
[Ans. B]
The Gantt chart for SRTF scheduling
algorithm is
3.
P1
0
[Ans. A]
The Gantt chart for LRTF CPU cheduling
algorithm is
[Ans. B]
Process
P1
P2
P3
Burst
Time
10
20
30
I/O
Time
2
4
6
CPU
Time
7
14
21
P2
20
P3
30
P4
P2
40
55
70
[Ans. C]
If the time used in RR scheduling is more
than the maximum time required to
execute any process. Then the policy will
degenerate to first come first serve
9.
[Ans. D]
All three options are correct
idle
u y in
I/O
Time
1
2
3
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 191
10.
[Ans. A]
14.
=
=
11.
[Ans. C]
RR Queue
P1 P2 P1
0
1
2
P3
3
P2
4
P1
6
P3
8
P2
10
P1,P2,P3
Therefore option (C) is correct.
FCFS:P1,P2,P3
RR2:P1,P3,P2
12.
13.
[Ans. B]
Every process arrives at time zero and
priority is proportional to waiting time
quantum T time units. Every process is
given equal chance, all are arrived at
same time. This is equal to round robin
algorithm. Because after each T time
waiting time of all process will increase
(except running process)
Operating System
[Ans. 1000]
Total No of Processes = 3 = {A, B, C}
{A, B, C} Processes Executes a loop of
100 iterations.
In each iteration of a loop
Computation[ m ]
Operation
m
I/O of processes can proceed in parallel
since there are sufficient no. of I/O
devices.
Process Id Arrival
_Time
A
0
100
500
B
5
350
500
C
10
200
500
CPU Scheduling Algorithm = Round Robin
with quantum = 50 milliseconds
When ro e will omple e i fir
I/O operation?
A
eA
ro e fini hed i
exe u ion for
first Iteration at 500 ms
Af er fini hing
exe u ion ro e
will go for I/O
I/O time = 500 ms
ro e will fini h i
ir
operation in first Iteration
=
=
15.
[Ans. 5.5]
P2
done
[Ans. 7.2]
Gantt chart
A
B
A
C
E
D
0
3
5
8 12 15 21
Turn around line of (A) = (8 0) = 8
Turn around line of (B) = (5 3) = 2
Turn around line of (C) = (12 5) = 7
Turn around line of (D) = (21 7) = 14
Turn around line of (E) = (15 10) = 5
Average urn around ime
P1 P1 P2 P2 P2 P2 P3 P3
0 1 2 3 4 5 6 7 8
P2[4]
P1[10]
P3
done
P3
P4
done
P4
12
P4[5]
P3[4]
P1 [10]
P4[5]
P1[10]
P1
done
P1
17
27
P1[10]
P3[6]
P2[3]
P1 [10]
=
=
= 7.2
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 192
Arriva
l Time
0
2
3
8
Burst
Time
12
4
6
5
Completion
Time
27
6
12
17
Operating System
Waiting Time
27 12 0 = 15
6 4 2 =0
=
=
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 193
Operating System
Deadlocks
CS 2005
1.
Suppose n processes, P1, , Pn share m
identical resource units, which can be
reserved and released one at time. The
maximum resource requirement of
process Pi is si, where si > 0. Which one of
the following is a sufficient condition for
ensuring that deadlock does not occur?
(A) i, si < m
(B)
i, si < n
(C)
(D)
2.
CS 2006
3.
Consider the following snapshot of a
system running n processes. Process i is
holding xi instances of a resource R, for
1 i n. Currently all instances of R are
occupied. Further, for all i, process i has
placed a request for an additional yi
instances while holding the instances it
already has. There are exactly two
processes p and q such that yp = yq = 0.
Which one of the following can serve as a
necessary condition to guarantee that the
system is not approaching a deadlock?
(A)
(B)
(C)
(D)
CS - 2007
4.
A single processor system has three
resource types X, Y and Z, which are
shared by three processes. There are 5
units of each resource type. Consider the
following scenario, where the column
alloc denotes the number of units of each
resource type allocated to each process
and the column request denotes the
number of units of each resource type
requested by a process in order to
complete execution. Which of the
processes will finish LAST?
alloc
request
X Y Z
X Y Z
P0
1 2 1
1 0 3
P1
2 0 1
0 1 2
P2
2 2 1
1 2 0
(A) P0
(B) P1
(C) P2
(D) None of the above, since the system
is in a deadlock
CS - 2008
5.
The following is a code with two threads,
producer and consumer, that can run in
parallel. Further, S and Q are binary
semaphores equipped with the standard
P and V Operations.
Semaphore S = 1, Q = 0 ;
integer x ;
producer:
consumer:
while (true) do
while (true) do
P(S) ;
P(Q) ;
x = produce ( ) ; consume (x) ;
V(Q) ;
V(S) ;
done
done
Which of the following is true about the
program above?
(A) The process can deadlock
(B) One of the threads can starve
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 194
t = 3 : requests 2
units of R1
t = 5 : releases 1
unit of R2
and 1 unit of
R1
t = 7 : releases 1
unit of R3
t = 8 : requests 2
units of R4
Process P1 :
CS - 2009
8.
The enter_CS( ) and leave_CS( ) functions
to implement critical section of a process
are realized using test-and-set instruction
as follows:
void enter_CS ( X)
{
while (test-and-set (X))
}
void leave_CS (X)
{
X = 0;
}
In the above solution, X is a memory
location associated with the CS and is
t = 0 : requests 2
units of R3
t = 2 : requests 1
unit of R4
t = 4 : requests 1
unit of R1
t = 6 : releases 1
unit of R3
t = 8 : Finishes
t = 0 : requests 1
unit of R4
t = 2 : requests 2
units of R1
t = 5:releases 2
units of R1
t = 7 : requests 1
unit of R2
t = 8 :requests 1
unit of R3
t = 9 : Finishes
t = 0 : requests 2
units of R2
t = 1 : requests 1
unit of R3
t = 10: Finishes
9.
Process P3 :
7.
Process P2 :
6.
Operating System
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 195
CS - 2010
10. A system has n resources
, ..
and k processes
, ..
. The
implementation of the resource request
logic of each process , is as follows:
if ( i % 2 = = 0) {
if ( i <n) request ;
if ( i + 2 < n)request
;}
else {
if ( i <n) request
;
if ( i + 2<n) request
;
}
In which one of the following situations is
a deadlock possible?
(A) n = 40, k = 26
(B) n = 21, k = 12
(C) n = 20, k = 10
(D) n = 41, k = 19
CS - 2013
11. Three concurrent processes X, Y and Z
execute three different code segments
that access and update certain shared
variables. Process X execute the
P operation (i.e., wait) on semaphores a, b
and c; process Y executes the P operation
on semaphores b, c and d; process Z
executes the P operation on semaphores
c, d and a before entering the respective
code segments. After completing the
execution of its code segments, each
process invokes the V operation (i.e.,
signal) on its three semaphores. All
semaphores are binary semaphores
initialized to one. Which one of the
following represents a deadlock free
order of invoking the P operations by the
processes?
(A) X: P(a)P(b)P(c)
Y: P(b)P(c)P(d)
Z: P(c)P(d)P(a)
(B) X: P(b)P(a)P(c)
Y: P(b)P(c)P(d)
Z: P(a)P(c)P(d)
(C) X: P(b)P(a)P(c)
Y: P(c)P(b)P(d)
Z: P(a)P(c)P(d)
(D) X: P(a)P(b)P(c)
Y: P(c)P(b)P(d)
Z: P(c)P(d)P(a)
Operating System
CS 2014
12. An operating system uses the Bankers
algorithm for deadlock avoidance when
managing the allocation of three resource
types X, Y and Z to three processes P0, P1,
and P2. The table given below presents
the current system state. Here, the
Allocation matrix shows the current
number of resources of each type
allocated to each process and the Max
matrix shows the maximum number of
resources of each type required by each
process during its execution.
Allocation
Max
X
Y
Z
X
Y
Z
P0 0
0
1
8
4
3
P1 3
2
0
6
2
0
P2 2
1
1
3
3
3
There are 3 units of type X, 2 units of type
Y and 2 units of type Z still available. The
system is currently in a safe state.
Consider the following independent
requests for additional resources in the
current state:
REQ1: P0 requests 0 units of X, 0 units of
Y and 2 units of Z
REQ2: P1 requests 2 units of X, 0 units of
Y and 0 units of Z
Which one of the following is TRUE?
(A) Only REQ1 can be permitted.
(B) Only REQ2 can be permitted.
(C) Both REQ1 and REQ2 can be
permitted.
(D) Neither REQ1 nor REQ2 can be
permitted.
13.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 196
Operating System
[Ans. C]
No. of processes = n 1, 2. n
No. of identical resources = m.
The maximum resource requirement
for a process Pi is SP, where Si > 0
If all process is in safe state then system
can allocate resources to each process
Pi in some order and still avoid a
deadlock. We can avoid the deadlock if
each Pi request can be satisfied by the
current available resource plus the
resources held by process Pj such that
j<i.
The
maximum
resource
requirement of n processes is
Si
and this amount must be less than
m + n.
So,
m n
2.
[Ans. C]
Here I and II says
T11>T21
T12>T22
P1
P2
Required R1
required R1
Required R2
required R2
Assume that P1 is running and after a
context switch P2 goes to running state
that it cannot snatch resource from P1,
because
has high priority for both
resources. Hence no deadlock.
3.
4.
[Ans. C]
Consider the matrix
alloc
Request
X Y Z
X Y Z
1 2 1
1 0 3
P1
2 0 1
0 1 2
2 2 1
1 2 0
The available matrix is (0 1 2) and
requirement of process P1 is (0 1 2). So
P1 can uses the available resources after
release the resources, the matrix becomes
Alloc
Request
X Y Z
X Y Z
P0
1 2 1
1 0 3
P1
0 0 0
0 0 0
P2
2 2 1
1 2 0
In this time available matrix is (2 1 3) and
required matrix of P0 is (1 0 3) so P0 uses
the resources of the releasing resources.
The available matrix is (3 3 4). So, P2 will
use the resource. So, P2 will finish last.
5.
[Ans. D]
Since, after every produce function; it
calls consume function. Producer and
consumer will run in strict alteration.
So (D) is true
6.
[Ans. A]
In deadlock prevention, OS tries to
prevent system from deadlock by not
allowing any one of the four necessary
conditions to hold
So, option A is not true
7.
[Ans. B]
If a process release all resources before
making a request for another resource,
starvation may or may not occur but
deadlock cannot occur; because hold and
wait condition will not hold
8.
[Ans. A]
The given solution is deadlock free
[Ans. B]
There is no any additional requirement
for both processes. So both p & q should
be executed with all allocated resources
so
should be sufficient for p & q
and should be at least (min
y ).
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 197
9.
Operating System
[Ans. A]
Initially available resources
R1
R2
R3
R4
3
3
3
2
Process
t=0
Allocate
R2
R3
2
0
0
2
0
0
R4
0
0
1
R1
3
Available
R2
R3
0
1
R4
1
request 2 unit of 2
request 2 unit of 3
request 1 unit of 4
P1
P2
P3
R1
0
0
0
request 1 unit of 3
P1
P2
P3
0
0
0
2
0
0
1
2
0
0
0
1
request 1 unit of 4
request 2 unit of 1
P1
P2
P3
0
0
2
2
0
0
1
2
0
0
1
1
request 1 unit of 2
ait for 1 unit of 1
P1
P2
P3
1
1
2
2
0
0
1
2
0
0
1
1
P1
P2
P3
1
1
0
1
0
0
1
2
0
0
1
1
=
request 1 unit of 4
(wait)
=
request 1 unit of 2
and 1 unit of R1
release 2 units of 1
now request of , 1 unit of R1 will be granted and request of
=
request 1 unit of 3
P1
P2
P3
1
1
0
1
0
0
1
1
0
0
1
1
request 1 unit of 3
request 1 unit of 2
P1
P2
P3
1
1
0
1
0
1
0
1
0
0
1
1
finish
P1
P3
1
0
1
0
1
1
1
1
0
0
0
1
0
1
0
1
finish
P1 1
request of 2 unit of R4 by P1 will be granted
P1 1
=
finish
All processes will finish without any deadlock
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 198
10.
[Ans. B]
According to the given program, in all the
cases for even sequences of processes
only corresponding sequence number of
resource will be allotted except case (B),
where n = 21, k = 12,
For
can only be allotted and for
can be allotted.
allotted and for odd sequence of
process i.e.
that never conflict in
any case except (B), when a same
resource is requested by more than one
process at the same time may lead to the
deadlock.
11.
[Ans. B]
Suppose X performs P(b) and preempts, Y
gets chance, but cannot do its first wait
i.e., so waits for X, now Z gets the chance
and performs P(a) and preempts, next X
get chance. X cannot continue as wait on
a is done by Z already, so X aits for Z. At
this time Z can continue its operations as
down on c and d. Once Z finishes, X can do
its operations and so Y. In any of
execution order of X, Y, Z one process can
continue and finish, such that waiting is
not circular. In option (A), (C) and (D) we
can easily find circular wait, thus
deadlock
12.
[Ans. B]
Allocation
Max
Need
X
Y
Z X Y Z X Y
P0 0
0
1 8 4 3 8 4
P1 3
2
0 6 2 0 3 0
P2 2
1
1 3 3 3 1 2
Need = Max Allocation
Available = [3, 2, 2]
REQ 2 can be permitted because needed
resources by P1 are [3, 0, 0] and after that
there is no any condition for unsafe state.
REQ 1 can not be permitted because P0
and P2 can not be completed in available
resources [3, 2, 2]
13.
Operating System
[Ans. 7]
Total no of programs = 3 = {P1, P2, P3}
Each program requires = 3 tape drives
Now just allocate one less than the
required resources
Program
No. of tap drives
P1
3 1=2
P2
3 1=2
P3
3 1=2
6 tape drives
To avoid Deadlock, we need minimum
= 6 + 1 = 7 tape drives
Z
2
0
2
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 199
Operating System
3.
CS - 2007
4.
A virtual memory system uses First In
First Out (FIFO) page replacement policy
and allocates a fixed number of frames to
a process. Consider the following
statements:
P: Increasing the number of page frames
allocated to a process sometimes
increases the page fault rate
Q: Some program do not exhibit locality of
reference.
Which one of the following is TRUE?
(A) Both P and Q are true and Q is the
reason for P
(B) Both P and Q are true, but Q is not
the reason for P
(C) P is false, but Q is true
(D) Both P and Q are false
5.
6.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 200
7.
8.
CS - 2008
9.
A processor uses 36-bit physical
addresses and 32-bit virtual addresses,
with a page frame size of 4 Kbytes. Each
page table entry is of size 4 bytes. A three
level page table is used for virtual-tophysical address translation, where the
virtual address is used as follows
10.
Operating System
CS - 2009
11. In which one of
replacement policies,
occur?
(A) FIFO
(B) Optimal
12.
13.
CS - 2010
14. A system uses FIFO policy for page
replacement. It has 4 page frames with no
pages loaded to begin with. The system
first accesses 100 distinct pages in some
order and then accesses the same 100
pages but now in the reverse order. How
many page faults will occur?
(A) 196 (B) 192 (C) 197 (D) 195
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 201
CS - 2011
15. Let the page fault service time be 10 ms in
a computer with average memory access
time being 20 ns. If one page fault is
generated for every
memory
accesses, what is the effective access time
for the memory?
(A) 21 ns (B) 30 ns (C) 23 ns (D) 35 ns
CS - 2012
16. Consider the virtual page reference string
1, 2, 3, 2, 4, 1, 3, 2, 4, 1
On a demand paged virtual memory
system running on a computer system
that has main memory size of 3 page
frames which are initially empty. Let LRU,
FIFO and OPTIMAL denote the number of
page faults under the corresponding page
replacement policy. Then
(A) OPTIMAL < LRU < FIFO
(B) OPTIMAL < FIFO < LRU
(C) OPTIMAL = LRU
(D) OPTIMAL = FIFO
CS - 2013
Statement for linked Answer Questions 17
and 18:
A computer uses 46- bit virtual address,
32 bit physical address, and a
three level paged page table
organization. The page table base register
stores the base address of the first level
table (T1), which occupies exactly one
page. Each entry of T1 stores the base
address of the second level table (T2).
Each entry of T2 stores the base address
of a page of the third level table (T3).
Each entry of T3 stores a page table entry
(PTE). The PTE is 32 bits in size. The
processor used in the computer has a
1 MB 16- way set associative virtually
indexed physically tagged cache. The
cache block size is 64 bytes.
17. What is the size of a page in KB in this
computer?
(A) 2
(C) 8
(B) 4
(D) 16
18.
Operating System
CS - 2014
19. Assume that there are 3 page frames
which are initially empty. If the page
reference string is
1, 2, 3, 4, 2, 1, 5, 3, 2, 4, 6, the number of
page faults using the optimal replacement
policy is__________.
20.
21.
22.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 202
Operating System
2.
3.
4.
5.
[Ans. A]
No. of pages = 128 = 2
Bits needed for page table entry = 7
page size = 4 KB = 4.2 byte.
= 12 bits.
For 4 way associative memory cell needs
2- bit (2
Total engaged bits = 7+12+2=21 bits
Minimum size of TLB = 32 21= 11 bits
[Ans. C]
Since both memory are equal. Therefore
address translation from virtual to
physical is not needed. And it is done by
MMU. So, hardware support for memory
management is no longer needed
[Ans. C]
T = storage overhead for segmentation
and paging method
S= storage overhead for segmentation
method
P = storage overhead for paging method
= 48+58+38+88 = 160
T = Stores the software programs needed
hus
, and
= 954+2544+454+3644=3432
<<.
[Ans. B]
P and Q both are true but Q is not the
reason for P because increasing the
number of page frames allocated to a
process sometime increases the page fault
rate or it is not concern with replacement
policy.
[Ans. B]
There are four block of size 4k, 8k, 20k, 2k
Request Allocated Remaining
Usage
No
block
block
time
4k, 8k,
J1
2k
20k
4
J2
20k
4k, 8k, 6k
10
J3
4k
k, 8k, 6k
2
J4
6k
k, 8k
8
It will wait to free block used by J2. So it
will wait for 10 units, then J6 will
[Ans. D]
Page reference string is
1, 2, 4, 5, 1, 2, 3, 4
So,
2
No. of page faults = 8
7.
[Ans. A]
Number of page frames = 3
Consider the optimal page replacement
algorithm as follows:
1, 2, 1, 3, 7, 4, 5, 6, 3, 1.
Page
Frame
Referring
2
String Page Page
Page
Fault Fault
[Ans. C]
Consider the LRU page replacement
policy
Page
Frame
Referring
2
String Page Page
Page
Fault Fault
[Ans. B]
Number of bits required for first level
page table = 24
Number of bits required for 2nd level
page table = 24
Number of bits required for 3rd level page
table = 24
10.
[Ans. D]
Dirty
write-back policy,
R/W
page protection,
Reference
page replacement policy,
valid
page initialization.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 203
12.
13.
14.
[Ans. A]
Beladys anomaly can occur only in FIFO.
Which means with increment in page
frames, sometimes no. of pages faults also
increases
)]
)
2 ns
2 ns
(
(
)
)
3 3 3 3 3 2 2 2
2 2 2 2 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 4 4 4 4 4
5 MISS
6 MISS
LRU
1
M
2
1
M
3
2
1
M
3
2
1
H
3
2
4
M
1
2
4
M
1
3
4
M
1
3
2
M
4
3
2
M
4
1
2
M
[Ans. C]
Let page size = 2 bytes
Page offset = X bits
46 X
X
2
2
i e of
2
2
Size of
2 B
Size of
2
& 2
2
occupies e actly one page
age si e
18.
B
B
[Ans. C]
Page size = 2 Bytes
Divide cache size by page size & group 16
pages in one set.
No. of pages in caches
No. of sets in cache =
2 pages
sets
[Ans. B]
Effective access time
= [(1 p) access time when no page
fault +p access time during page fault]
[
FIFO
3 3 3 3 3 2 2 2
2 2 2 4 4 4 4 4 4
[Ans. B]
Multilevel page table is preferred to
reduce the size of page table needed to
implement the virtual address space of a
process.
[Ans. A]
FIFO policy for page replacement used.
Access 100 distinct pages by taking some
example 2 3 4 5 6 7 8 9.
So by loading it get
5
= 4 page faults
4
3
2
[Ans. B]
OPTIMAL
[Ans. B]
Page frame numbers are most important,
virtual page number may not be stored
entirely.
9
8
= 4 page faults
7
6
and now access these pages in reverse so
2
o, no page fault for these page fault for these
9
5
8
4 4 page faults
7
3
6
2
So total = 4+4+4=12 page faults
For 8 pages = 2 8 4=12
So for n pages = 2n 4
For 100 pages = 2 (
=196
15.
16.
MISS
MISS
MISS
HIT
MISS
HIT
H
M
H
H
M
M
M
H
M
M
H
M
H
H
M
M
M
11.
Operating System
ms
ns
ns
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 204
19.
[Ans. 7]
1
2
1
1
2
3
1
2
3
No. of page faults = 7
4
1
2
4
2
1
2
4
1
1
2
4
5
5
2
4
3
3
2
4
Operating System
2
3
2
4
4
3
2
4
20.
[Ans. 6]
Total frames = 3
LRU page replacement algorithm: Least recently used page has to be replaced
4
7
6
1
7
6
1
2
7
2
4
4
4
1
1
1
7
7
7
2
2
6
6
6
7
Total no. of page faults = 6
21.
[Ans. 122]
Page Table is in Main Memory
Time to access TLB = 10 milliseconds
Time to access Memory = 80 milliseconds
TLB hit ratio = 0.6
6
3
6
4
Effective Access Time [EAT] = 0.6 (10 + 80) + 0.4 (10 + 80 + 80)
= 54 + 68
= 122 milliseconds
Time to access page Table
22.
[Ans. D]
Total no.of physical page frames = frames in main memory = 20
, 2, 2
Pages of a program = pages in Hard Disk = 100
, 2, ,
rogram accesses the page numbered , 2, , 100} THRICE in the order. [3 times]
Which page replacement algorithm gives the same no. of page faults when Optimal page
replacement policy is used?
Page Replacement Algorithm = Optimal Page Replacement
Replace the age that will not be used for a longest period of time in future
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 205
Page
numbered
, 2, 2 in
main
Memory
occupying
20 Free
Frames
Page : 21
Page : 22
Page : 23
Operating System
Page : 24
101
1
101
1
101
1
101
1
101
1
102
2
102
2
102
2
102
2
102
2
103
3
103
3
103
3
103
3
103
3
104
4
104
4
104
4
104
4
104
4
105
5
105
5
105
5
105
5
105
5
106
6
106
6
106
6
106
6
106
6
107
7
107
7
107
7
107
7
107
7
108
8
108
8
108
8
108
8
108
8
109
9
109
9
109
9
109
9
109
9
110
10
110
10
110
10
110
10
110
10
111
11
111
11
111
11
111
11
111
11
112
12
112
12
112
12
112
12
112
12
113
13
113
13
113
13
113
13
113
13
114
14
114
14
114
14
114
14
114
14
115
15
115
15
115
15
115
15
115
15
116
16
116
16
116
16
116
16
116
16
117
17
117
17
117
17
117
17
117
17
118
18
118
18
118
18
118
18
118
18
119
19
119
19
119
19
119
19
119
19
120
20
120
21
120
22
120
23
120
24
For every Fault Optimal Algorithm will be selecting the Most Recently Used Page a Replacement.
Both Optimal & Most recently Used will generate same no of Page Faults.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 206
Operating System
File System
CS 2005
1.
In a computer system, four files of size
11050 bytes, 4990 bytes, 5170 bytes and
12640 bytes need to be stored. For
storing these files on disk, we can use
either 100 byte disk blocks or 200 byte
disk blocks (but cant mix block sizes).
For each block used to store a file, 4 bytes
of bookkeeping information also needs to
be stored on the disk. Thus, the total
space used to store a file is the sum of the
space taken to store the file and the space
taken to store the bookkeeping
information for the blocks allocated for
storing the file. A disk block can store
either bookkeeping information for a file
or data from a file, but not both. What is
the total space required for storing the
files using 100 byte disk blocks and 200
byte disk blocks respectively?
(A) 35400 and 35800 bytes
(B) 35800 and 35400 bytes
(C) 35600 and 35400 bytes
(D) 35400 and 35600 bytes
CS 2014
4.
A FAT (file allocation table) based file
system is being used and the total
overhead of each entry in the FAT is 4
bytes in size. Given a
bytes
disk on which the file system is stored
and data block size is
bytes, the
maximum size of a file that can be stored
on this disk in units of
bytes is
____________.
CS - 2008
2.
The data block of a very large file in the
Unix file system are allocated using
(A) Contiguous allocation
(B) Linked allocation
(C) Indexed allocation
(D) An extension of indexed allocation
CS 2012
3.
A file system with 300 Gbyte disk uses a
file descriptor with 8 direct block
addresses, 1 indirect block address and 1
doubly indirect block address. The size of
each disk block is 128 Bytes and the size
of each disk block address is 8Bytes. The
maximum possible file size in this file
system is
(A) 3 Kbytes
(B) 35 Kbytes
(C) 280 Bytes
(D) Dependent on the size of the disk
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 207
Operating System
[Ans. C]
Size of Block =
bytes
Total no. of Blocks in Disk = Total Size of
Disk / Size of Block
= 100
/
=
Blocks
Size of FAT table = Total No of Blocks
Size of each entry in FAT
=
4 = 0.4
bytes
Max Size of File = Total Size of Disk - Size
of FAT
= (100
) (0.4
) = 99.6
bytes
Answer = 99.6
bytes
99.6 in
units of
bytes
locks fo file
Blocks for book keeping =
For 100 bytes blocks:File
Book keeping
F1
111
5
F2
50
2
F3
52
3
F4
127
6
Total
340
16
)
)
For 200 block size
Blocks for
file
F1
55
F2
25
F3
26
F4
64
Total
170
)
Blocks for
Book keeping
2
1
1
3
7
)
2.
[Ans. D]
The data blocks of a very large file in the
unix file system are allocated using an
extension of indexed allocation or EXT2
file system.
3.
[Ans. B]
Maximum possible size =
add ess pointed b doubl indi ect block)
add ess pointed b single add ess)
add ess pointed b single di ect add ess)
block size
[(
)
k
4.
(
k
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 208
Operating System
I/O System
CS - 2009
1.
Consider a disk system with 100
cylinders. The requests to access the
cylinders occur in the following sequence:
4, 34, 10, 7, 19, 73, 2, 15, 6, 20
Assuming that the head is currently at
cylinder 50, what is the time taken to
satisfy all requests if it takes 1 ms to move
from one cylinder to adjacent one and
shortest seek time first policy is used?
(A) 95 ms
(C) 233 ms
(B) 119 ms
(D) 276 ms
CS - 2011
2.
An application loads 100 libraries at
startup. Loading each library requires
exactly one disk access. The seek time of
the disk to a random location is given as
10 ms. Rotational speed of disk is
6000rpm. If all 100 libraries are loaded
from random locations on the disk, how
long does it take to load all libraries? (The
time to transfer data from the disk block
once the head has been positioned at the
start of the block may be neglected.)
(A) 0.50 s
(C) 1.25 s
(B) 1.50 s
(D) 1.00 s
CS - 2013
3.
Consider a hard disk with 16 recording
surfaces (0-15) having 16384 cylinders
(0-16383) and each cylinder contains 64
sectors (0-63). Data storage capacity in
each sector is 512 bytes. Data are
organized cylinder wise
and the
addressing format is <cylinder no.,
surface no., sector no>. A file of size
42797 KB is stored in the disk and the
starting disk location of the file is
< 1200, 9, 40>. What is the cylinder
number of the last sector of the file, if it is
stored in a contiguous manner?
(A) 1281
(C) 1283
(B) 1282
(D) 1284
[Ans. B]
Head is currently at cylinder 50,
Total moves = 16 + 14 + 1 + 4 + 5 + 3
+1 + 2 + 2 + 71
= 119
So for each move time taken = 1ms
So for 119 moves time =119 ms
2.
[Ans. B]
Rotation speed = 6000 rpm
Seek time = 10 ms
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 209
Operating System
[Ans. D]
Each surface contains = 64 sectors
Each cylinder contains = 64
sectors
42797 KB =
Current cylinder 1200, can have
24+(6 64) = 408 sectors more for this
file
Remaining sectors = 85186
No. of sectors in one cylinder = 1024
So, to store remaining sectors cylinders
needed
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 210
TOC
Finite Automata
CS 2005
1.
Consider the machine M
a
b
a
a
a
a, b
CS 2007
4.
A minimum state deterministic finite
automation accepting
the language
L = {w w {0,1}*, number of 0s & 1s in
w are divisible by 3 and 5, respectively}
has
(A) 15 states
(C) 10 states
(B) 11 states
(D) 9 states
5.
0/1
1/0
1/1
x
s
s
y
x
x
CS 2006
3.
In the automaton below, s is the start
state & t is the only final state.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 211
CS 2009
6.
Given the following state table of an FSM
with two states A and B, one input and
one output:
Present
State A
0
0
1
1
0
0
1
1
7.
Present
State B
Input
Next
State
A
Next
State
B
Out
put
0
0
0
0
1
1
0
1
0
0
0
0
0
1
0
1
0
1
0
0
0
1
0
1
0
1
1
0
0
1
0
1
0
1
1
1
1
0
0
1
If the initial state is A = 0, B = 0, what is
the minimum length of an input string
which will take the machine to the state
A = 0, B = 1 with Output = 1?
(A) 3
(C) 5
(B) 4
(D) 6
CS 2011
9.
Definition of a language L with alphabet
{a} is given as following
L={
k
n n is positiv int g r
constant}
What is the minimum number of states
needed in a DFA to recognize L?
(A) k + 1
(C) 2n+1
(B) n + 1
(D) 2k+1
10.
(A)
(B)
(C)
(D)
TOC
CS 2010
8.
Let w be any string of length n in {0, 1}*.
Let L be the set of all substrings of w.
What is the minimum number of states in
a non-deterministic finite automaton that
accepts L?
(A) n 1
(C) n+1
(B) n
(D) 2
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 212
TOC
1
1
s
1
11.
11
(B)
12.
00
00
01
10
11
01
0
1
10
11
q
l
0
0
(C)
00
00
01
10
11
CS 2012
13. What is the complement of the language
accepted by the NFA shown below?
ssum { } n
is the empty string
01
1
1
10
11
q
0
11
q
0
0
0
(D)
a
(A)
14.
(B) { }
00
(C)
(D) {
00
01
10
11
01
1
10
1
0
0
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 213
CS 2013
15. Consider the DFA A given below.
1
TOC
CS 2014
16. Consider the finite automaton in the
following figure
1
1
q
1
1
17.
L t
finit non-empty alphabet and
let 2
th pow r s t of * Whi h on
of the following is TRUE?
(A) Both 2 n * are countable
(B) 2 is ount l n * is un ount l
(C) 2 is un ount l n * is ount l
(D) Both 2 n * r un ount l
2.
[Ans. B]
(A) is f ls sin M is
pting bbb
(B) is true.
(C) is false since the string abb is
accepted by M.
(D) is false, since abb does not contain
s su string ut abb is being
rejected by M.
[Ans. B]
To onv rt
in ry num r to 2s
complement fom, all the digits from LSB
are directly copied upto the 1st occurance
of 1. After that all digits are
complemented
0/0
0/1
1/1
2s
[Ans. D]
At the end of string u, automaton will be
at the final state t, but the automaton will
be at the state s after the end of both the
strings v and w.
1/0
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 214
4.
[Ans. A]
L={w w { 1} number of s n 1s in
w are divisible by 3 and 5 respectively}
The minimum number of states for the
state deterministic finite automation
accepting the language L has
3 5 = 15 states.
5.
[Ans. D]
As s and s are both final states, the
strings accepted are x, y, xyx, yxx etc.
6.
[Ans. A]
String 1 0 1 will bring m/c to specified
state.
The transition diagram is given below:
0/1
1/0
1/1
11
9.
[Ans. B]
The following DFA that accepts a
s qu n of s whos l ngth is positiv
multiple of a constant n. It has n + 1
states q0 through qn.
10.
[Ans. A]
The language accepted by given DFA is
L
Choice (A)is accepting same language and
is minimal
is r j t
y hoi
and it belongs to L. So choice (B) is
incorrect.
Choice (C) is an NFA and hence not the
right answer
is
pt
y hoi
n is
rejected by L. So choice (D) is incorrect.
11.
[Ans. A]
Lexical analysis uses express regular
expressions. So, finite state automata is
necessary and sufficient to perform
lexical analysis.
12.
[Ans. C]
Complement of a regular language is
always regular.
13.
[Ans. B]
1
0/0
7.
8.
[Ans. C]
(A) says that all strings that start with
either 0 or 1, which is not true because
1001 is one of this string which is not the
member of given DFA.
(B) imil rly string is
n ing string
and not acceptable by given DFA.
(D) lso nt
orr t s
1 is not
accepted by given DFA.
Any string of {0, 1} that ends with 00
certainly acceptable by this DFA.
0/1
Dead state
0/1
0/1
1/1
TOC
[Ans. C]
Since L is set of all substrings of w, that
mean L has strings of Length
0, 1, 2, 3 ---------- n.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 215
14.
[Ans. D]
Notice that the state names are given
based on ending bits of the string, which
has been processed.
Th r from
l
l shoul go to
trap state q (since at most 2 zeros are
allowed in any substring).
Based on this fact, option (A) and (B) are
incorrect.
Between option (C) and (D), if you look at
r l
l
1 from st t
1 this r
should go to state 11 since the string at
this point is ending with 11. So option (C)
is wrong and option (D) is correct.
The DFA corresponding to correct option
(D) is shown below missing arrow shown
in dotted lines.
4.
16.
[Ans. A]
(Current state, input) = next state
q
q
q
q
q 1
q or q
q 1
q
So set of reachable states
{q q q }
17.
[Ans. C]
2 is the power set of
is countability infinite.
The power set of countable infinite set is
uncountable.
So 2 is uncountable, and is countable
1
1
15.
Minimal DFA is
1
1
TOC
11
[Ans. D]
1. Complement of L(A) is context free
True
As there exist a DFA , L(A) is regular.
Regular languages are closed under
complement
Complement of L(A) is regular and
therefore context free.
2. L(A)= L((11*0+0)(0+1)*0*1*)
True
As L(A)=L((11*0+0)(0+1)*) is
equivalent to
L((11*0+0)(0+1)*0*1*).
3. For the language accepted by A, A is
minimal DFA False
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 216
TOC
Regular Expression
CS 2005
1.
Which of the following statements is
TRUE about the regular expression 01*0?
(A) It represents a finite set of finite
strings.
(B) It represents an infinite set of finite
strings.
(C) It represents a finite set of infinite
strings.
(D) It represents an infinite set of infinite
strings.
2.
q
(A)
(B)
(C)
(D)
5.
state
q3
The language *
n
+ is
(A) Regular
(B) context free but not regular
(C) context free but its complement is
not context free
(D) not context free
CS 2006
3.
Consider
the
regular
language
L= (111+11111)*. The minimum number
of states in any DFA accepting this
languages is:
(A) 3
(B) 5
(C) 8
(D) 9
4.
CS 2007
6.
Which of the following languages is
regular?
* + +
(A) *ww w
* + +
(B) *ww x x w
* + +
(C) *wxw x w
* + +
(D) *xww x w
a
a
q0
q1
q2
7.
8.
9.
(a + b) * a(a + b)b
(abb)*
(a + b) * a(a + b) * b(a + b)*
(a + b)*
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 217
CS 2008
10. Given below are two finite state automata
(
indicates the start state and F
indicates a final state)
Y:
Z:
a
b
a
b
1
2
2
2
2(F) 2
1
2(F) 1
1
Which of the following represents the
product automaton Z Y?
(A)
a
b
P
S
R
Q
R
S
R(F) Q
P
S
Q
P
(B)
a
b
P
S
Q
Q
R
S
R(F) Q
P
S
P
Q
(C)
a
b
P
Q
S
Q
R
S
R(F) Q
P
S
Q
P
(D)
a
b
P
S
Q
Q
S
R
R(F) Q
P
S
Q
P
11.
Q.
1
0
1
0
R.
1
1
0
S.
1
1
0
. + ( * + )* *
. + ( * + )*
3. + ( * + )*
4. + ( * + )* *
(A) P2, Q-1, R-3, S-4
(B) P-1. Q-3, R-2, S-4
(C) P-1, Q-2, R-3, S-4
(D) P-3, Q-2, R-1, S-4
12.
TOC
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 218
13.
TOC
CS 2010
16. Let L = {w
(0 + 1)* | w has even
num er of s+ i.e. is the set of ll it
strings with even num er of s.
Which one of the regular expressions
below represents L?
(A) (0*10*1) *
(C) 0*(10*1)*0*
(B) 0*(10*10*)*
(D) 0*1(10*1)*10*
0
0,1
0,1
CS 2009
15. Which one of the following languages
over the alphabet {0, 1} is described by
the regular expression:
( + ) ( + ) ( + )?
(A) The set of all strings containing the
substring 00
(B) The set of all strings containing at
most two s
(C) The set of all string containing at
le st two s
(D) The set of all strings that begin and
end with either 0 or 1
CS -2012
17. Given the language L = {ab, aa, baa},
which of the following strings are in L*?
1. abaabaaabaa
2. aaaabaaaa
3. baaaaabaaaab
4. baaaaabaa
(A) 1, 2 and 3
(C) 1, 2 and 4
(B) 2, 3 and 4
(D) 1, 3 and 4
CS 2013
18. Consider the languages
n
* +. Which one of the following
represents
?
(A) *+ (B)
(C)
(D) * +
CS 2014
19. Which one of the following is TRUE?
(A) The language L ={
n
+ is
regular
(B) The language
L = * n is prime+ is regul r
(C) The language
L=*w w h s 3 +
s for some
with
* + + is regul r
(D) The language
* ++
L = *ww w
with
is regul r.
20.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 219
25.
I)
II)
III)
(A)
(B)
22.
If = * n
+ n
* n
+,
consider
(I)
is regul r l ngu ge
(II)
*
n
+
Which one of the following is CORRECT?
(A) Only (I)
(B) Only (II)
(C) Both (I) and (II)
(D) Neither (I) nor (II)
23.
Let
*w
* +* w h s t le st s
m ny o urren es of (
)s s (
)s+.
*
+
et
*w
w has at least as
m ny o urren es of (
)s s (
)s+.
Which one of the following is TRUE?
(A)
is regular but not
(B)
is regular but not
(C) Both and are regular
(D) Neither nor are regular
24.
th
TOC
Let A
B denotes that language A is
mapping reducible (also known as manyto-one reducible) to language B. Which
one of the following is FALSE?
(A) If A
B and B is recursive then A is
recursive.
(B) If A
B and A is undecidable then B
is undecidable.
(C) If A
B and B is recursively
enumerable then A is recursively
enumerable.
(D) If A
B and B is not recursively
enumerable then A is not recursively
enumerable.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 220
TOC
[Ans. D]
2.
[Ans. A]
Every finite language is regular. Given
language is finite hence it is regular
[Finite language or those which have
finite string of finite length is always
regular]
[Ans. C]
q
3.
[Ans. D]
Note that 1, 11(length 2), 1111(length 4),
1111111(length 7) are not in L, while
and any string
length >= 8(since all words more than 8
length can be formed using any
combination of 111 and 11111) are in L.
The corresponding DFA is given below:
1
1
1
[Ans. A]
We will use Arden theorem to solve this.
So the derivation is as follows:
= q0 (a + b) +
- - - -(1)
Then using Arden, we
q0 = ( + ) = (a + b)* - - - - (2)
q1 = q0 a = (a + b)*a - - - - - (3)
q2 = q1 (a + b) = (a + b)*a(a + b)- - - -(4)
q3 = q2 b = (a + b)*a(a + b)b
Since q3 is final state hence r.e for it is
correct choice.
5.
[Ans. C]
6.
[Ans. C]
A B D nt etermine the en of w n
start of w .
If language is regular then an FA
definitely exists for it. Let us try to design
FA for each option. No FA can remember
4.
8.
[Ans. B]
The minimum state FSA contains 2 states
as given below for the regular expression
b*a(a+b)*
a, b
9.
[Ans. B]
(A) is false. Consider L = {w | where w is
in {a, b} *} and L1 = {anbn| where
n > = 0};
Clearly
is a subset of L and L1 is not a
regular.
(B) is true; since all finite sets are regular.
(C) is false; consider non-regular set
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 221
[Ans. A]
Draw the two automata and use product
construction.
11.
[Ans.C]
Either you n use Ar ens theorem or y
careful observation we can solve this.
[Q] accepts string ending with 0.
[R] accepts strings ending with 1. Thus
only [C] is the suitable choice
12.
[Ans. A]
Set [1] is regular as FA exists and we can
write r.e also. The r.e is a*(bb)*
(b symbol should occur in multiple of 2).
Set [2] and [3] are not regular as there is
no finite automaton exists that can
remember the count of a as to compare
with count of b.
Set [4] again is regular. The r.e for it is
(a + b)* c (a +b)*.
13.
[Ans. A]
Both automata
epts ll strings of
n s th t h ve two onse utive s.
14.
[Ans. C]
(A) and (D) cannot be the answer
because in each case minimum 2 number
of s is gu r ntee not ex tly one .
(B) also cannot be the answer because it
imposes one restri tion th t oth the s
should be consecutive.
15.
[Ans. C]
The string generates all the strings which
ont ins tle st zeros
TOC
16.
[Ans. B]
Choice (A) (0*10*1)* will always
generate strings ending with 1. But we
want an expression for bit strings with
even num er of s whi h in lu es
strings li e
whi h en s with .
So choice (A) is not correct.
Choice (C) 0* (1 0 *1)* 0*
*( * )* * ut
h s even num er of s
So choice (C) is incorrect
Choice (D)
*1(10*1)*10* but
is a
it string with even num er of s (zero
s). So hoi e (D) is in orre t.
Choice (B) can generate all bit strings
with even num er of s. So choice (B) is
correct.
17.
[Ans. C]
L = {ab, aa, baa}
The breakdown of the strings 1, 2, 4, in
terms of ab, aa and baa is shown below:
1. ab aa baa ab aa
2. aa aab aa aa
3. baa aa ab aa
String no. 3 has no breakdown in terms of
strings in L and hence string 3 does not
belong to L*.
Only 1, 2 and 4 belongs to L*.
18.
[Ans. A]
* +
As is empty language so multiplication
of with any language will give .
So
.
Also ,for all language
Also [ -*
So gives
So
*+
Option (A) is correct.
19.
th
[Ans. C]
*
n
+is not regular because
n FS
nnot e written th t will ount
i enti l sequen es of n
symbols
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 222
TOC
* n is prime+is
not
regular
because an FSM cannot be written that
will determine n is prime number or not
* + is not
*ww w
with
regular because an FSM cannot be
written that can remember w and repeat
the same for ww
So
*w w h s 3 +
s for
with
* + + is regular, because for this
language an FSM can be written.
20.
[Ans. C]
Because if both L and
are recursive
enumerable then L is recursive.
So option (C) is not possible
21.
[Ans. B]
Option II will not accept 10101 but it is
accepted by given DFA. So regular
expression II does not represent the given
DFA
R.E I & III do
22.
[Ans. A]
. is concatenation of languages and it
is regular
+
. is not*
n
23.
[Ans. D]
None of the languages are regular because
both need counting and DFA lacks
memory element.
24.
[Ans. 3]
R.E = a * b *(ba)* a *
Length 0 is present as it accepts , all
length of 1 string are present (a, b) also
n
re present ut
is
not present. So it is 3
25.
[Ans. D]
If A
B and B is not recursively
enumerable then A will surely be not
recursively enumerable.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 223
TOC
3.
4.
CS 2006
6.
Let L1 = {
nm
+,
*
nm
+ and
L3
*
nm
+ which
of these languages are NOT context free?
(A) L1 only
(C) L1 and L2
(B) L3 only
(D) L2 and L3
7.
8.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 224
3.
10.
For s
( + )* let d(s) denote the
decimal value of s (e.g.d(101) = 5). Let
*s ( + )* d(s) mod 5 2 nd
d(s) mod 7 4}?
Which one of the following statements is
true?
(A) L is recursively enumerable, but not
recursive
(B) L is recursive, but not context-free
(C) L is context-free, but not regular
(D) L is regular
Let L1 be regular language, L2 be a
deterministic context-free language and
L3 a recursively enumerable, but not
recursive, language. Which one of the
following statements is false?
(A) L1
is a deterministic CFL
(B) L3
is recursive
(C) L1 L2 is context free
(D) L1
is recursively
enumerable
CS 2007
11. The language L={0i 21i | i 0} over the
alphabet {0, 1, 2) is
(A) not recursive
(B) is recursive and is a deterministic
CFL
(C) is a regular language
(D) is not a deterministic CFL but a CFL
TOC
CS 2009
13. S S | bSb| a| b
The language generated by the above
grammar over the alphabet {a, b} is the
set of
(A) All palindromes
(B) All odd length palindromes
(C) Strings that begin and end with the
same symbol
(D) All even length palindromes
14.
15.
Let L = L1
where L1 and
are
languages as defined below:
*
mn
+
2
*
ijk
+
Then L is
(A) Not recursive
(B) regular
(C) context free but not regular
(D) recursively enumerable but not contextfree
CS 2010
16. Consider the language L1 = {
L2 = {
i j+
(
|i
i
j+
2j + +
L4 = {
i
2j+. Which one of the
following statements is true?
(A) Only L2 is context free
(B) Only L2 and L3 are context free
(C) Only L1 and L2 are context free
(D) All are context free
CS 2008
12. If L and and recursively enumerable
then L is
(A) Regular
(B) Context free
(C) Context sensitive
(D) Recursive
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 225
17.
CS 2013
18. Consider the following languages.
*
+
pqr
*
pqr
p r+
Which one the following statement is
FALSE?
(A)
is context free
(B)
is context free
(C) Complement of is recursive
(D) Complement of
is context free
but not regular
TOC
CS - 2014
19. Consider the following languages over the
+
alphabet *
*
n
+
*w w w* + +
*ww w* + +
Here, w is the reverse of the string w.
Which
of
these
languages
are
deterministic Context-free languages?
(A) None of the languages
(B) Only
(C) Only and
(D) All the three languages
[Ans. A]
and
are both context free languages.
Context free languages are not closed
under intersection.
2.
[Ans. D]
The complement of CFL need not be a
CFL.
[A] is false; Let us consider Mc as a CFL,
now remember not every CFL is regular.
Therefore it is not necessary that union is
regular.
[B] is false; as we know complement may
not CFL. Thus union over non-CFL with
regular will result into non-CFL.
[C] is false; it is not necessarily as argued
in previously.
Thus [D] is most appropriate choice
3.
[Ans. D]
: Non-Deterministic finite automata.
: Non-Deterministic push-down
automata.
D : Deterministic finite automata.
D : Deterministic push down automata.
A ording to Su set Constru tion
theorem every language accepted by Nondeterministic-finite automata. ( ) is also
accepted by some Deterministic-Finite
automata (D ) so D = .
Deterministic push-down automata (D )
recognizes a proper subset of the
language of context-free languages and
the non-deterministic push down
automata recognizes the context-free
languages.
So D
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 226
4.
5.
6.
[Ans. B]
Given that is REC and
is RE but not
REC
Consider choice (A) is REC and is RE.
Since is REC, clearly is also REC.
Since
is RE but not REC, its
complement has to be not RE.
But (A) l ims th t is RE. Therefore
(A) is false
Consider (B) is REC and is not RE.
If is REC, then is REC.
Also, if is RE but not REC, then is not
RE
(B) is true.
Clearly (C) and (D) false since is not RE.
*
same as
context sensitive
7.
+ which is
[Ans. C]
Choice (A) is regular since it is finite.
Choice (B) is regular since although
omp rison is m de etween s nd s
it is for all prefixes and this can be done
by DFA.
Note: |n (s ) n (s )
2 is s me s
n (s ) n (s ) 2 or n (s ) n (s ) 2.
Chose (C) involves comparison of number
of s nd s ut for the string as a
whole, and this cannot be done by a DFA,
since it has finite memory and has no
stack for counting upto infinity.
Therefore, choice (C) is not regular
Choice (D) is regular since
n (s) mod 7 = n (s) mod 5 = 0 means
num er of s is divisi le by 7 and
num er of s is divisi le y 5 nd this
can be accepted by a DFA with 7 5 = 35
states.
A DFA that will accept the language of
choice (B) is shown below:
[Ans. B]
is CFL but not a DCFL, since accepting
ww necessarily involves finding the
middle of the string, which involves nondeterminism.
(A) is false.
is DCF is true sin e # is spe i l
symbol and middle of string can now be
surely found y using # there y
eliminating
the
need
for
nondeterministic guessing. So (B) is true.
is a CSL and not a CFL. So (C) is false.
is not a DCFL either. So (D) is false.
[Ans. D]
*
+ is context free
nm
(first n+m s re pushed into the st k
then for each of the 1s and 0s following,
we will pop the 0s in the stack one by one
until at the end of the word. If the stack is
empty then the word is accepted).
*
+ is not
nm
context free, since two comparisons have
to be made here to determine if w
.
. s nd s are equal
2. Since m <n+m, we have to ensure that,
s whi h ome fter
are less
in number, compared to n+m.
*
+is clearly
nm
context sensitive since 2 comparisons
have to be made. Infact this language is
TOC
0, 1
0
0, 1
8.
[Ans. B]
G *S SS S
S
S }
1. G is m iguous is true sin e
has infinite number of derivations
some of which are shown below:
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 227
D.
3.
2.
TOC
11.
[Ans. B]
* 2 i
} is a DCFL since, a DPDA can
ept this l ngu ge. s re pushed into
the stack and then when 2 appears in
input, state is changed and immediately
after that for every 1, a zero is popped out
of the stack. In the end, if stack has start
stack symbol only, then the string is
accepted, else it is rejected. Since every
DCFL is recursive, we can say that the
language is recursive, and is a DCFL.
12.
[Ans. D]
There is a theorem which states that
9.
[Ans. D]
There is a DFA corresponding to
d(s) mod 5 = 2 as well as d(s) mod 7 = 4.
Therefore, both of them are regular
languages. Let they be
and
. The
given language is
.
Since regular languages are closed under
intersection and complementation, the
given language is also regular.
10.
[Ans. B]
Given
be regular,
is DCFL and
is
RE but not REC.
A.
is DCF is true sin e DCF s
are closed under regular intersection.
B.
is re ursive is f lse sin e is
RE but not REC and therefore
is surely RE according to closure of RE
under regular intersection, but we
cannot be sure that
is REC.
C.
is CF is true sin e
is
DCFL and hence a CFL and
is
regul r. Therefore y losure of CF s
whenever L and
will be REC.
13.
[Ans. B]
S S S
is
the
grammar
corresponding to all odd length
palindromes.
Notice that choice (C)is not correct since
"abaa" is a string that begins and ends
with the same symbol but cannot be
generated by above grammar.
Since all strings generates by this
grammar have odd length, choices (A)
and (D) are also incorrect.
14.
[Ans. D]
The set of DCF s re proper su l ss of
the set of CF s of PDAs. So, choice (D)
is false.
15.
[Ans. C]
*
m n 0}
{
|i j k
+
L=
is context free language and
regular language, as intesection of
th
th
th
ia
and
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 228
[Ans. D]
L1 = {
i
j+
L2= {
i j+
L3 *
i 2j + +
L4 = {
i
2j+
All of
nd are context free,
since, each of these language is a linear
comparison between i & j and any linear
comparison between i & j can be
performed, in a PDA.
17.
[Ans. B]
L2 and L3 are recusively enumerable
languages, r.e. languages are closed under
intersection and union. So, option (C) and
(D) are not correct. All recursive
languages are also recursive languages.
So, L2-L1 must be recusively enumerable.
So, Option (A) is not correct.
18.
[Ans. D]
*
pqr
+ regular
language
*
pqr
p
r+ CFL
A.
is CFL : True
B.
is context free : True because
CFL is closed on regular intersection.
C. Complement of
is recursive : true,
because CFL is not closed under
complement. Any language which is
CFL is also REC and complement of
REC is REC so it is true.
D. Complement of is context free but
not regular : false because regular
language
are
closed
under
complement.
19.
th
TOC
[Ans. C]
For = *ww w( ) +
It can not be predicted that where w is
ending and where w is starting
But in
*
+
n
Both inputs are different and in
L2 = *w w w( ) +
w and w are separated by an alphabet c.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 229
TOC
Turing Machines
CS 2005
1.
Consider three decision problems
n
. It is known that
is
decidable and
is undecidable. Which
one of the following is TRUE?
(A)
is decidable if is reducible to
(B)
is undecidable if is reducible to
2.
(C)
is undecidable if
(D)
is decidable if
s complement
is reducible to
is reducible to
CS 2006
3.
Let S be an NP complete problem and Q
and R be two other problems not known
to be in NP. Q is polynomial-time
reducible to S and S is polynomial-time
reducible to R. Which one of the following
statements is true?
(A) R is NP-complete
(B) R is NP-hard
(C) Q is NP-complete
(D) Q is NP-hard
4.
7.
8.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 230
9.
10.
a
1
3
3
1
b
3
1
1
3
c
2
4
2
4
d
4
2
4
2
TOC
CS 2011
11. Consider the languages L1,
and
as
given below.
|p q +
L1 = *
*
|p q
=
n p q+ n
|p q r
=*
n p q r+
Which of the following statements is
NOT TRUE?
(A) Push Down Automata (PDA) can be
used to recognize L1 and
(B) L1 is a regular language
(C) All the three languages are context
free
(D) Turing machines can be used to
recognize all the languages
12.
CS 2012
13. Which of the following problems are
decidable?
1. Does a given program ever produce an
output?
2. If L is a context-free language, then
also context-free?
3. If L is a regular language, then is also
regular?
4. If L is a recursive language, then, is
also recursive?
(A) 1, 2, 3, 4
(C) 2, 3, 4
(B) 1, 2
(D) 3, 4
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 231
14.
(C) NP-hard = NP
(D) P = NP-complete
18.
CS 2013
15. Which of the following statement is/are
FALSE?
1. For every non deterministic Turing
machine, there exists an equivalent
deterministic Turning machine.
2. Turing recognizable languages are
closed
under
union
and
complementation
3. Turing decidable languages are
closed under intersection and
complementation
4. Turing recognizable languages are
closed under union and intersection
(A) 1 and 4
(C) 2 only
(B) 1 and 3
(D) 3 only
16.
TOC
Which
of
the
following
is/are
undecidable?
1. G is a CFG. Is L(G)= ?
2. G is a CFG. Is L(G)=*?
3. M is a Turing machine. Is L(M)regular?
4. A is a DFA and N is an NFA. Is L(A)=L(N)?
(A) 3 only
(C) 1, 2 and 3 only
(B) 3 and 4 only
(D) 2 and 3 only
CS 2014
17. Let <M> be the encoding of a Turing
machine as a string over = {0,1}. Let
L = {<M>| M is a Turing machine that
accepts a string of length 2014}. Then, L is
(A) decidable and recursively enumerable
(B) undecidable but recursively enumerable
(C) undecidable and not recursively
enumerable
(D) decidable but not recursively
enumerable
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 232
TOC
2.
3.
[Ans. C]
Note that in general if
,
decidable
decidable and
undecidable is undecidable.
Given that
is decidable and
is
undecidable.
Consider (A)
is decidable if
is
reducible to
i.e
and if
is
undecidable,
then
would
be
undecidable. But it is given that
and
decidable, therefore we cannot use this
theorem. (A) is false.
Consider (B)
is undecible if
is
reducible to i.e.
Now if
is undecidable then
is
undecidable but nothing is given
regarding
. Also if is decidable, then
would be decidable, but it is given that
is un eci
le so we c nt use this
(B) is false.
Consider (C)
is undecidable if
is
reducible to i.e
Now if is undecidable, this would mean
is undecidable. Since it is given that
is undecidable, therefore, surely
is
undecidable is correct.
Choice (C) is correct
[Ans. C]
Consider the statement.
: Given G(V E) oes G h ve n
independent set of size |V|
:
Let G contains n nodes and assume
|n|
= K for some constant K so there
is a polynomial time reduction from 3SAT
then is lso N -complete.
: Given G(V E) oes G h ve n
independent set of size 5 is also
NP-complete, reduction from 3SAT.
and
Since
S is NP-complete R is NP-complete.
(A) is true
4.
[Ans. A]
HA
be the problem of finding
Hamiltonian cycle in a graph G = (V, E)
with |V| is divisible by 3 contains three
remainders either 0, 1 and 2 can be
reduced to this problem 3SAT and hence
HA
is NP-complete problem. DHA
be the problem of determining if a
Hamiltonian cycle exists is also a
reduction from 3SAT and hence it is also
NP-complete problem. So both DHA
and HA
are NP complete and hence
NP Hard also.
5.
[Ans. B]
(A) em ership pro lem of CFGs is
decidable (CYK algorithm exists).
(B) Ambiguity problem of CFGs is
undecidable.
(C) Finiteness pro lem of F As is
decidable, since there exists an
algorithm to check if a given regular
language L is finite or infinite.
(D) Equiv lence pro lem for F As is
decidable, since there exists an
algorithm
to
check
where
L( )
( ) or not.
6.
[Ans. D]
Let L = { | p is a prime} the statement
(D) is true. There is no DFA which
recognizes the L or apply the pumping
lemma then we can say that
is not a
regular language. It is not context free
either, but L is surely accepted by a
(linearly bounded) Turning machine.
[Ans. A]
Note:
then
is NP-complete is NP-complete.
Given S, is NP-complete.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 233
7.
8.
9.
[Ans. B]
1. Intersection
of
two
regul r
l ngu ges is infinite is eci
le
since we can construct a product
DFA of the 2 given DFAs and then,
using the algorithm to check
finiteness or infiniteness on this
DFAs, we can solve the problem.
2. Whether given CF is regul r is
undecidable.
3. Whether two PDAs ccept the s me
l ngu ge is un eci
le since
equiv lence of CF s is un ecidable.
4. Whether given gr mmar is context
free is eci
le since we c n
easily check using a TM, whether the
LHS of every production has a single
variable and, then it is a CFG, else it is
not a CFG.
n
re eci
le
[Ans. D]
(A) True
(B) True
(C) True
(D) Every subset of a recursively
enumerable set is recursive, is false,
since a set is a subset of itself and
there are RE languages, which are
not recursive.
[Ans. C]
1. True
2. All - productions can be removed
from only context free grammars
th t pro uce free CF s
If L(G), then all - productions
cannot be successfully removed. So 2
is false
3. True
4. True, since is Chomsky normal form,
every production is of the form of
A BC or A
An example of a binary tree generated by
CNF derivation is shown below:
TOC
10.
[Ans. C]
In *w c w | w ( | )*+ leftmost w is the
identifier checking and rightmost w is the
use of w.
In
c
the actual parameters are
and
and the formal parameters and c
and
such that the number of
arguments of a and b are equal to c and d
respectively.
The
gr mm r
*X X X|XcX| Xf|g+
generates the arithmetic expressions with
matched pair of parentheses.
The gr mm r *X X |cXc|} generates
the palindromic string.
11.
[Ans. C]
is not context free. (It fails to satisfy
pumping lemma for context free
languages.) One can also infer the answer
by observing that options A, B and D
which are true.
12.
[Ans. B]
DFA NFA
D DA N DA
DT NT
ingle t pe T
13.
th
ulti-tape TM
[Ans. D]
If L is regular, is surely regular.
So statement number (3) is trivially
decidable.
Also if L is recursive, is also surely
recursive. So statement number (4) is
also trivially decidable.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 234
15.
[Ans. B]
L is NP complete iff
( ) N H
(2) N
(A)
ption
c n t e s N -complete
N ut not
ption C:
NPH can be NP or not be NP
ption C lso not correct
ption B : N complete P=
correct answer.
16.
[Ans. D]
1. G is CFG, Is L(G) = ? Decidable,
because in CFG there exits a algorithm
to check whether L(G) = .
2. G is CFG, Is L(G) = * un eci
le
no algorithm exits.
3. M is turning machine, Is L(M) regular,
undecidable.
4. A is a DFA and N is NFA, Is
L(A) =L(N), Trivially true so
decidable.
17.
[Ans. B]
Undecidable because
L = {< M >|M is a turing machine}
And halting of a turing machine is
undecidable problem.
Recursively enumerable because given
that turing machine accepts a string of
length 2014.
18.
[Ans. A]
There were algorithm to find the
membership of CFG (using CYK
algorithm) and finiteness of CFG (using
CNF graph) and emptiness. But there is
no algorithm for ambiguity of CFG, so it is
undecidable.
is
is
[Ans. C]
1. Non-deterministic turning machine
can be simulated into an equivalent
deterministic turing machine. So for
every non deterministic turing
machine there exits an equivalent
deterministic turing machine. So
true.
2. Turing recognizable language are
closed under complementation so
false.
3. Turing decidable languages are
closed under intersection and
complementation. If
and
are
two turing decidable languages then
we can easily construct turing
machine for
and
. So
true.
4. Turing recognizable language are
closed under union and intersection.
So true.
So option (C) is correct.
TOC
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 235
Computer Organization
[Ans. B]
(0 1000)
0
2
1 0000 2
As 1 is obvious and we dont represent in
IEEE format
Exponent = 1
antissa 0000
Hence Option B is correct
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 236
Computer Organization
Memory Hierarchy
CS 2005
1.
What is the swap space in the disk used
for?
(A) Saving temporary html pages
(B) Saving process data
(C) Storing the super-block
(D) Storing device drivers
2.
3.
4.
6.
7.
CS 2006
5.
A cache line is 64 bytes. The main
memory has latency 32ns and
bandwidth 1GBytes/s. The time required
to fetch the entire cache line from the
main memory is
(A) 32 ns
(C) 96 ns
(B) 64 ns
(D) 128 ns
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 237
8.
9.
(C) 1.8 ns
(D) 1.7 ns
i
j
(C) 16384
(D) 262144
12.
CS 2007
13. Consider a Direct Mapped Cache with 8
cache blocks (numbered 0 7). If the
memory block requests are in the
following order
3, 5, 2, 8, 0, 63, 9, 16, 20, 17, 25, 18, 30,
24, 2, 63, 5, 82, 17, 24.
Which of the following memory blocks
will not be in the cache at the end of the
sequence?
(A) 3
(C) 20
(B) 18
(D) 30
Statement for Linked Answer Questions
14 and 15:
Consider a machine with a byte
addressable main memory of
bytes.
Assume that a direct mapped data cache
consisting of 32 lines of 64 bytes each is
used in the system. A 50
two-dimensionalarray of bytes is stored
in the main memory starting from
memory location 1100 H. Assume that
the data cache is initially empty. The
complete array is accessed twice.
Assume that the contents of the data
cache do not change in between the two
accesses.
[j][i]
}
}
P1 and P2 are executed independently
with the same initial state, namely, the
array A is not in the cache and i, j, x are
in registers. Let the number of cache
misses experienced by P1 be
and
that for P2 be
is
{
{x
The value of
(A) 0
(B) 2048
11.
i
j
10.
Computer Organization
14.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 238
15.
16.
3.
4.
(A)
(B)
(C)
(D)
CS 2008
17. For a magnetic disk with concentric
circular tracks, the seek latency is not
linearly proportional to the seek distance
due to
(A) Non - uniform distribution of
requests
(B) Arm starting and stopping inertia
(C) Higher capacity of tracks on the
periphery of the platter
(D) Use of unfair arm scheduling
policies
18.
19.
20.
Computer Organization
21.
22.
th
th
th
this
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 239
CS 2009
Common Data for Question 23 and 24
A hard disk has 63 sectors per track, 10
platters each with 2 recording surfaces
and 1000 cylinders. The address of a
sector is given as a triple h , where c
is the cylinder number, h is the surface
number and s is the sector number.
Thus, the
sector is addressed as
(A)
(B)
sector is
(C)
(D)
26.
CS - 2010
Common Data for Questions 27 and 28:
A computer system has an L1 and an L2
cache, and a main memory unit
connected as shown below. The block
size in L1 cache is 4 words. The block
size in L2 cache is 16 words. The
memory access times are 2 nanoseconds,
20 nanoseconds and 200 nanoseconds
Data Bus
L2
Cache
4 words
Data Bus
Main
memory
4 words
27.
28.
29.
25.
Computer Organization
CS - 2011
30. An 8KB direct-mapped write-bank
cache is organized as multiple blocks,
each of size 32-bytes. The processor
generates 32-bit addresses. The cache
controller
maintains
the
tag
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 240
32.
37.
CS - 2013
33. A RAM chip has a capacity of 1024 words
of 8 bits each (1K 8). The number of
2
decoders with enable line needed
to construct a 16K 16 RAM from
1K
RAM is
(A) 4
(C) 6
(B) 5
(D) 7
34.
Computer Organization
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 241
38.
39.
Computer Organization
[Ans. B]
Saving process data.
2.
[Ans. C]
Increasing the RAM means increase the
primary memory which reduces the
swapping so fewer page faults occur
3.
[Ans. A]
Size of cache = 32 KB
= 32
bytes
=
yte
yte
it
Size of tag = 32 15 = 17 bits
Cache indexing size = 10 bits
4.
5.
[Ans. C]
Latency time = 32 ns.
Bandwidth = 1GB / sec
1 sec =
bytes
Or
bytes = 1sec
64 bytes = 64 n sec
Total time = 64 + 32 = 96 ns
6.
[Ans. A]
For I cache: Number of block = 1 k
10 bits can be used to distinguish
between blocks
1 block = 4 Words
2 bits to recognize between words
30
[Ans. C]
Notice here conflict occurs in placement
of block 55
3 is come first and never refuse so in this
set 3 is only victim for replacement
18
10
Tag memory
Capacity of I cache = 18
th
th
th
1k
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 242
[Ans. D]
The main memory consists of 24 banks,
each of c bytes. Since parallel accesses to
all banks are possible. Only two parallel
accesses of all banks are needed to
traverse the whole data.
For one parallel access,
Total time
= Decoding time + latency time
=
+ 80 = 92 ns
[Ans. A]
Tag Set
18
9
13.
[Ans. B]
0
8,0,16,24
1
9,17,25,17,
2
2,18,2,82
3
3
4
20
5
5
6
30
7
63
So, 18 is not present in final map shown
of cache memory
14.
[Ans. C]
56 data cache misses will occur.
There are 32 lines in the 50 50 array,
therefore initial 32 misses + 8 misses
(this will replace initial 8 lines data). In
second round initial lines needs to be
reloaded again so 8 more misses i.e. 48
15.
[Ans. A]
Line 4 to line 11.
At the last, while accessioning last 8 lines
(33 40) aging initial 8-lines 4-11 of the
= 1.7 ns
[Ans. C]
Cache is 32 KB with 128 bytes block size.
M1: When the first element A[0] [0] is
accessed , 128 byte block consisting of
[Ans. C]
Size of instruction 24 bits
Starting address of the program is 300.
The size of instruction is 3 bytes long. So
the address is always the multiple of 3
byte next address is 600 it is also the
next instruction of the program
Block
5
Block
5
transfer during
miss and 15 hits
12.
= 2.4 ns
[Ans. D]
Tag Set
17
10
= 16384 blocks
[Ans. B]
= 262144 (Because every access to
array element is a miss)
h =
9.
11.
Computer Organization
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 243
17.
[Ans. D]
No. of blocks in cache
No. of blocks in main memory
[Ans. B]
After every two elements the index
increases once, therefore after 4048
elements the index will increment 2096
( ) which is index size.
Hence, ARR[0] [0] and ARR [4] [0] has
the same.
22.
[Ans. C]
Row major access
a[0] [0] = Miss
a[0] [1] = hit
a[0] [2] = Miss
a[0] [3] = hit
[Ans. C]
Due to higher capacity of tracks on the
periphery of the platter
18.
[Ans. C]
Data TLB can be accessed only after
effective address calculation has
completed
19.
[Ans. A]
Considering the following diagram
Computer Organization
it ratio
23.
[Ans. C]
The address < 400, 16, 29> corresponds
to sector no.
400 2 10 63 + 16 63 + 29
= 505037
24.
[Ans. C]
The address < 0, 16, 31> corresponds to
sector no. 16 63 + 31 = 1039
25.
[Ans. C]
Basic RAM = 32k 1
Design RAM = 256k 8
So
cache must be at least large as the
cache is very necessary. Because
and
both are write through cache
this is not the sufficient condition.
20.
[Ans. D]
2 way set associative
Cache memory size = 64 kB
Block size = 16 B
k
line
k
et
No. of RAM =
it virtual addre
32 bits
TAG
(
)
=17 bits
SO
log ( )
= 11 bits
WO
log (
= 64
it
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 244
26.
[Ans. D]
There are total 4 sets in the cache and
each set contains 4 blocks.
0
48
4
32
Set 0
8
216
92
1
133
Set 1
73
129
[Ans. C]
From main memory, now again time of
access is 200ns. So access means for L2
came from main memory
time (
) (
)n
ano e ond
Similarly for
cache to access from
cache.
L1 time
ano e ond
Totoal time required
= 880 +22 = 902Nano seconds
255
155
3
Set 3
159
63
0 mod 4 = 0
set 0
255 mod 4 = 3 set 3
1 mod 4 = 1
set 1
4 mod 4 = 0
set 0
3 mod 4 = 3
set 3
8 mod 4 = 0
set 0
133 mod 4 = 1 set 1
159 mod 4 = 3 set 3
216 mod 4 = 0 set 0
129 mod 4 = 1 set 1
63 mod 4 = 3
set 3
8 mod 4 = 0
set 0 (already in cache)
48 mod 4 = 0
set 0 48 will replace
block 0 using LRU
32 mod 4 = 0
set 0 32 will replace
block
73 mod 4 = 1
set 1
92 mod 4 = 0
set 0 92 will replace
block 216
155 mod 4 = 3 set 3 155 will replace
255
29.
[Ans. D]
Main memory unit has capacity = 4MB
um er of
hip
it
it
it
hip ha
( ) rows and
1 K( ) cells
In ea h row
[Ans. C]
When a miss in in L1, then it goes to L2
and access the word but in 1 time only 4
words can be transferred because data
bus can take 4 words at a time.Block size
31.
Set 2
27.
Computer Organization
30.
[Ans. D]
No of blocks =
Address format
19
8
5
Tag
Block
offset
No. of tag bits per cache entry
= 19 + 1 + 1 = 21
So total =
[Ans. C]
o of a he line
o of et
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 245
16
32
11
Tags
So
32.
[Ans. A]
Tag directory size =
Number of sets no of tags in each set
(no. of tag bits in each tag + valid bits +
modified bit + replacement bit)
(
)
it
ption
i orre t
33.
[Ans. B]
At 1st level we need 4 decoders to select
16 RAMS. At second level we need
1 decoder to select the 4 decoders of 1st
level.
34.
[Ans. A]
ain memory lo k j mapped to any of
cache line. Cache line range is:
(j mod v)*k to (j mod v)*k + (k 1)
35.
[Ans. A]
As given n N
And the miss ratio will not be dependent
on associativity and k and LRU policy will
lead to n/N
36.
[Ans. 20]
No. of sets =
No. of Blocks =
[Ans. D]
Width of processor to main memory data
bus is independent of cache associativity
39.
[Ans. 10000]
For 1 store time required
= 100ns(because of overlape)
So in 1ns no. of stores =
In 1 ms no. of stores =
= 10000
40.
[Ans. 1.68]
Total instructions
= 100 instruction fetch operations
+60 memory operand read operations
+40 memory operand write operations
= 200 instructions (operations)
Time taken for fetching 100 instructions
(equivalent to read)
= 90 1 ns + 10 5 ns = 140 ns
Memory operand Read operation
time = 90%(60) 1ns +10%(60)5 ns
= 54 ns + 30 ns = 84 ms
Memory operand write operation
time = 90% (40)2 ns+10%(40)10 ns
=72 ns + 40 ns = 112 ns
Total time taken for execution 200
instructions = 140 + 84 + 112 = 336 ns
n
verage memory a e time
= 1.68 ns
k
lo k
38.
5
Word
offset
No. of Tag bits are 16 bits
Computer Organization
[Ans. D]
If a block size is smaller then less no. of
words will be replaced into cache from
main memory. So cache miss penalty will
be less.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 246
Computer Organization
Pipeline
CS - 2005
1.
A 5 stage pipelined CPU has the
following sequence of stages:
IF Instruction fetch from instruction
memory,
RD Instruction decode and register
read,
EX Execute: ALU operation for data and
address computation,
MA Data memory access for write
access, the register read at RD
stage it used,
WB Register write back.
Consider the following sequence of
instructions:
: L R0, Loc 1; R0 M [Loc 1]
: A R0, R0;
R0 R0 + R0
:S R2, R0;
R2 R2 R0
Let each stage take one clock cycle.What
is the number of clock cycles taken to
complete the above sequence of
instructions starting from the fetch of ?
(A) 8
(C) 12
(B) 10
(D) 15
2.
CS 2006
3.
A CPU has five-stage pipeline and runs at
1 GHz frequency. Instruction fetch
happens in the first stage of the pipeline.
A conditional branch instruction
computes the target address and
evaluates the condition in the third stage
of the pipeline. The processor stops
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 247
(A)
(B)
(C)
(D)
6.
7.
1 and 2 only
1 and 3 only
2 and 3 only
1,2 and 3
Computer Organization
CS - 2009
8.
Consider a 4 stage pipeline processor.
The number of cycle needed by the four
instructions I1,I2,I3,I4 in stages S1, S2,
S3, S4 is shown below:
S1
S2
S3
S4
I1
I2
I3
I4
CS - 2010
9.
A 5-stage pipelined processor has
Instruction Fetch (IF), Instruction
Decode (ID), Operand Fetch (OF),
Perform Operation (PO) and Write
Operand (WO) stages. The IF, ID, OF and
WO stages take 1 clock cycle each for any
instruction. The PO stage takes 1 clock
cycle for ADD and SUB instructions, 3
clock cycles for MUL instruction, and 6
clock cycles for DIV instruction
respectively. Operand forwarding is used
in the pipeline. What is the number of
clock cycles needed to execute the
following sequence of instructions?
Instruction Meaning of instruction
: MUL R , R , R
R R *R
: DIV R , R , R
R R R
: ADD R , R , R
R R +R
: SUB R , R , R
R R
R
(A) 13
(C) 17
(B) 15
(D) 19
CS - 2011
10. Consider an instruction pipeline with
four stages (S1, S2, S3 and S4) each with
combinational circuit only. The pipeline
registers are required between each
stage and at the end of the last stage.
Delays for the stages and for the pipeline
registers are as given in the figure
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 248
Stage S1 Delay
5ns
Stage S2 Delay
6ns
CS 2014
13. Consider a 6-stage instruction pipeline,
where all stages are perfectly balanced.
Assume that there is no cycle-time
overhead of pipelining. When an
application is executing on this 6-stage
pipeline, the speedup achieved with
respect to non-pipelined execution if
25% of the instructions incur 2 pipeline
stall cycles is ______________________.
14.
15.
CS - 2012
11. Register renaming is done in pipelined
processors
(A) as an alternative to register
allocation at compile time
(B) for efficient access to function
parameters and local variables
(C) to handle certain kinds of hazards
(D) as part of address translation
CS 2013
12. Consider an instruction pipeline with
five stages without any branch
prediction: Fetch Instruction (FI),
Decode Instruction (DI), Fetch Operand
(FO), Execute Instruction (EI) and Write
Operand (WO). The stage delays for FI,
DI, FO, EI and WO are 5ns, 7ns, 10ns, 8ns
and 6ns, respectively. There are
intermediate storage buffers after each
Computer Organization
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 249
Computer Organization
[Ans. B]
Clock cycles
1 2 3 4
5 6 7 8
I R E M W
F D X A B
I R M W
F D A B
IF R E
Total time
80
20
10 (
10
1+
100
100
= +
= 1.4 second
10
4.
M
D
W
A
3.
[Ans. B]
Time required by design D1
(100 + 5 1) 4 = 416nsec
Time required by design D2
(100 + 8 1) 2 = 214nsec
So time saved using design D2 =
416 214 = 202nsec
[Ans. C]
For 80% of 10 instructions a single cycle
is sufficient as there is no conditional
branch. For the rest 20%, one extra cycle
will be needed making the number of
cycles required to 3.
Total time will be computed as below
One cycle takes =
10
10
3)
[Ans. B]
Pipelined processor has four stages IF, ID,
EX, WB
Clock cycles
Instruction
1
ADD
1
SUB
3
MVL
Consider the following diagram
Clock cycles
R R +R
R R
R R
IF
ID
EX
WB
IF
ID
EX
IF
ID
EX
EX
WB
EX
WB
[Ans. D]
All statements 1, 2 and 3 are false for a
pipelined processor.
6.
[Ans. B]
For all delayed conditional branch
instruction the first instruction in the fall
through path is executed and evaluates to
true of false.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 250
7.
[Ans. B]
Instruction 2
occupy the delay slot
because
data
dependency
of
instruction 4
8.
[Ans. B]
By showing cycle vs stage data for each
instruction, it can be seen that the loop
takes 23 cycles.
9.
[Ans. B]
IF
1
1
1
1
11.
[Ans. C]
Register renaming is used to handle data
hazards.
12.
[Ans. B]
Given: Five stage instruction pipeline
delays for FI, DI, FO, EI and WO are
5,7,10,8,6ns resp.
To find: since the maximum time taken by
any stage is 10ns and additional 1 ns is
required for delay of buffer
Therefore total time for an instruction to
pass from one stage to another is 11ns
Now instructions are executed as follows
PO
O
PO
PO
PO
PO
PO
PO
PO
PO
PO
c o
Now when I4 is in its execution stage we
detect the branch and when I4 is in WO
stage we fetch I9 so time for execution of
instructions from I1 to I4 is
= 11 5 + (4 1) 11 =88 ns
And time for execution of instructions
from I9 to I12 is
= 11 5 + (4 1) 11 = 88 ns
But we have 11ns when fetching of 55 ns
because time for fetching I9 can be
overlap with WO of I4
Hence total times is
= 88 +88 11 = 165 ns
O
PO
PO
PO
PO
PO
O
PO
PO
PO
O
WO
PO
PO
PO
PO
PO
WO
PO
PO
PO
OW
15
14
13
12
11
10
9
8
4
WO
1
1
1
1
PO
3
6
1
1
No
c o T
P
c o T
Non pipeline Execution time
S1
+ S2
+ S3
+ S4
5 + 6 + 11 + 8 30
P
c o
(
)+
M
(5 , 6 , 11 , 8 ) + 1
M
11 + 1
12
c
30 12
2.5
OF
1
1
1
1
[Ans. B]
S
WO
MUL
V
A
SU
ID
1
1
1
1
10.
Computer Organization
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 251
13.
[Ans. 4]
S
1+(
c c
6
1 + (2
6
1+
14.
15.
6
3
o
5
+
)] T
c oc
P (0.8 + 0.12) 1
2
P 3.08
So
o
1.54
Q
2
[Ans. C]
Support n = 100 tasks. So time required
for processing 100 tasks in processors:
( +
(100 + 4 1)2
T
1)
206
( +
(100 + 4 1)1.5
T
1)
154.6
( +
(100 + 5 1)1
T
1)
104
( +
(100 + 5 1)1.1
T
1)
114.4
Best time = 104
[Here k = no.of stages,
c oc c c ]
[80 (1c oc )
+ 20
)
6
3 2
Computer Organization
16.
co
[Ans. 1.6]
1 cycle time P
[80 (1c oc )
+ 20
co
o
2
+
)] T
c oc
(0.8 + 0.6) 2.2
3.08
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 252
Computer Organization
Instruction Types
CS 2005
1.
Consider a three word machine
instruction ADD A[ ], @B
The first operand (destin tion) A [ ]
uses indexed addressing mode with R0 as
the index register. The second operand
(source) @B uses indirect ddressing
mode. A and B are memory addresses
residing at the second and the third
words, respectively. The first word of the
instruction specifies the opcode, the index
register designation and the source and
destination addressing modes. During
execution of ADD instruction, the two
operands are added and stored in the
destination (first oper nd). The number
of memory cycles needed during the
execution cycle of the instruction is
(A) 3
(C) 5
(B) 4
(D) 6
2.
MAR
S
IR
PC
GPRS
ALU
3.
4.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 253
CS - 2006
5.
Consider a new instruction named
branch-on-bit-set (mnemonic bbs). The
instruction bbsreg, pos, l bel jumps to
label if bit in position pos of register
operand reg is one. A register is 32 bits
wide and the bits are numbered 0 to 31,
bit in position 0 being the least
significant. Consider the following
emulation of this instruction on a
processor that does not have bbs
implemented.
temp reg and mask
Branch to label if temp is non-zero
The variable temp is a temporary register.
For correct emulation,the variable mask
must be generated by
(A) mask 0
pos
(B) mask 0 ffffffff>> pos
(C) mask
pos
(D) mask 0 f
6.
7.
Computer Organization
CS - 2007
Common Data for Q.8 , Q.9 & Q10.
Consider the following program segment.
Here R1, R2 and R3 are the general purpose
registers.
Instruction
Operation
Instruction
size
(no. of words)
) R1
MOV R1,(
2
[
]
LOOP:
[ ]
MOV R2, M[R3] R2
1
ADD R2, R1
R2
1
MOV ( ),
INC R3
DEC R1
BNZ LOOP
M [R3]
1
R3 R3 + 1
1
R1 R1 1
1
Branch on
2
not zero
HALT
`Stop
1
Assume that the content of memory
location 3000 is 10 and the content of the
register R3 is 2000. The content of each of
the memory locations from2000 to 2010
is 100. The program is loaded from the
memory location 1000. All the numbers
are in decimal.
Assume that the memory is word
addressable. The number of memory
references for accessing the data in
executing the program completely is
(A) 10
(C) 20
(B) 11
(D) 21
8.
9.
10.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 254
11.
CS - 2008
12. Which of the following is/are true of the
auto increment addressing mode?
1. It is useful in creating self relocating
code
2. If it is included in an Instruction Set
Architecture, then an additional ALU
is required for effective address
calculation
3. The amount of increment depends
on the size of the data item accessed
(A)
(B)
(C)
(D)
Computer Organization
1 only
2 only
3 only
2 and 3 only
13.
14.
CS - 2010
15. The program below uses six temporary
variables a, b, c, d, e, f.
a=1
b = 10
c = 20
d= a+b
e=c+d
f=c+e
b=c+e
e=b+f
d=5+e
return d + f
Assuming that all operations take their
operands from registers, what is the
minimum number of registers needed to
execute this program without spilling?
(A) 2
(C) 4
(B) 3
(D) 6
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 255
Computer Organization
CS - 2011
16. Consider a hypothetical processor with an
instruction of type LW R1, 20(R2), which
during execution reads a 32-bit word
from memory and stores it in a 32-bit
register R1. The effective address of the
memory location is obtained by the
addition of a constant 20 and the contents
of register R2. Which of the following best
reflects
the
addressing
mode
implemented by this instruction for the
operand in memory?
(A) Immediate Addressing
(B) Register Addressing
(C) Register Indirect Scaled Addressing
(D) Base Indexed Addressing
CS 2013
17. Consider the following sequence of micro
operations.
B
C
A
C
emor
B
Which one of the following is a possible
operation performed by this sequence?
(A) Instruction fetch
(B) Operand fetch
(C) Conditional branch
(D) Initiation of interrupt service
CS - 2014
18. A machine has a 32-bit architecture, with
1-word long instructions. It has 64
registers, each of which is 32 bits long. It
needs to support 45 instructions, which
have an immediate operand in addition to
two register operands. Assuming that the
immediate operand is an unsigned
integer, the maximum value of the
immediate operand is ____________.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 256
Computer Organization
2.
3.
[Ans. D]
ADD A [ ], @B
A [ ] uses index addressing mode as
follow such that
as the index register
Regs [ ]
Regs [ ] +Mem [Regs [B]
+Regs [ ].. ( )
And @B uses indirect as follow
ADD A [ ], @B
Regs [ ] Regs [ ] +
Mem [Mem[(B)]].. ( )
So the first instruction needed 3 memory
cycles and the second needed 2 and one
memory cycles in needed for writing the
result into the memory. So, total 6
memory cycles are needed to execute
ADD A [ ], @B
[Ans. A]
bbsreg,pos, label
temp reg and mark
Branch to label if temp is nonzero. If we
shift one position left by pos of 0x1 then it
evaluate the bbs instruction and
mask
1<<pos
6.
[Ans. D]
Content of register as program will be
execute are
= content of 1000
(1) = 1000 + 1 = 10001 memory address
=1
= content of 1000 (1)
= 1000 + 1
= 1001 memory address
Add I.
, 1000
[Ans. C]
A [I] = B[J] indexed,
While(*A++) Auto increment.
int temp =
Indired Addressing mode
),
store (
means store 20 in the
address value 1001
[Ans. B]
The sequence of microinstruction take
place in following cycles :
I. Cycle :
,
II. Cycle :
,T
III. Cycle :
,T ,A
,
3 cycles will be required to execute.
4.
5.
[Ans. B]
n
C
T
C
( C)
The sequence of microinstruction take
place in following cycles.
I cycle: C , , A
( A c n be lo ded with C )
II cycle:
,A
,
in
III cycle:
D
, C ( D
can be
performed once
A
has been
performed)
c cles will be required to e ecute.
7.
[Ans. B]
It does not allow indexing of array
element with same instruction.
8.
[Ans. D]
Given M[3000]=10
Instruction
[
[
[
]
]or [
Required Memory
Reference
1
10
10
Tot l
9.
[Ans. A]
The register
contain the memory
location 2010 whose value is 100 at the
end of loop BNZ loop
10.
[Ans. C]
Location
1000
1004
1008
1012
th
th
Operation
[
[
th
]
]
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 257
[ ]
1016
1020
So if an interrupt occurs during the
execution of the instruction INC 3 the
return address 1024 will be pushed onto
the stack.
(Address of next instruction)
11.
R2
R3
R3+R1
(f c e)
R3+R1
(b c e)
R2+R3
(e b f)
R3 5+R1
(d 5 e)
return (R2+R3) return (d + f)
Hence 3 registers needed only.
16.
[Ans. D]
LW R1, 20(R2) Instruction shows the
source address can be formed by adding
the constant with the R2 content. It is the
MIPS instruction. R2 points the base
address of an array and 20 points the
index address of an array. Hence the
addressing mode used for the above is
based indexed Addressing mode. This
addressing mode is used to implement
the arrays
17.
[Ans. D]
PC holds the value of next instruction to
be executed we store the value of PC to
MBR and then to memory. We are saving
the value of PC in memory and new
address value is loaded into PC.
This can be done only in interrupt service
option (D) is correct.
18.
[Ans. 16383]
Instruction format of 32 bit
Opcode
Reg
Reg
Immediate
1
2
operand
6 bit
6
6
14 bit
bit
bit
Opcode = 6 bit
(
5 intructions to support)
Reg 1, Reg 2 = 6 bit
(
no. of registers)
So, Immediate operand bits
= 32 (6 + 6 + 6) = 14
Max value to be represented by 14 bits
is =
[Ans. B]
All seven installations take 1 clock
cycles.
But 1 clock cycle latency needed b/w
load
R2, Loc 2, and Add R1, R2,1
lso, 2 clock cycles latency needed b/w
Mpy R1, R2, R1 and
store R3 ,Loc 3
S, 7 + 1 + 2 = 10
12.
[Ans. C]
The amount of increment depends on the
size of data item accessed
13.
[Ans. D]
A RFE (Return From Exception)
instruction contains a trap instruction,
privileged instruction and an exception
c nt be llowed to occur during the
execution of an REF instruction.
14.
[Ans. C]
The use of multiple register windows
with overlap causes a reduction in the
number of memory accesses for the
instruction fetches only.
15.
[Ans. B]
Register operations
(
b
(b
c
(c
R1+R2
(d
R3+R1
(e
)
)
)
c
Computer Organization
b)
d)
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 258
Computer Organization
3.
T2
I1
S1, S3,
S5
S2, S4,
S6
T3
S1, S7
I2
S1, S3,
S5
S8, S9,
S10
S5, S6,
S7
T4
S10
S6
T1
I3
S1, S3,
S5
S7, S8,
S10
S2, S6,
S9
I4
S1, S3,
S5
S2, S6,
S7
S5,
S10
S10
S6, S9
T5 S3, S8
S10
S1, S3
S10
Which of the following pairs of
expressions represent the circuit for
generating control signals S5 and S10
respectively. [Ij + Ik] Tn indicates that the
control signal should be generated in time
step Tn if the instruction being executed
is Ij or Ik ?
(A) S5 = T1 + I2. T3 &
S10 = (I1 + I3). T4 + (I2 + I4). T5
(B) S5 = T1 + (I2 + I4). T3 &
S10 = (I1 + I3). T4 + (I2 + I4). T5
(C) S5 = T1 + (I2 + I4). T3 &
S10 = (I2 + I3 + I4). T2 +
(I1 + I3).T4 + (I2+ I4). T5
(D) S5 = T1 + (I2 + I4). T3 &
S10 = (I2 + I3). T2 + I4. T3 +
(I1 + I3).T4 + (I2 + I4). T5
5.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 259
7.
8.
Computer Organization
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 260
Computer Organization
CS - 2012
15. The amount of ROM needed to implement
a 4 bit multiplier is
(A) 64 bits
(C) 1 kbits
(B) 128 bits
(D) 2 kbits
CS - 2013
16. Consider a hard disk with 16 recording
surfaces (0 15) having 16384 cylinders
(0 16383) and each cylinder contains
64 sectors (0-63). Data storage capacity
in each sector is 512 bytes. Data is
organized
cylinder-wise
and
the
addressing format is <cylinder no.,
surface no, sector no>. A file of size
42797 KB is stored in the disk and the
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 261
Computer Organization
[Ans. B]
Vectored interrupts are not possible but
multiple
interrupting
devices
are
possible.
2.
[Ans. A]
Memory mapped I/O requires that
memory locations and I/O ports share the
same set of addresses, so address bit
pattern that is assign to memory cannot
also be assigned to an I/O port and viceversa. I/O protection in this approach in
ensured by operating system macros and
routines.
3.
4.
5.
[Ans. B]
Data transfer rate = 10KB/sec
Total transfer = 25
Data transfer rate =
So perform gain = 25 %
[Ans. D]
Notice here that S5 have to be activated
on T1 for all instructions and for I2 and I3
on T3.
S10 have to be activated
for I2 and I4 on T5
for I1 and I3 on T4
for I4 on T3
for I2 and I3 on T2
[Ans. B]
Time takes for 1 rotation
= 60 sec = 3000 rotations
60/3000 sec= 1 rotation
In 1 rotation it reads
1/50 sec
? = 4 bytes
Time it takes to read 4 bytes = 153 ns
% of time CPU gets blocked
7.
[Ans. D]
For Constant Linear Velocity, density of
bits per track will increase as the head
moves towards outside of the disk.
So the disk capacity
= 10 + 20 + 30 + 40 + 50 + 60 + 70 +80
=360MB
For Constant Angular Velocity, density of
bits per track is uniform.
So the disk capacity = 10 8 = 80MB
8.
[Ans. A]
To move from 1st sector to 8th sector, the
distance
covered
by
head
=(8 1)/2=3.5cm
As head can move at 10m/s, the above
movement will take 3.5ms
After this movement head arrives at the
end of 5th sector. So to read 1MB data
from starting of 4th sector to ending of
[Ans. B]
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 262
[Ans. A]
No. of surfaces = 16
No. of track/sectors = 128
No. of sector/tracks = 256
Total size of disk
= 16
bytes
= 256 MB
Total no. of sectors in the disk
= 16
bytes
=
bytes.
So, 19 bits are needed.
10.
[Ans. B]
Statement (B) is not true because an ISR
(Interrupt Service Routine) is invoked on
before completion of I/O in synchronous
as well as in asynchronous I/O.
11.
[Ans. C]
By checking interrupt register after
finishing the execution of the current
instruction.
12.
[Ans. D]
Higher priority interrupt levels are
assigned to requests which, if delayed or
interrupted,
could
have
serious
consequences. Interrupt from CPU
temperature sensor would have serious
consequences if ignored. So it has the
highest priority.
13.
Computer Organization
14.
[Ans. B]
Time for one library
Rotational latency resolution time
6000 rpm = 10 ms, revolution = 5ms
100(10ms+5ms)= 100 15ms
= 1500 ms = 1.5 sec.
15.
[Ans. D]
=2 k bits
16.
[Ans. D]
[Ans. A]
Non pipelined system require
= (2+2+1+1+1)
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 263
Digital Logic
Sign bit
Excess 64
Exponent
CS -2006
6.
Consider numbers represented in 4-bit
gray code. Let h h h h be the gray code
representation of a number n and let
g g g g be the gray code of
(n + 1) (modulo 16) value of the number.
Which one of the following functions is
correct?
(A) g h h h h )
= , 2, 3, 6, 0, 3, 4, 5)
(B) g h h h h )
= (4, 9, 10, 11, 12, 13, 14,15)
(C) g h h h h )
= 2, 4, 5, 6, 7, 2, 3, 5)
(D) g h h h h )
= 0, , 6, 7, 0, , 2, 3)
7.
Mantissa
4.
5.
CS - 2007
8.
(C012.25)H (10111001110.101)B =
(A) (135103.412)8 (C) (564411.205)8
(B) (564411.412)8 (D) (135103.205)8
CS - 2008
9.
In the IEEE floating point representation
the hexadecimal value 0x00000000
corresponds to
(A) The normalized value 2
(B) The normalized value 2
(C) The normalized value + 0
(D) The special value + 0
10.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 264
11.
Digital Logic
CS - 2009
12. (1217) is equivalent to
(A) (1217)
(C) (2297)
(B) (028F)
(D) (0B17)
CS - 2010
13. P is a 16-bit signed integer. The 2s
complement representation of P is
87 ) . The 2s complement
representation of 8*P is
(A)
3 8)
(C)
878)
(B)
87 )
(D) 987 )
CS - 2013
14. The smallest integer that can be
represented by an 8- bit number in 2s
complement form is
(A) 256
(C) 127
(B) 128
(D) 0
CS - 2014
15. The base (or radix) of the number system
such that the following equation holds is
________
3 2
= 3.
20
16.
17.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 265
Digital Logic
2.
[Ans. A]
2s complement of a number represents
the negative number. If a number is n-bit
long the most significant digit is a sign bit
so starting from 2
because only n 1
place and addition of 1 and LSB we
represent the magnitude.
So the range is 2
to (2
)
including 0.
[Ans. A]
657) =
A
4
= 4A 8)
)
0 0
000 0 0
=
A
)
657) = A
3.
4.
[Ans. D]
The decimal number is 0.239 2
We
have
to
find
hexadecimal
representation without normalization.
Biased exponent = 13 + 64 = 77
Representing 77 in binary
77) = 00 0 )
Representing mantissa in binary
0.239) = 0.00
0 000 0
Floating point representation is an
follows:
Sign Exponent Mantissa
0
1001101 00111101
4
D
= 4 3 )
[Ans. D]
The decimal number is 0.239 2
We
have
to
find
hexadecimal
representation with normalization.
Binary representation of 0.239 is
0.00111101000101
is 0.00
0 000 0 ) 2
After
normalization
we
have
1.11101000101 2
Then, biased exponent = 10 + 64 = 74
5.
6.
[Ans. A]
34.4)
23.4) =
053.6)
[Ans. C]
Let b , b , b , b
are binary and
h , h , h , h , g , g , g , g as discussed in
Question then
b b b b
h h h h
g g g g
0 0 0 0
0 0 0 0
0 0 0 1
0 0 0 1
0 0 0 1
0 0 1 1
0 0 1 0
0 0 1 1
0 0 1 0
0 0 1 1
0 0 1 0
0 1 1 0
0 1 0 0
0 1 1 0
0 1 1 1
0 1 0 1
0 1 1 1
0 1 0 1
0 1 1 0
0 1 0 1
0 1 0 0
0 1 1 1
0 1 0 0
1 1 0 0
1 0 0 0
1 1 0 0
1 1 0 1
1 0 0 1
1 1 0 1
1 1 1 1
1 0 1 0
1 1 1 1
1 1 1 0
1 0 1 1
1 1 1 0
1 0 1 0
1 1 0 0
1 0 1 0
1 0 1 1
1 1 0 1
1 0 1 1
1 0 0 1
1 1 1 0
1 0 0 1
1 0 0 0
1 1 1 1
1 0 0 0
0 0 0 0
Now clearly g is high at position 0, so
option (A) is wrong, also g is high at
position 1, so option (B) is also wrong, for
g h , h , h , h )g is high at
g h , h , h , h ) = m 2,6,7,5,4, 2, 3, 5)
g h , h , h , h ) = m 2,4,5,6,7, 2, 3, 5)
Hence option (C) is correct answer.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 266
7.
[Ans. C]
Overflow condition is check with the
expression x yz yxz where x is MSB of
first number, y is MSB of second and z is
MSB of output (all in same size, 4 bit
here)
Here x =1
y=0&
z=0
So x yz xyz = 0
So no overflow will be there.
8.
[Ans. A]
0 2.2 5) = 400 22. 2)
0 0
00
0. 0 ) = 2 7 6 .5 )
40022. 2)
27 6.5)
= 35 03.4 2)
9.
[Ans. D]
Hexadecimal value 0x00000000 in binary
10.
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0
0
0
0
0
0
0
0
0
0
0
0
Checking options.
(a) 10
Sign = 1
0) = 0 0 = .0 0 2
The exponent is biased by 2
,
where e is the number of bits used
for the exponent field which is 8.
2
= 27
For the 32 bit IEEE 754 format, the
bias is + 127 and so 3 + 127 = 130.
In binary (130) is encoded as 1 0 0
00010.
Thus, it is not equal to exponent field.
(b) 13
Sign = 1
3) = 1101 = 1.101 2
3
27 = 30
Hence 30) = 00000 0 exponent
(c) 26
26) = 0 0 = . 0 0 2
27 4 = 3 and 3 )
= 00000
But fraction part does not match
[Ans. D]
r
)
2r
)= r
)
2 =
)
)
r
2r
= r
r
2r
=r
2r
Given equation will satisfy for every vale
of r, however with radix r = 2 we cannot
have sign 2 in it. So answer is r > 2.
11.
[Ans. D]
sign Exponent
1
1
0
0
0
0
0
1
1
12.
Fraction
1
0
1
0
0
0
0
0
0
0
0
0
Digital Logic
[Ans. B]
2 7) = 028 )
(1
001
2
13.
th
1 7)8
001
010
8
111
F
[Ans. A]
2s complement of P is given as
2s complement of 8 P = 2
th
th
87 )
87 )
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 267
000
8)
14.
[Ans. B]
Range of 2s complement number is for n
bit is from
2 ) to 2
) so
smallest number is 2
= 2 =
28
15.
[Ans. 5]
Given
3 2)
= 3. )
20)
3r
r 2
=r
2r
3
r
=r
2
2 r
r 5
=
2 2
r=5
16.
3
3
So binary representation is
1100
C
0001
1
0110
6
0100
4
0000
0
0000
0
0000
0
0000
0
0
0
Digital Logic
r
r
[Ans. 3]
Given 23) = x 8)
5
2 5 3 5 ) = x y 8)
38 = xy 8
xy = 30
So possible combination of (x, y) are
(1, 30); (2, 15); (3, 10); (5, 6); (6, 5);
(10, 3); (15, 2); (30, 1)
However 8 is a symbol in base y, so y
must be > 8. So that means only three
combination of (x, y) are only possible.
17.
[Ans. A]
4.25
Sign bit = 1
4.25
= .78 25
2
So exponent = 3 + 127 (biased)
= 30)
= 00000 0)
antissa = 0.78 25 = 00
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 268
Digital Logic
2.
CS - 2006
3.
Consider a Boolean function f(w, x, y, z).
Suppose that exactly one of its inputs is
allowed to change at a time. If the
function happens to be true for two
input
vectors
i
w x y z
n i
w x y z
w would like
the function to remain true as the input
changes from i to i i n i differ in
exactly one bit position), without
becoming false momentarily. Let
f(w, x, y, z,) = (5, 7, 11, 12, 13, 15).
Which of the following cube covers of
f will ensure that the required property
is satisfied?
(A) w
x z w x y x yz x y z w y z
(B) w x y , w
xz wyz
(C) w x ,
y z x z, w x y z
(D) w z y, w y z, w
x z x y z x y z
4.
5.
The
Boolean
function
for
a
combinational circuit with four inputs is
represented by the following Karnaugh
map.
PQ
00
01
11
10
00
01
11
10
RS
7.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 269
8.
Digital Logic
Let f(w, x y z)
0 4 5 7 8 9 13 15).
Which of the following expressions are NOT
equivalent to f?
(P) x y z + w x y + w y z + x z
(Q) w y z + w x y + x z
(R) w y z + w x y + x y z + x y z
(S) x y z + w x y + w y
(A) P only
(C) R and S
(B) Q and S
(D) S only
9.
)
c
11.
+
+
Which of the following Karnaugh Maps
correctly represents the expression?
)
CS - 2008
12. In the Karnaugh map shown below, X
denotes
ont r t rm. Wh t is th
minimal
form
of
the
function
represented by the Karnaugh map
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 270
ab
cd 00
00 1
01
11
10
(A)
(B)
(C)
(D)
13.
01
1
11
10
1
X
X
1
. +
. +
. +
. +
.
. + . .
. .
. + .
f3
f
m 45678)
f
m 1 6 15)
f
m 1 6 8 15)
Then f is
(A) m 4 6)
(C)
(B)
m 4 8)
(D)
14.
15.
m 6 8)
m 4 6 8)
Digital Logic
CS 2010
16. The minterm expansion of
f (P, Q, R) = PQ + Q + P is
(A) m + m + m + m
(B) m + m + m + m
(C) m + m + m + m
(D) m + m + m + m
CS - 2011
17. The simplified SOP (Sum Of Product)
form of the Boolean expression
(P+ + ).(P+ +R). (P+Q+)
(A) (. + )
(C) (. + )
(D) (P.Q+R)
(B) (P+ . )
CS - 2012
18. The truth table
X
Y
f(X, Y)
0
0
0
0
1
0
1
0
1
1
1
1
represents the Boolean function
(A) X
(C)
(B) X + Y
(D) Y
CS - 2013
19. Which one the following expressions
does NOT represent exclusive NOR of
x and y ?
(A) xy + x y
(C) x
y
(B) x y
(D) x
y
CS - 2014
20. Consider
the
expression for F:
following
Boolean
F(P, Q, R, S) = PQ +
+
The minimal sum-of-products form of F is
(A) PQ + QR + QS (C) + + +
(B) P + Q + R + S (D)
+
+
21.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 271
(A) 2
(B) 2
22.
23.
Digital Logic
Consider
the
following
minterm
expression for F:
)
0 2 5 7 8 10 13 15
Th mint rms 2 7 8 n 13 r o not
r t rms. Th minim l sum of
products for F is
L t
not th Ex lusiv O
O )
op r tion. L t 1 n 0
not th
binary constants. Consider the following
Boolean expression for F over two
variables P and Q:
)
))
( 1 )
)
0))
The equivalent expression for F is
(A) P + Q
(C) P Q
(A)
(B)
(B)
(C) 2
(D) 2
(C)
(D)
(D)
[Ans. A]
f(A, B, C, D) = (1, 4, 5, 9, 11, 12)
The K map for f is
CD
00
AB
01
00
10
01
4.
[Ans. D]
A is true statement
f x x x )
x f x x x )+x f x x x )
f x x x ) x +x )
f x x x )
Similarly B is also true
To prove (C) and (D)
Let f x x x ) x + x + x
Then (C) f x x x ) x + x + x
x x + x + 0) + x x + x + 1)
x x +x )+x
x x +x x +x
x +x +x
f x x x )
So (C) can be true, let check for D
f x x x ) f 0 x x )+ 1 x x )
0+x +x )+ 1+x +x )
=1
f x x x )
It is not true, and we know that if a
statement is not true even for one
om in tion it
nt
g n r l
statement
1
1
11
10
11
2.
[Ans. C]
Total no. of distinct multiple stuck at
faults in a circuit with N lines is 2
1.
3.
[Ans. A]
f (w, x, y, z) = (5, 7, 11, 12, 13, 15)
Draw the K map
yz
10
wx
00
01
11
10
01
1
11
10
1
1
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 272
5.
[Ans. D]
RS
7.
01
11
10
00
01
11
10
So
6.
8.
[Ans. A]
Consider a simple method let w = 1,
x = 1, y = 1, z = 1 then the value of f is 1.
Consider each statement
(P) x y z + w xy + wy z + xz
=000+010+101+11=1
(Q) w y z + wx y + xz
000+100+11=1
(R) w y z + wx y + xyz + xy z
=000+100+111+101=1
(S) x y z + wx y + w y
=000+100+01=0
So statement (S) is false because w = 1,
x = 1, y = 1, z = 1 the value of f is 0. (S)
is not contain the essential minterms.
So option not containing S is answer
which is option (A)
9.
[Ans. D]
PQ
00
[Ans. C]
Let the binary constant be the value of
the function f(x x x ) for the
combination of variables whose decimal
code is i. Then every switching function
can be expressed in form.
f (x x . x ) = x x x +
x x x + + x x x .
A factor
is either 0 or 1 if the
corresponding minterm is contained in
canonical form of the function. Then
there are r = 2 coefficients each of
which can have values either 0 or 1
hence
there
are
2
possible
assignments.
+
Z = X*Y
y +
from eq. (i)
P:X=
= YZ +
by eq.(i)
=Y(XZ + X Z ) + Y Z
= XYZ + X YZ + Y Z
Q:Y=
Y = XZ + X Z by eq.(i)
Y =XZ + X Z
R:
= 1 if we will take the truth
table for P, Q, R, then all are valid
formulas
[Ans. B]
Given
f(w, x, y, z) = (1, 3, 4, 6, 9, 11, 12, 14)
Corresponding K map for f is
yz
00
wx
00
01
11
10
10.
[Ans. A]
a
00
+
01
00
01
11
10
cd
01
11
10
ab
1
1
Digital Logic
+
11
10
1
1
f(w, x, y, z) = xz + x z
So f (w, x, y, z) is independent of two
variables w and y.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 273
11.
[Ans. A]
Option (A) does not correspond to Kmap option in question 10.
+
16.
Digital Logic
[Ans. A]
+
12.
[Ans. A]
The K-Map is
( + )+( + )
+
ab
00
01
00
01
cd
11
11
17.
+ )
+ )
15.
+
+
100)
+ )
)
+ )
+ )
+ )
+
14.
(( + ) +
1
+ )
[Ans. B]
+
+
+
+
111) 110) 010)
m +m +m +m
13.
10
10
[Ans. C]
f and f are connected with AND gate so
when f = m(6, 8) then f is true for
m (1, 6, 8, 15)
[Ans. A]
+ )
+ )
+ )
)
+
+
+
+
)
+
+
+ )
(
+
1 + ))
+ )
+ )
+ )
+
1+ )
[Ans. A]
f (A, B, C, D =
18.
X
0
0
1
1
01
11
19.
01
y)
xy + x y)
x + y) x + y ))
x y + xy . i)
Option (A): is same as (i)
Option (B): x y
x y + xy same as (i)
Option (C): x
y xy + x y same as (i)
Option (D): x
y
x y + xy not same
as (i)
Option (D) is not correct.
10
10
[Ans. D]
Exclusive NOR of x and y (x
(x
00
11
f(X, Y)
0
0
1
1
( + )
00
Y
0
1
0
1
CD
AB
[Ans. A]
y)
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 274
20.
Digital Logic
[Ans. A]
K-map for given expression
RS
PQ
00
00
01
01
11
11
10
10
QS
PQ
QR
21.
[Ans. D]
A function F is self dual if it has equal
number of minterms and maxterms, also
mutually exclusive term should not be
included.
The number of mutually exclusive terms
(pair wise) is
2
Number of function possible by taking any
of the one term from the above mentioned
mutually exclusive pair is = 2
22.
[Ans. B]
RS
PQ 00 01 11 10
x
00 1
01
1 x
x 1
11
QS
10 x
23.
[Ans. D]
1 )
)
)
)
{ 1
)
)
0) {
0)
1
0
{
1
0
+
)
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 275
Digital Logic
Logic Gates
CS 2005
1.
A two-way switch has three terminals a, b
and c. In ON position (logic value 1), a is
connected to b, and in OFF position, a is
connected to c. Two of these two way
switches S1 and S2 are connected to a
bulb as shown below.
b
a
c
Switch
c S1
c
Switch
S2
c
CS - 2007
4. The following expression was to be realized
using 2 input AND and OR gates. However,
during the fabrication all 2 input AND
gates were mistakenly substituted by
2 input NAND gates.
(a. b).c + (.c).d + (b.c).d + a.d
What is the function finally realized?
(A) 1
(B) + + +
(C) + b + +
(D) + + c +
Bulb
X4
(C) ABC + (B C) + (A C)
X3
CS - 2009
6. What is the minimum number of gates
required to implement the Boolean
function (AB + C) if we have to use only
2-input NOR gates?
(A) 2
(C) 4
(B) 3
(D) 5
1
f
(C) OR, OR
(D) OR, AND
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 276
CS 2010
7. What is the Boolean expression for the
output f of the combinational logic circuit of
NOR gates given below?
P
Q
Q
R
R
RP
R
R
Q
R
R
R
R
(A)
(B)
(C)
(D)
CS 2011
8. Which one of the following circuits is NOT
equivalent to a 2-input XNOR (exclusive
NOR) gate?
(A)
Digital Logic
CS 2014
10. 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) Multiplexer
(D) Flip-flop
(B)
(C)
(D)
CS - 2012
9.
What is the minimal form of the Karnaugh
map shown below? Assume that X
enotes ont re term
(A)
(B)
(C) +a
(D) +
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 277
Digital Logic
2.
(
(
(
[Ans. C]
Either both ON or OFF i.e.
[Ans. C]
Given (
(
)
)
))
)
[Ans. C]
( )
( )
( )
Replace AND gate with NAND gate,
(
)
(
)
(
)
So A is false (not correct option)
)(
(B) (
)
)(
(
(
)
So option C is correct
( )
)
(
)
So B is false (not correct option)
(
)
(C)
(
)
3.
)
4.
Now (A),
(
)(
5.
)
)
[Ans. D]
X1
X2
X3
X2
X3
[Ans. D]
f=
where
()
( )
( )
Now we know a 3 variable majority
circuit is given as
( )
Now on comparing, we get that there is
no on actual expression, so we have to
eliminate from equation (i) we know
that
X4
X3 X4
X3
X3
X4
X4
X4
X3 X4
X4
(
)
So the eliminate , Q must also be present
in P and in addition P must contain some
other terms so by observation option A, B
& C are eliminated
Now option (D)
(
)
X4 +
y
1
But both
n
c nt o ur t s me t me so none o these
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 278
6.
(B)
[Ans. B]
= AB + C
= (A + C) (B + C)
((
)
(
))
(
A
C
Digital Logic
(C)
(D)
((
B
C
7.
) +(
[Ans. A]
(P + Q) (Q+R) = Q+RP
)(
)
(
Q
Q
pt on
s not
9.
[Ans. B]
ab
00
01
11
10
00
01
cd
Q
(P + R) (Q+R) = R+PQ
(
(
11
)
10
C=
8.
( )
[Ans. D]
(A)
x
y
10.
[Ans. C]
output ne
nput nes
)(
)
se e t ne
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 279
Digital Logic
z
Which one of the following is TRUE?
(A) f is independent of x
(B) f is independent of y
(C) f is independent of z
(D) None of x, y, z is redundant
[Ans. D]
The given circuit is
x
+ yz
y
z
f = x + yz
)
=x (
=x
K map:
) [
= 1]
yz
x
00
01
0
1
11
10
1
1
(
)
So none of x, y, z is redundant.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 280
Digital Logic
3.
4.
A
X
Q
CLK
A
B
Clock
Clock
A
1
0
0
B
0
0
1
C
1
1
0
(B)
1
1
1
0
1
1
1
0
1
(C)
0
1
1
1
0
1
1
1
1
(D)
0
1
1
0
1
1
1
0
1
(A)
CLK
5.
(B) 0011
(C) 00100111
0
1
(D) 00110110
0
0z
(A) 1, 0, B
(B) 1, 0, A
th
th
(C) 0, 1, B
(D) 0, 1, A
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 281
CS - 2006
6.
You are given a free running clock with a
duty cycle of 50% and a digital waveform
f which changes only at the negative edge
of the clock. Which one of the following
circuits (using clocked D-flip-flops) will
delay the phase of f by 180 ?
(A)
D
8.
Given
Digital Logic
two
three
bit
numbers
and c, the carry in,
the function that represents the carry
generate function when these two
numbers are added is
(A)
+
+
+
+
+
+
(B)
D Q
(C)
+(
(
) (
(D)
+
+
clk
(B)
D Q
D Q
f
g
clk
9.
D Q
D Q
D Q
(D)
(C) c
(D)
clk
7.
MUX
1
y
z
0
1
MUX
f
+
+
c
c
CS - 2007
10. How many 3-to-8 line decoders with an
enable input are needed to construct a
6-to-64 line decoder without using any
other logic gates?
(A) 7
(C) 9
(B) 8
(D) 10
11.
x
y
(A) xz + xy + yz
(B) xz + xy +yz
clk
+
+
)[
)]
We co si er the
itio of two 2s
complement numbers
(C)
f
(C) xz + xy + yz
(D) xz + xy + yz
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 282
(A)
(B)
(C)
(D)
12.
2 i e to 1 i
2
i e to 1
2
i e to 1
2
i e to 1
e
i e
i e
i e
where
is the input carry. Consider a
two-level logic implementation of the
look-ahead carry generator. Assume that
all
are available for the carry
generator circuit and that the AND and
OR gates can have any number of inputs.
The number of AND gates and OR gates
needed to implement the look-ahead
carry generator for a 4-bit adder with
as its outputs are
respectively
(A) 6, 3
(C) 6, 4
(B) 10, 4
(D) 10, 5
Clear to
0
No
change
Load
input
Count
next
Count = 1
Load = 0
Clock
Clear
0
Inputs
1
ab
4-bit counter
Clear
13.
Digital Logic
15.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 283
16.
101101
+
1 1
20.
XOR
(A) 0110
(B) 1011
Digital Logic
(C) 1101
(D) 1111
R
R
CS - 2008
17. What Boolean function does the circuit
below realize?
(A)
(B)
(C) P + Q + R
(D)
z
3 to 8
y
f (x, y, z)
Decoder
(A) xz + x z
(B) xz xz
18.
CS - 2011
Common data for questions 21 and 22:
Consider the following circuit involving
three D-type flip-flops used in a certain
type of counter configuration.
(C) x y + yz
(D) xy + y z
D Q
clock
CS - 2010
19. In the sequential circuit shown below, if
the initial value of the output
is 00,
what are the next four values of
?
1
D Q
21.
Clock
(A) 11,10,01,00
(B) 10,11,01,00
clock
clock
(C) 10,00,01,11
(D) 11,10,00,01
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 284
22.
23.
(A)
(B)
(C)
(D) PQ
26.
CS - 2013
24. In the following truth table, V = 1 if and
only if the input is valid.
Inputs
Outputs
V
0
0
0
0
x
x
0
1
0
0
0
0
0
1
x
1
0
0
0
1
1
x
x
1
0
1
0
1
x
x
x
1
1
1
1
What function does the truth table
represent?
(A) Priority encoder
(B) Decoder
(C) Multiplexer
(D) Demultiplexer
Digital Logic
Let
2 . A circuit is built by giving the
output of an n bit binary counter as
input to an
to 2 bit decoder. This
circuit is equivalent to a
(A) k bit binary up counter.
(B) k bit binary down counter.
(C) k bit ring counter.
(D) k bit Johnson counter
CS - 2014
25. Consider the 4 to 1 multiplex with two
select lines and given below
0
1 4 to 1
Multiplexer
2
3
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 285
Digital Logic
[Ans. A]
Let initially Q =
Now
5.
[Ans. D]
x x
Given x = 1 1 0 1 1 0
Clock = 0 1 2 3 4 5 and
A=
Then
Clock A
D
P=A +B
C = xP + y
x(
x(
)
)
y
NS
11
01
10
00
11
01
[Ans. D]
Upcounter will go upto its highest count
first then it will start from clear and go
upto required value so from
1 0 1 0 1 1 0 0 to 1 1 1 1 1 1 1 1
3
then from
1 1 1 1 1 1 1 1 00000000
0 0 1 0 0 1 1 1 40
So total = 83 + 40 = 123
[Ans. A]
A B C
P(let)
x
x
y
Also given (required)
[Ans. D]
00
11
01
10
00
11
4.
3.
1
3
2.
rom optio
)
Put x = 0, y = 1 & = A
0
Which is required
So correct option is (D)
Z
1 0 1 1
0
0 0 1 0
1
0
0
0 1 0 1
0
1
1
We got answer with first option no need
to check for other options.
6.
[Ans. B]
Hint: Invertor provides 1 0 phase
FF with Q output 360 or 0
FF with output gives 1 0 phase
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 286
7.
[Ans. A]
9.
[Ans. C]
B=
A=
S=c c
c
The over flow condition V
V=
c
c
c
is c so
V=c
c
So the over flow condition is
c
c
10.
[Ans. C]
For the construction of a 6 64 decoder
by using 3 8 line decoder
x
0
1
y
0
1
x
y
Let the output of first uppermost Mux is f
f
xz
yz
The output of second Mux is
f = (xz
y z)y
xy
= xy z
y y z xy
= xy z + y z xy
[
= y z xy z
xy z z ) [a + = 1]
= y z xy z
xyz xyz
= y z xy z + xyz
xyz
xyz
[a + a = a]
= y z + xz y
y) xy z
z)
= y z xz
xy [a + = a]
= xz
xy y z
8.
[Ans. D]
Consider
38
11.
[Ans. C]
To implement n variable function, we
require a data selector with n 1 select
inputs and 2
data inputs. So minimum
size of multiplexer needed is 2
line to
1 line
12.
[Ans. B]
A 4-bit adder with
and
as
its output require 2 1 bit adder and a
single one bit adder require 5 AND gates
and 2 OR gates in two level logic. So the
required gate are 10 AND gate and 4 OR
gates.
13.
[Ans. D]
If load = 0 and count = 1 then counter
count the sequence 0000, 0001, 0010,
0011, 0100, 0101, 0000 in decimal if
count 0, 1, 2, 3, 4, 5 and then 0 and repeat
the sequence. After 0101 clear = 1
So again 0000 as count output.
14.
[Ans. A]
1
1 or
1 or
1
1 or
1
So the statement (D) generate a carry c
always
the result 6 64
and
000
000
001
001
010
010
011
011
100
100
101
101
110
110
111
111
So the carry c will be generated if
Digital Logic
th
th
th
ab
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 287
So, a.b = (a + b ) +
If = b, = 0, = a
then RHS = (a . b + b . ) a + 0 .
=a.b.a
=a.b
15.
Digital Logic
xyz
xyz
x yz
z
3 8
decodes
xy z
xy z
xy z
[Ans. B]
xyz
xyz
= xz
= (x z ) xz)
= (x + z) (x
z)
= xx
xz
x z zz
= xz
xz
S R
1 1
1 0
0
0 1
1
0 0 Invalid
Now since 00 leads to invalid state it
cannot lead to an oscillation
So (A) & (D) are wrong options
In both option B & C oscillation will occur
but in option (C) oscillation will start after
one clock cycle however in option (B)
oscillation will state with first clock cycle
so B is more correct answer
16.
[Ans. A]
Clock
0
1
2
3
4
5
6
18.
Output
0110
1011
1101
0110
1011
1101
0110
101101
+
So option A
17.
xz)
[Ans. B]
f
xyz
x yz
xy z xyz
=x z y
y) xz y y )
= x z 1) xz 1)
=x z
xz
[Ans. B]
ooths gorithm requires ex mi tio
of the multiplier bits and shifting of the
partial product. Prior to the shifting, the
multiplicand may be added to the partial
product, subtracted from the partial
product or left unchanged according to
the following rules.
1. The multiplicand is subtracted from
the
partial
product
upon
encountering
the
first
least
significant 1 in a string of 1s i the
multiplier.
2. The multiplicand is added to the
partial product upon encountering
the first 0 i
stri g of 0s i the
multiplier.
3. The partial product does not change
when the multiplier bit is identical to
the previous multiplier bit.
As in multiplier we see that a change
occurs in bit as 0 changes to 1 and 1
changes to 1.
Multiplier:
0111
0111
1011
1101
1 1
f=f
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 288
19.
[Ans. A]
Clock to next flipflop is by Q and +ve edge
trigger so it will be a down counter
After
After
After
After
20.
Initial
1st Clock
2nd Clock
3rd Clock
4th Clock
26.
[Ans. C]
Values of J and K in each flip flop from
left to right will be
J = 1, 0, 0
K = 0, 1, 1
According to these inputs
will be
100
Now based on new outputs J K will be
J = 1, 1, 0
K = 0, 0, 1
And
will be 110
Now new J K
J = 1, 1, 1
L = 0, 0, 0
And
will be 110
27.
[Ans. C]
0
1
0
1
0
[Ans. B]
(
21.
0
1
1
0
0
)
)
[Ans. D]
)
f
)
)
Digital Logic
n - bit
binary
counter
0 1 0) the ext st te
0 1 1)
2
bit
decode
r
1
)
22.
[Ans. B]
There are four distinct states.
000 010011100 000)
23.
[Ans. A]
Mod 258 counter has 258 different states.
So minimum number of bits required
each state is ceiling of og 25
, each
of which requires one flip-flop.
24.
[Ans. A]
Truth table given represent the priority
encoder i.e, 4 2 priority encoder V = 0
indicates output is invalid and V = 1
indicates output is valid
25.
[Ans. A]
0
(
1
)
So answer
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 289
DMGT
Mathematical Logic
CS - 2005
1.
What is the first order predicate calculus
statement equivalent to the following?
Every teacher is liked by some student
( )
(A) ( ),
( ),
( )
( )-]
(
),
(
)
(B)
( ),
( )
( )-( )
(C) ( ) ( ),
( )
( )-,
( )
( )
(D) ( ),
( )
( )-,
2.
3.
5.
(D) .
(
( ( ))/
( ( )
(B)
[(
( )
( ))
( )
{(
( ))
( )}]
(C)
[(
(D)
[(
*(
6.
( )
( )
( ))
(
( ))}]
( )
( )
( )+]
( )
( ))
( ))
( )))
( )))
CS - 2006
4.
Consider the following propositional
statements:
P1: ((A B) C) ((A C) (B C))
P2: ((A B) C) ((A C) (B C))
Which one of the following is true?
(A) P1 is a tautology, but not P2.
(B) P2 is a tautology, but not P1.
(C) P1 and P2 are both tautologies
(D) Both P1 and P2 are not tautologies
( ))
( )}]
( )
{(
CS - 2007
7.
Which of the following is TRUE about
formulae in Conjunctive Normal Form?
(A) For any formula, there is a truth
assignment for which at least half the
clauses evaluate to true.
(B) For any formula, there is a truth
assignment for which all the clauses
evaluate to true.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 290
9.
DMGT
13.
CS - 2008
10. P and Q are two propositions. Which of
the following logical expressions are
equivalent?
1)
2)
(
)
3) (
) (
) (
)
4) (P Q) (P ~Q) (~P Q)
(A) Only 1 and 2
(B) Only 1, 2 and 3
(C) Only 1, 2 and 4
(D) All of 1, 2, 3 and 4
CS - 2009
14. Consider the following
formulae:
i.
x P x
11.
15.
ii.
xP x
iii.
x P x
iv.
xP x
well-formed
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 291
))
))
(A)
(B)
(C)
(D)
16.
CS 2010
17. Suppose the predicate F(x, y, t) is used to
represent the statement that person x can
fool person y at time t. Which one of the
statements below expresses best the
meaning of the formula
(F(x, y, t))?
(A) Everyone can fool some person at
some time.
(B) No one can fool everyone all the time.
(C) Everyone cannot fool some person
all the time.
(D) No one can fool some person at some
time.
CS - 2011
18. Which of the following option is correct
given three positive integers x, y and z,
and a predicate
P(x) = (x = 1) y ( z(x = y * z)
(y = x) (y = 1))
(A) P(x) being true means that x is a
prime number
(B) P(x) being true means that x is
number other than 1
(C) P(x) is always true irrespective of the
value of x
(D) P(x) being true means that x has
exactly two factors other than 1 and x
DMGT
CS - 2012
19. Consider the following logical inferences.
I1: If it rains then the cricket match will
not be played
The cricket match was played
Inference: There was no rain
I2: If it rains then the cricket match will
not be played
It did not rain
Inference: The cricket match was played
Which of the following is True?
(A) Both I1 and I2 are correct inferences
(B) I1 is correct but I2 is not correct
inference
(C) I1 is not correct I2 is a correct
inference
(D) Both I1 and I2 are not correct
inference
20.
(A)
(
( ) rational(x))
(B)
(
( )
( ))
(C)
(
( ) rational(x))
(D)
(
( ) real(x))
CS - 2013
21. Which one of the following is NOT logically
( ))?
equivalent to ( ( )
(A)
( ( )
( ))
(B)
( ( )
( ))
(C)
( ( )
( ))
( ))
(D)
( ( )
22.
(B)
(C)
(D)
th
th
(F( )
( ))
( ))
( ))
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 292
DMGT
CS - 2014
23. Consider the statement
N
25.
26.
27.
(A)
(
( )
C ( ))
(B)
(
( ) C ( ))
(C)
(
( ) C ( ))
(D)
(
( )
C ( ))
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 293
DMGT
[Ans. B]
E
b
m
:
then
the
logical
expression
is
(x)[teacher (x)
(y) [student ( )
( )-Where likes (y, x) means y likes x, such
that y represent the student and x
represents the teacher.
2.
[Ans .B]
X: (
)R
Y: (P ) ( R)
X: P + QR (P+Q) + R P Q + R
Y: (P +R) + (Q + R) P + Q + R
Clearly XY
Consider XY
(P Q + R)(P + Q + R)
(P Q + R) + P + Q + R
(P Q ) .R + P + Q + R
(P + Q).R + P + Q + R
PR + QR + P + Q + R
(PR + R) + (QR + Q ) + P
(P + R) (R + R) + (Q + Q ) (R + Q ) + P
(P + R) + (R + Q ) + P
P + P + R + R + Q
1+1+ Q
1
XY is a tautology
3.
[Ans. A]
4.
[Ans. D]
: ((A B) C) ((A
LHS:
(A B) C
AB C
(A B)
C
A
B
C
RHS:
(A C) (B C)
(A + C) (B + C)
AB+C
C
LHS HS
C)
is not a tautology
: ((A B) C) ((A C) (B C))
LHS ((A+ B) C)
(A B)
C
AB
C
HS (A C) (B C)
(A
C)
(B
C)
A
B
C
C
LHS HS
is also not a
tautology
Therefore both
and
are not
tautologies. Correct choice is (D).
5.
[Ans. D]
T
m
b
I
an animal is a tiger or lion, then (if the
animal is hungry or threatened, then it
will attacks). Therefore the correct
translation is
( )
( ))
[(
( )
{(
Which is choice (D)
( ))
( )}]
6.
[Ans. D]
By using min terms we can define
A B AB AB
AB
A AB
(A A ). (A B )
A B
(A) A B A
B A B
(B) (A
B) (A B )
(A (B ) )
(A B)
AB
(C) ( A
B) (A
B)
(A (B ) )
(A B)
AB
(D) ( A B) (A
B)
(A B )
A. B A B
(D) A B
7.
[Ans. D]
In conjunctive normal form, for any
particular assignment of truth values, all
except one clause, will always evaluate to
true, So (D) is correct answer
(B C))
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 294
8.
[Ans. A]
T
N
m
T
10.
[Ans. A]
When ( ( )) FALSE, then the
formula
( ( ( ))
F: ( ( )
( ))
(
)))becomes
( (
TRUE. If
( ( )) TRUE and
( ( )
( )) TRUE, then
( ( )) TRUE, and
F TRUE. Hence formula F is valid.
[Ans .B]
(
)
(
) (
(
(
(
)
(
) (
(
(
)
.
) (
) (
)
(
)
)
)
(
) (
(
( )
(
representation.
m
which is
w
the same as
*
( )
( )+
Which is choice (B)
Alternate solution
We can translate the given statement
N T (
)
(
( )
( ))
(
( )
( ))
(
( )
( ))
(
( )
( ))
Which is choice (B)
9.
( ))
(
m
DMGT
12.
[Ans. D]
[
, x,
)) is the logical
))]
))]
( u, v, ))]
13.
[Ans .C]
( ))
- ,
Consider ,(
( )
( )) is FALSE, then
If (
( )
is
TRUE, and hence the entire statement is
( )) is TRUE and
TRUE. If (
,(
- is TRUE, then is TRUE,
( ))
and hence the entire statement is TRUE.
14.
[Ans .B]
( )
( )
& iv ( ( ))
Clearly, choices i and iv are equivalent.
ii
( )
( )
and iii , ( )( )
Clearly ii & iii are not equivalent to each
other or to i & iv.
15.
[Ans. D]
T
m
((G( )
w
)
)
( ))
S( ))
(D)
m
. N w
given ornament cannot be both gold and
silver at the same time.
Choice (B)
((G( ) S( ))
( )) is
incorrect.
)
)
[Ans. A]
F
w
fsa, there exists a y
which is a pda and which is equivalent to
.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 295
[Ans. A]
17.
T
F
F
20.
[Ans. C]
Some real numbers are rational
( )
,
( )-
21.
[Ans. A and D]
( ))
( ( )
(
, ( )
(
)
,
, ( )
(
,
, ( )
(
(
,
)
(
T
T
T
F
F
T
F
F
~Q
~P
18.
[Ans. A]
The given statement reads,
P(x) is true whenever x is not 1 and for
every y, if there is a z such that x = y*z,
then either x = y or y = 1
In other words, P(x) is true whenever x is
prime.
19.
[Ans. B]
Let p : It rains
q : cricket match will not be played
I :
[Ans. B]
(F(
))
(
F(
)), which means
there does not exist a person who can fool
every one at all times.
Which corresponds ,
) -
,(
,
-
( )
T
F
T
I :
P Q
~Q ~P
()
~P Q
(
)
~P
~Q
16.
DMGT
)C
)- Option B
)))-
22.
[Ans. D]
None of my friends are perfect
i.e., All of my friends are not perfect
((F( ) ( ))
(F( ) ( ))
( ))
(F( )
Alternatively
( )) gives there exist some of
(F( )
my friends who are perfect.
( )) there does not exists
(F( )
any friend who is perfect i.e., none of my
friends are perfect.
So (D) is correct.
23.
[Ans. D]
(A) For all x, which glitter are not gold
(B) For all x, which are gold, glitter
(C) There are few x, which are gold and
not glitter
(D) There are few x, which glitters and
not gold.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 296
26.
[Ans. D]
Now let us assume
m b
b m b
P statement implies that
b (
b)
Q statement implies that
b
( b )
P and Q are equivalent and the imply
each other thus option (D) is the correct
option
27.
[Ans. D]
Given statement is not all rainy days are
cold
This means all rainy days need not be cold
So there is atleast one day which is
(rainy) and (not cold)
So the representation is
( )
(
C ( ))
Option (D) is correct
T
F
T
T
T
F
F
F
T
T
T
T
T
F
T
F
T
F
F
T
F
F
F
T
F
F
F
T
T
F
F
T
F
T
F
F
F
F
F
(
(
))
[Ans. B]
25.
[Ans. B]
1. If p is false, q and r are true
( (F T) T) (F T
T)
(T T) F
T
2. If q is false, p and r are true
( (T F) T) (T F
T)
(T T) F
T
3. If r is false, p and q are true
( (T T) F) (T T
F)
(F F) T
F T
T
In all case it is giving true.
24.
DMGT
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 297
DMGT
Combinatorics
CS - 2005
1.
What is the minimum number of ordered
pairs of non-negative numbers that
should be chosen to ensure that there are
two pairs (a, b) and (c, d) in the chosen
set such that a c mod 3 and
b d mod 5
(A) 4
(C) 16
(B) 6
(D) 24
5.
2.
(B)
(
(
)
)
(C)
(D)
CS - 2007
Statement for Linked Answer Questions 4
and 5
Suppose that a robot is placed on the
Cartesian plane. At each step is allowed to
move either one unit up or one unit right,
i.e., if it is at (i, j) then it can move to
either (i
j)o (i j
)
4.
How many distinct paths are there for the
robot to reach the point (10,10) starting
from the initial position(0,0)?
(A) (
(B)
(C)
(D) None of these
( )
where
CS - 2006
3.
For each element in a set of size 2n, an
unbiased coin is tossed. The 2n coins
tosses are independent. An element is
chosen if the corresponding coin toss
were head. The probability that exactly n
elements are chosen is
(A)
CS - 2008
Statement for Linked Answer Questions 6
&7
Let Xn denote the number of binary
strings of length n that contain no
consecutive 0s.
6.
Which of the following recurrences does
Xn satisfy?
(A) Xn 2Xn1
(C) Xn X n/2 n
7.
8.
(B) Xn Xn/2 1
The value of X5 is
(A) 5
(B) 7
(C) 8
(D) 13
)(
)
(
(
(
)
)
)(
)(
(C)
(D)
(
(
)
)
CS 2014
9.
The number of distinct positive integral
factor of 2014 is __________.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 298
DMGT
2.
[Ans. C]
The number of pairs ( a mod 3, b mod 5 )
is 3 5 = 15
(since a mod 3 can be 0, 1, or 2 and
b mod 5 can be 0, 1, 2, 3, or 4)
If 16 ordered pairs are chosen at least 2
of them must have (a mod 3, b mod 5) the
same (basic pigeon hole principle).
Let such two pairs be (a, b) and (c, d)
then
a mod 3 c mod 3 ac mod 3
and b mod 5 d mod 5
bd mod 5
( ) ( )
(
4.
[Ans. A]
Each path from (0,0) to (10,10) consists
of 20 steps which contains 10 horizontal
moves and 10 vertical moves. The 10
horizontal moves, we can choose in
ways.
5.
[Ans. C]
The number of paths from (0,0)to (10,10)
via the line segment from (4,4) to (5,4)
= C(8,4).C(11,5)
6.
[Ans. D]
There are only two possibilities for the
strings counted by
. First is that the
sequence ends in 1 and the second
possibility is that ending in 0. If a string
ends in 1, then the number of possibilities
for the first
bits such that there are
no consecutive 0s is
. If a n-bit string
ends in 0, then the (n 1) st bit must be 1
and the number of possibilities for the
first n 2 bits such that there are no
consecutive 0s is
.
=
3.
7.
[Ans. D]
,
[Ans. B]
(
Put n = 2
(
(i
8.
3,
,
5,
3.
[Ans. A]
The number of ways to distribute b blue
balls in n distinct boxes is equal to the
number of solutions of the equation
b,
which
is
distribution of the r red balls
is
. Since the distribution of red
balls and blue balls are independent, the
[Ans. A]
The probability that exactly n elements
are chosen
= the probability of getting n heads out
2n tosses
( ) ( )
( inomia fo mu a)
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 299
required
is
9.
number
of
ways
)(
(
DMGT
)
)
[Ans. 8]
Resu t : If n is a powe of p ime
(n p ) then n has x + 1 factors (they
are ( p p p
p ))
Result 2: Every number can be written as
product of powers of primes
(n p p
p ) then by product rule
the no.of factors
)(
)
=(
(
)
The given number is 2014
2014 =
53
So the no. of integral factors
)(
)(
)
=(
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 300
DMGT
3.
4.
5.
e
The poset is
(A) not a lattice
(B) a lattice but not a distributive lattice
(C) a distributive lattice but not a
Boolean algebra
(D) a Boolean algebra
6.
7.
8.
CS - 2006
9.
Given a set of elements N=* , ,,n+ and
two arbitrary subsets A N and B N,
how many of the n! permutations from
N to N satisfy min ,(A)-= min ,(B)-,
where min (S) is the smallest integer in
the set of integers , and ( ) is the set of
integers
obtained
by
applying
permutation to each element of ?
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 301
(A) (n |A B|)|A|| B|
|B| )n
(B) (|A|
|
|
(C) ! | |
(D)
10.
.|
15.
16.
17.
f (i) is
i 1
(A) 3m
(B) 3n
(C) 2m + 1
(D) 2n + 1
11.
12.
13.
14.
DMGT
CS - 2007
18. How many different non-isomorphic
Abelian groups of order 4 are there?
(A) 2
(C) 4
(B) 3
(D) 5
19.
th
= *a, b, c, d+
Let be the partial order on the set of
partitions = ( , 2 3 , 4 ), defined
as follows: i j if and only if i
refines j . The poset diagram for ( , )
is
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 302
(A)
(B)
22.
(C)
(D)
21.
CS - 2008
23. A set of Boolean connectives is
functionally complete if all Boolean
functions can be synthesized using those.
Which of the following sets of connectives
is NOT functionally complete?
(A) EX-NOR
(B) Implication, negation
(C) OR, negation
(D) NAND
24.
25.
20.
DMGT
i.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 303
28.
ii.
iii.
DMGT
CS - 2010
29. Consider the set S = {1, ,
}, where
and
are cube roots of unity. If *
denotes the multiplication operation,
the structure {S, *} forms
(A) a group
(B) a ring
(C) an integral domain
(D) a field
30.
iv.
CS - 2012
31. How many onto (or surjective)
functions are there from n- element
(n2) set to a 2-element set?
(A)
(C)
)
(B)
(D) (
CS - 2013
32. A binary operation on a set of integers
is defined as y = x
. Which one
of the following statement is TURE about
?
(A) Commutative but not associative
(B) Both commutative and associative
(C) Associative but not commutative
(D) Neither commutative nor associative
CS - 2014
33. A pennant is a sequence of numbers, each
number being 1 or 2. An n-pennant is a
sequence of numbers with sum equal to n.
For example, (1,1,2) is a 4-pennant. The
set of all possible 1-pennants is {(1)}, the
set of all possible 2-pennants is {(2),
(1,1)} and the set of all 3-pennants is
{(2,1), (1,1,1), (1,2)}. Note that the
pennant (1,2) is not the same as the
pennant (2,1). The number of 10pennants is ______________.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 304
34.
35.
36.
37.
38.
DMGT
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 305
DMGT
[Ans. A]
The set H is closed, since multiplication of
upper triangular matrices will result only
in upper triangular matrix.
Matrix multiplication is associative, i.e.
A (B C) = (A B) C.
(iii)The identity element is
I should be = [
S is reflexive.
Now, (x, y) R S
(x, y) R and (x, y) S
(y, x) R and (y, x) S (Since R and S are
symmetric)
(y, x) R S
(x, y) R S
(y, x) R S
Therefore R S is symmetric.
Now consider
(x, y) and (y, z) R S
(x, y) and (y, z) R
and (x, y) and (y, z) S
(x, z) R and (x, z)S (Since R and S are
transitive)
(x, z) R S
R S is transitive also
Since
is reflexive, symmetric and
transitive.
R S is equivalence relation.
Note: A similar argument cannot be made
for R S.
3.
[Ans .C]
The set S = {1, 2, 4, 7, 8, 11, 13, 14} is a
group under multiplication modulo 15.
The identity element for this group is
e = 1 since, x , x mod 5 = x
Now let the inverse of 4 be
.
Therefore (
) mod 15 = e = 1
(by the definition of inverse)
ince ( ) mod 5 =
4.
[Ans. B]
Consider the arrow diagram shown below
B
C
A
g
f
a
1
b
2
3
h
h (a) = f(g (a)) =
h (b) = f(g (b)) =
Here f is onto but g is not onto, yet h is
onto.
As can be seen from the diagram for h to be
onto
f should be onto, but g need not be onto.
Answer is (B).
5.
[Ans. B]
a
[Ans. C]
R S is an equivalence relation as can be
seen from proof given below.
Let xA (x, x)R and (x, x)S(since R
and S are reflexive)
(x, x)R S also.
d
[{a, b, c, d, e+,e
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 306
[Ans. A]
Let A denote the complement of set A.
= (A B) C = (A B ) C
= A (B C)
= (A C) (B C)
= (A C ) (B C )
= (A C ) (B C)
= (A C B ) (A C C)
= A (B C) ( A C C = )
=
7.
[Ans. B]
The set C with the subset relation is a
total order. Hence the elements of C can be
ordered as
. We have
| | | |if i j.
The longest possible chain is
= A. Hence the
maximum cardinality of C is n
.
8.
[Ans. C]
If g is not ONTO, then no way h can be
ONTO.
h is ONTO
g is ONTO.
Let A = {1}, B = {1, 2}, C = {1}, ( ) = ,
g(1) = 1, g(2) = 2, shows that h = g of need
not be ONTO even when g is ONTO.
Option A is wrong
9.
[Ans. C]
If A = B, then for any ,
min , (A)- = min, (B)-.
Hence the number of permutation which
satisfy the criterion in this special case is n
!.
DMGT
|
equal to n !. Hence
[Ans. B]
f(i)just represents | | | |
| |, because f(i) equals the total number
of occurrences of element i in the set .
f(i) = 3n ( | | = 3).
11.
[Ans. D]
| | = x, | | = y and | | = z
Given
=
So| | = xy
|E| = | | =
So the number of distinct functions from Z to
E
= |E|| |
=( ) =
12.
[Ans. A]
(x, y) R(u, v) iff x < u and y > v
(x, x) (x, x) since x x and x x
So R is not reflexive,
R is neither a partial order, nor an
equivalence relation.
13.
[Ans. C]
Let A= {1, 2, 3, 5, 7, 8, 9}
Construct the Cayley table for any x, y A
such that
x * y = (x.y) mod 10
1 2 3 5 7 8 9
1 1 2 3 5 7 8 9
2 2 4 6 0 4 6 8
3 3 6 9 5 1 4 7
5 5 0 5 5 5 0 5
7 7 4 1 5 9 6 3
8 8 6 4 0 6 4 2
9 9 8 7 5 3 2 1
We know that 0 A. So it is not closed.
( .5)mod
A
Therefore, (A) is true.
The identity element = 1
(
) mod 10 = 1
From the table we see that
does not
exist.
Since, (3 7)mod
=
7 is the inverse of 3 and 7 A.
(C)is false
(D) is true since 8 does not have inverse.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 307
14.
[Ans. C]
Consider the following Venn diagram for
= (E F) (F G)
E
16.
E
DMGT
[Ans. B]
(
)
U
= (E
(E
= (E
G))
(E
(E G))
E
F)
(E F)
F
(
)
(shaded)
So X=Y
Or alternatively the solution can be
obtained
From Boolean algebra as follows:
= (E F) (F G)
= EF FG
= EF (FG)
= EF (F
G)
= EFF
EFG
= EFG
imilarly, = (E (E G)) (E F)
= (E EG) (E F )
= E (EG) EF
= E (E
G ) EF , EE = = EG EF
= EG (EF )
= EG (E
F)
= EE G EFG
= EFG
X=Y
15.
Now
(
)is
And
[Ans. D]
=
*n|
n
3,
n is divisinle by either , 3 or 5+
The number of elements divisible 2 and 3
must be in a multiple of 6
i.e., 6, , 8, , 3 , ..
The no. of such elements =
=
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 308
Now (
And
DMGT
) (
) =?
=
. . (A)
And
And
is
(
. . (B)
17.
Now (
)=
[Ans. C]
f: N N N
If f (a, z) = a = f(z, a) then on element
z N is called the identity
(i). f(x, y) = x y 3 Now f(a, y) = a y
f(y, a ) = y + a 3
Clearly f(a, y) = a = f(a, y)for y = 3 and a
And
)=
18.
th
[Ans. A]
Let G = {e, a, b, c} be an Abelian group of
order 4, where e is the identity element and
is the group operation. ince the order of
each element divides the order of the
group, ord (a), ord (b) and ord (c) can be
either 2 or 4. If any of the orders is 4 then
the group is cyclic and hence isomorphic to
(the group {0, 1, 2, 3} under addition
modulo 4).
Otherwise, if ord (a) = ord (b) = ord (c) = 2,
then a a = b b = c c = e.
a b can only be c and similarly
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 309
b c = a and c a = b.
Hence only two non-isomorphic Abelian
groups of order 4 exist.
19.
22.
[Ans. A]
= *x
|x
x
x = ,
(x
)
where x =
,x ,x }
Let = ( , , ) ( , , )
( , , )=( , , )
Clearly ( , , )
(
)=( , , )
,
. , .
=
= }
= =
=
contains L. I vectors also
For any x
( , , )
x= ( , , )
(x , x , x ) = ( , , ) ( , , )
forms a basis for the subspace ,
(x , x , x ) = (
, , )
=
Clearly S spans X
23.
[Ans. A]
The remaining 3 sets are functionally
complete
24.
[Ans. D]
Let
A=(
= .(
[Ans. C]
A partition
is called a refinement of the
partition if every set in , is a subset of
one of the sets in .
is a refinement of , and
and are refinements of
and are not comparable since neither
is a refinement of the other.
So the poet diagram for ( , ) is
[Ans. B]
Let S be a set of n elements say
* ,
, 3,., n+. Now the smallest
equivalence relation on S must contain all
the reflexive pairs *( , ), ( , ), (3, 3) .,
(n, n)} and its cardinality is therefore n.
The largest equivalence relation on S is
S S, which has cardinality n n = n .
The largest and the smallest equivalence
relations on S have cardinalities n and n
respectively. The correct choice is (B).
DMGT
)
)/
=
= U.
25.
)
(
) ,
)
= U]
[Ans. A]
a
21.
[Ans. D]
It can be seen that ( , )
if and only if
the decimal digit of b at the 10th place is
greater than or equal to that corresponding
to , . This follows from the fact that
%
returns the decimal digit at units
place and
truncates the digit at the
units place.
The rule %
%
specifies that the
decimal digit of b at the units place must
be decimal digit of b at the units place
must be greater than or equal to that of a.
The rule (
,
)
respectively
specifies this rule for all the other digit
positions.
Hence, only (145, 265) and (0, 153) P.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 310
27.
[Ans. A]
Group properties are closure, associativity
existence of identity and existence of
inverse for every element. Commutativity
is not required for a mathematical
structure to a group.
28.
[Ans. D]
Given, R={(x, y),(x, z),(z, x),(z, y)} on the set
{x, y, z}, here (x, y) R but x = z (y, x) R.
is not symmetric.
Also (x, z) R and (z, x) R.
is not antisymmetric.
R is neither symmetric nor anti-symmetric.
29.
[Ans. A]
{S, *} is a group. To be a ring, an integral
domain, or a field, there must be two
binary operations.
30.
[Ans. C]
Let S be a set of n elements. A relation
R
SS is reflexive if (r, r) R r S.
Each of the remaining elements of SS may
or may not be present in R. Hence the
number of reflexive relations on S is
.
When n = 5, the answer is
.
31.
[Ans. C]
Let n = 2. There are only 2 onto functions
as shown below:
f
is not a lattice since lub (e, d) does not
exist.
a
c
b
d
[Ans. C]
If an element is a generator, all the
elements must be obtained as powers of
that element.
Try a, b, c, d one by one to see which are
the generators.
a=a
a = a. a = a
a = a. a = a. a = a and so on.
a is not the generator.
b=b
b = b. b = a
b = b. b = b. a = b
b = b. b = b. b = a and so on
b is not the generator
c=c
c = c. c = b
c = c. c = c. b = d
c = c. c = c. d = a
Since all of a, b, c, d have been generated as
powers of c,
c is a generator of this group.
Similarly
d=d
d = d. d = b
d = d. d = d. b = c
d = d. d = d. c = a
d is the other generator.
DMGT
For n = 2
Option (A)
=
=
Option (B)
=
=3
Option (C)
=
=
)= (
)=
Option (D) (
So only the option (C) gives the correct answer.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 311
32.
33.
34.
[Ans. A]
x y=x
y
x y=y
x
As sign in commutative so x
y is
equal to y
x so x y is commutative.
Now check associativity
x (y z) = x (y
z )
(y
=x
z )
=x
y
z
y z
(x y) z = (x
y ) z
= (x
y )
z
=x
y
x y
z
x (y z) (x y) z
So not associative
Option (A) is Correct.
[Ans. *] Range 88.9 to 89.1
For 10 pennants we need to consider
minimum 5 coordinates, maximum 10
coordinates in n tuple
For 5 tuple all entries are 2 [i.e (2, 2, 2, 2,2)]
So no. of 5 tuples = 1
For 6 tuple 4 entries are 2 (remaining are
1) So no.of 6 tuples 6 = 5
For 7 tuple 3 entries are 2 (remaining are
1) so no.of 7 tuples 7 = 35
For 8 tuple 2 entries are 2 (remaining are
1) so no.of 8 tuples 8 = 8
For 9 tuple 2 entries are 2 (remaining are
1) so no.of 9 tuples 9 = 9
For 10 tuple all entries are [ie. (1, 1, 1, 1,
1, 1, 1, 1, 1, 1) so no.of 10 tuples = 1]
No.of 10 pennants
=
5 35
8 9
= 89
[Ans. 16]
If |A| = m, |B| = n then the no. of functions
from A to B is
..( )
|
|
And
=
.( )
Given S is set of all function of
f: * , +
* , +
(A)
(B)
By (2) domain (A) contains elements
So S contains
function (by (1))
Given N is the no.of function from S to {0, 1}
So N =
(by( ))
So
log log N
35.
[Ans. A]
Since, the roots of f(x) = 0 i.e., x =1 2, 3
lies between 0 and 4 and f(x) is of degree 3
f( ) and f(4) are of opposite signs
f( ). f( )
.
36.
[Ans. A]
For statements , (empty set) is example
is larger than all the elements
For statement , (itself * , , .
+
is example)
S is smaller than all the elements
So option (A) is correct
37.
[Ans. D]
f:
defined by f(a) = , f(b) = ,
f(c) = where
X = *a, b, c+ = * , +
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) = * + f(A) = * , + f(B) = * , +
f(A) f(B) = * , +
|f(A B)| = 1
ptions (A), (B)and (C) are not true
Hence, option (D) is correct
38.
[Ans. B]
a. Since f(f(i)) = i
Every element in codomain has some
pre image. So f is onto. So R is true
b. To have this type function we can have
either
ption f(i) = i i
In this case P, Q are both true
Option 2 Take any pair x, y in
* , , .
+ and map f(x) = y, f(y) = x
Do like this for all pairs
ince * , , , .
+ contains odd of
elements, one element z will be left finally
For that element we must have f(z) = z
So in this case only Q is true
P is false
nly , are true
o option (B) is correct
39.
[Ans. 4]
Given x x = e y y = e, x y x y = e,
y x y x = e ( )
From (1) we can observe for any number
of x, ys (in any order) the result of binary
operation is e except for one x, y
[for example x y y x = x e x = x
x = e]
= log log
= log
DMGT
= 6
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 312
DMGT
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 313
DMGT
Graph Theory
CS 2005
1.
Let G be a directed graph whose vertex set
is the set of numbers from 1 to 100. There
is an edge from a vertex i to a vertex j iff
either j = i + 1 or j = 3i. The minimum
number of edges in a path in G from
vertex 1 to vertex 100 is:
(A) 4
(C) 23
(B) 7
(D) 99
2.
3.
CS - 2006
Common Data for Questions 4, 5, 6:
The
vertices of a graph G correspond
to all subsets of a set of size n, for n 6.
Two vertices of G are adjacent if and only
if the corresponding sets intersect in
exactly two elements.
4.
The number of vertices of degree zero in
G is
(A) 1
(C) n +1
(B) n
(D)
5.
6.
7.
( )
( )
( )
( )
CS - 2007
8.
Which of the following graphs has an
Eulerian circuit?
(A) Any k-regular graph where k is an
even number
(B) A complete graph on 90 vertices
(C) The complement of a cycle on 25
vertices
(D) None of the above
9.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 314
CS- 2008
10. What is the chromatic number of the
following graph?
(A)
(B)
(C)
(D)
15.
DMGT
I and II
III and IV
IV only
II and IV
(A) 2
(B) 3
11.
(C) 4
(D) 5
CS - 2009
12. Which one of the following is TRUE for any
simple connected undirected graph with
more than 2 vertices?
(A) No two vertices have the same
degree
(B) At least two vertices have the same
degree
(C) At least three vertices have the same
degree
(D) All vertices have the same degree
13.
CS - 2011
16. K4 and Q3 are graph with the following
structures.
K4
Q3
Which of the
isomorphic to
following
graphs
is
CS - 2010
14. The degree sequence of a simple graph is
the sequence of the degrees of the nodes
in the graph in decreasing order. Which of
the following sequences cannot be the
degree sequence of any graph?
I. 7, 6, 5, 4, 4, 3, 2, 1
II. 6, 6, 6, 6, 3, 3, 2, 2
III. 7, 6, 6, 4, 4, 3, 2, 2
IV. 8, 7, 7, 6, 4, 2, 1, 1
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 315
19.
( )
( )
( )
( )
CS - 2013
20. Which of the following statement is/are
TRUE for undirected graphs?
P: Number of odd degree vertices is even.
Q: Sum of degrees of all vertices is even
(A) P only
(B) Q only
(C) Both P and Q
(D) Neither P nor Q
21.
22.
DMGT
CS 2014
23. Let G=(V,E) be a directed graph where V
is the set of vertices and E is the set of
edges. Then which one of the following
graphs has the same strongly connected
components as G ?
(
)
(A)
*( ) ( )
+
(
)
(B)
*( ) ( )
+
(
)
(C)
*( )
}
(
)
(D)
is the set of
vertices in
24.
26.
An ordered n tuple (
) with
is called graphic if there
exists a simple undirected graph with n
vertices having degrees
respectively. Which of the following
6-tuples is NOT graphic?
(A) (1, 1, 1, 1, 1, 1)
(B) (2, 2, 2, 2, 2, 2)
(C) (3, 3, 3, 1, 0, 0)
(D) (3, 2, 1, 1, 1, 0)
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 316
27.
28.
29.
DMGT
2
1
1
2
30.
31.
32.
L
vertex in a graph. For all planar graphs
following is TRUE?
(A) In any planar embedding, the
number of faces is at least
(B) In any planar embedding,
number of faces is less than
the
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 317
DMGT
[Ans. B]
Since along any path, at each step the
vertex labels can atmost be triple and
since
, we must have the
shortest path length from vertex 1 to 100
greater than or equal to 5. The path
3.
[Ans. B]
Given V = 13, E = 19
Let R be the number of regions.
R = E V +2
Then
and
than
[Ans. A]
is same as
which is known to be
non-planar. G2, G3 and G4 can be redrawn
as follows so they are planar.
4.
[Ans. C]
The vertices of degree zero are vertex
corresponding to the empty set, and those
corresponding to the singleton sub-sets of
the given set of n elements. Hence the
number of vertices of degree 0 is n + 1.
5.
[Ans. C]
L
b S *
4
. +
Consider a subset containing 2 elements
of the form {1, 2}. Now {1, 2} will be
adjacent to any subset with which it has
exactly 2 elements in common. These sets
can be formed by adding zero or more
elements from remaining n 2 elements
to the set {1, 2}. Since each of these
elements may be either added or not
added, number of ways of making such
sets containing 1 and 2 is
.
The vertices with 2 elements will have
degrees.
Now consider the subsets of 3 elements
say {1, 2, 3}
is same as
is greater
6.
[Ans. B]
The number of connected components
in G is determined by the degree of
vertices and edges of vertices. There are
vertices whose degree is zero, so
they can form
connected
components. The remaining vertices of
the graph G are all connected as a single
component. So the total number of
connected component is
.
7.
[Ans. C]
The shortest distance between two
vertices u and v whose corresponding
bit strings are at hamming distance d is
of length d. Hence, the diameter of G is
n. Also, since all the paths between any
two given vertices are all of odd length
and are all of even length, we get that
the chromatic number of G is 2. Hence
the required ratio is .
8.
[Ans. A]
Any k regular graph for k (even no)
Eulerian circuit because we have a result
y
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 318
[Ans. B]
K5 and
are the smallest non planar
graphs. K5 has 5 vertices and
= 10
edges and
has 6 vertices and
edges. So, the non planar graph
with the minimum number of edges is
with 9 edges and 6 vertices.
Note: K5 is the non planar graph with the
minimum number of vertices.
10.
[Ans. B]
a
[Ans. A]
If a n-vertex simple connected graph
contains no cycles of odd length, then its
chromatic number is two. Since the
vertices can be alternately colored with
the first color, the second color, then the
first color and the second color and so on.
Alternatively, since a simple connected
graph with no cycles of odd length must
be bipartite, and since the chromatic
number of bipartite graph is always 2 (in
a bipartite graph each partition requires
one color there are no edges within a
partition of a bipartite graph and there
are only two partitions).
14.
[Ans. D]
The length of a degree sequence gives the
number of vertices in the corresponding
graph. All the given sequences have
length equal to 8, since graphs are simple,
no vertex can have degree more than 7.
The sequence 8, 7, 7, 6, 4, 2, 1, 1 is not
possible.
A vertex can have degree 6 when it is
connected to every other, except one.
When there are four vertices of degree six
each, then there are at most two vertices
of degree two each (if no vertex is of
degree 1), in which case other vertices
are of degree at least 4. Hence the
sequence 6, 6, 6, 6, 3, 3, 2, 2 cannot be
possible.
The other two sequences are possible.
15.
[Ans. C]
Given, ( ) =
c
d
e
12.
[Ans. D]
A connected graph has an Euler circuit if
and only if every vertex is of even degree.
A K-regular graph has all vertices of
degree K each. Hence if K is even, a
connected K-regular graph has an Euler
circuit.
DMGT
i d = Sum of degrees
d
[Ans. C]
Whenever in a graph of vertices have
even degrees, it will surely have an Euler
circuit.
(A) Since in a k-regular graph, every
vertex has exactly k degrees and if k
is even, every vertex in the graph has
even degrees. k-regular graph need
not be connected, hence k-regular
graph may not contain Euler circuit
By handshaking lemma, ( )
where,
is the number of edges in G.
(T).
If S and T are two trees with (S)
In a tree,
S
and
T
Where |S| is the number of vertices of
tree S and |T| is the number of vertices of
tree T.
S
T
S
T
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 319
16.
[Ans. B]
Both the graphs are planar as can be seen
from their planar representation.
17.
[Ans. D]
n = 10
e = 15
In a simple connected planar graph,
b
regions as e
Out of this, one region is unbounded and
the other 6 are bounded.
So correct answer is 6, which is Option (D).
18.
[Ans. B]
Check invariants are one by one.
Step 1: All 4 choices have same number of
vertices and edges as given graph.
Step 2: So we find degree sequence of
given graph which is (1, 1, 2, 2, 2, 2, 2, 4).
Degree sequence of graph in option (A) is
(1, 1, 1, 2, 2, 2, 3, 4).
Degree sequence of graph in option (B) is
(1, 1, 2, 2, 2, 2, 2, 4).
Degree sequence of graph in option (C) is
(1, 1, 2, 2, 2, 2, 3, 3).
Degree sequence of graph in option (D) is
(1, 1, 2, 2, 2, 2, 2, 4).
So only options (A) and (C) are not
isomorphic to given graph, since degree
sequence of these graphs is not same as
given graph.
Step 3: Now to decide between option (B)
and (D), which one is isomorphic to given
graph, we check the number of cycles.
In given Graph there is one cycle of length 5.
But in Graph (B) has one cycle of length 5.
So only Graph (B) can be isomorphic to
given Graph.
19.
[Ans. C]
The graph given is K6
In K6, every cycle of length 4 corresponds
to selecting 4 vertices out of 6 vertices,
which can be done in
ways and then
ordering the 4 vertices in circular
permutation in 3! ways (since vertices are
labeled). So final answer is
.
DMGT
20.
[Ans. C]
P : Number of odd degree vertices is even
Q : Sum of degree of all vertices is even
Q is true.
Reason: Calculating the sum of degrees of
all vertices. Take any edge, it is joining
two vertices (not necessarily distinct),
hence contribution 2 in the sum of
degrees.
H
all vertices is 2e (is even)
Note: It is valid even in case of self loops
P is also true:
Reason: We have established that sum of
degree of all vertices is even
Let us assume, that the number of odd
degree vertices is odd, so, the
contribution of odd degree vertices in
total sum is odd
Now the contribution of even degree
vertices is also even (whether the number
is even or odd). So, total sum becomes
odd, which is not possible. Hence P is true
Note: Include vertex of degree zero in
even degree vertices.
21.
[Ans. C]
We need to find unordered cycles of
length 3 so we choose any 3 vertices from
8 vertices. This can be done in
ways.
To make a cycle we need to choose edge
between the selected vertices. The
probability of choosing any edge is 1/2.
So for three edges =
Expected no. of cycle =
22.
th
( )
[Ans. A]
L b
y .I
L( )
1. There will be an edge between two
vertices corresponding to the
adjacent edges in the cycle
2. Degree of each vertex in L(C) will be z.
3. L(C) will be connected.
Hence L(C) will also be a cycle So, (P) is True
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 320
(Q) L n b
q
Consider line graph L(Kn).
L(Kn) has
vertices
[Ans. B]
Take an example for Graph G
.
.
A
B
Then option A and D will be eliminated.
Let G is below graph
A
B
Then
is a graph with below structure
=
26.
25.
( 1, 1, 1, 1, 1, 1)
(
(
(
[
)
)
)
(
(
(
)
)
)
( )
(
)
(
)
(
)
( )
(
(
(
)
)
)
(
(
(
)
)
)
(
(
(
( 1, 1)
( 0, 0)
(1, 1)
( 1, 1, 2, 2, 2)
( 1, 1, 1, 1)
( 2, 2, 2, 1, 1)
( 1, 1, 1, 1)
( 1, 1,)
( 0, 0)
(1, 1)
[Ans. 506]
Given vertex set is
V = {(i, j)|1
}
Imagine vertex set as a matrix as follows
)
)
)
( 1, 1, 1, 1)
( 1, 1, 1, 1)
[Ans. C]
PQRS is not a topological ordering
because no edge is there from Q to R
PSRQ and SPRQ are topological
ordering because
S
Q and
Q exits
b
y y
(
(
(
[Ans. C]
Apply Havel Hakimi algorithm to the
four options
Option (A)
A
B
In G the number of strongly connected
components are 2 ,where as in
it is
only one.
24.
DMGT
)
)
)
(
(
(
)
)
)
)
)
)
(
(
(
)
)
)
1
(2, 2, 0, 0, 0)
(2, 2, 0, 0, 0)
(1,
0, 0)
( )
(
(
(
)
)
)
(
(
(
)
)
)
(
(
(
(4)
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 321
27.
[Ans. 36]
Max no.of edges in bipartite graph on n
vertices is given by
.
28.
31.
[Ans. C]
If G is a tree with n vertices then
no.of edges = n 1
If G is forest (collection of trees) with k
connected components then the edges
= n k.
Option (C) is correct
32.
[Ans. A]
By Euler formula
[Ans. 5]
Result 1: In a cycle graph
no.of vertices = n, edges = n
Result 2: If a graph G is isomorphic to its
complement then E(G) =
(
.( )
By Hand shaking theorem.
4=n1
n=5
29.
DMGT
( )
[Ans. 6]
In graph portion
.
,
Two
And in subgraph
2
1
ST are possible
2
2
2
Three ST
2
1
possible
1
[Ans. 5]
L
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 322
DBMS
ER Diagrams
CS 2005
1.
Let
and
be two entities in an ER
diagram with simple single-valued
attributes. R1 and R2 are two relationships
between
and , where R1 is
one-to-many and R2 is many-to-many. R1
and R2 do not have any attributes of their
own. What is the minimum number of
tables required to represent this situation
in the relational model?
(A) 2
(C) 4
(B) 3
(D) 5
2.
3.
Lodging
Person
(A)
(B)
(C)
(D)
Person
Hotel Room
Lodging
None of these
CS - 2008
Linked Answer Questions 4 & 5
Consider the following ER diagram
4.
5.
CS - 2012
6.
Given the basic ER and relational models,
which of the following is INCORRECT?
(A) An attributes of an entity can have
more than one value
(B) An attribute of an entity can be
composite
(C) In a row of a relational table, an
attribute can have more than one
value
(D) In a row of a relational table, an
attribute can have exactly one value
or a NULL value
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 323
DBMS
[Ans. B]
4.
[Ans. B]
M, P Entity sets, will become tables
N Weak Entity set, will become a table
R1 Relationship set with cardinality
N:1, will not be a table
R2 Identifying Relationship set, will
not be a table
Total No of tables = 3
1) M=(M1, M2, M3, P1)
2) P =(P1, P2)
3) N =(N1, P1, N2)
5.
[Ans. A]
The correct attribute set is
{M1, M2, M3, P1}
6.
[Ans. C]
An attribute of an Entity can be atomic,
Multi-valued, and composite.
An attribute (or) column of a table
must take exactly one value (or) a NULL
value.
Option A Correct, Multivalued
Attribute
Option B Correct, Composite Attribute
Option C Incorrect, since column
cannot take multiple values
Option D Correct, column in a table
takes single value (or) NULL.
1: N
E1
E2
N: N
[Ans. C]
A
rimary key Parent column
C Foreign key Child column
C refers to A O -DELETE CASCADE,
when
parent
gets
deleted,
all
corresponding child rows will be deleted
automatically.
(2, 4) is deleted [Parent =2] (5, 2) and
(7, 2) will get deleted
(5, 2) is deleted [Parent = 5] (9, 5) will
get deleted
(9, 5) is deleted [Parent = 9]
no child
rows for parent = 9
(7, 2) is deleted [Parent = 7]
no child
rows for parent = 7
Total no. of parents deleted = {2, 5, 9, 7}
Total no. of rows deleted
= {(5, 2), (7, 2), (9, 5)}
3.
[Ans. C]
rent payment is a descriptive attribute,
because it is related to the Lodging
Relationship.
rent ayment
neither belongs to
Hotel Room nor to a Person Entity Sets.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 324
DBMS
CS - 2006
5.
The following functional dependencies
are given:
AB CD, AF D, DE F, C G, F E,
G A
Which one of the following options is
false?
(A) {CF}+ = {ACDEFG}
(B) {BG}+ = {ABCDG}
(C) {AF}+ = {ACDEFG}
(D) {AB}+ = {ABCDG}
6.
2.
Consider
a
relation
scheme
R= (A, B, C, D, E, H) on which the
following functional dependencies hold:
*A B, BC D, E C, D A+. What are the
candidate keys of R?
(A) AE, BE
(B) AE, BE, DE
(C) AEH, BEH, BCH
(D) AEH, BEH, DEH
3.
4.
CS - 2007
7.
Which one of the following statements is
FALSE?
(A) Any relation with two attributes is in
BCNF.
(B) A relation in which every key has
only one attribute is in 2NF.
(C) A prime attribute can be transitively
dependent on a key in a 3NF relation.
(D) A prime attribute can be transitively
dependent on a key in a BCNF
relation.
8.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 325
CS - 2008
9.
Consider the following relational schemes
for a library database:
Book
(Title,
Author,
Catalog_no,
Publisher, Year, Price)
Collection (Title, Author, Catalog_no)
With
the
following
functional
dependencies:
i) Title Author Catalog_no
ii) Catalog_no Title, Author, Publisher,
Year
iii) Publisher, Title, Year Price
Assume {Author, Title} is the key for both
schemes. Which of the following
statements is true?
(A) Both Book and Collection are in
BCNF
(B) Both Book and Collection are in 3NF
only
(C) Book is in 2NF and Collection is in
3NF
(D) Both Book and Collection are in 2NF
only
CS - 2011
10. Consider a relational table with a single
record from each registered student with
the following attributes.
1. Registration_Num:
Unique
registration
number
of
each
registered student
2. UID: Unique identity number, unique
at the national level for each citizen
3. BankAccount_Num: Unique account
number at the bank. A student can
have multiple accounts or joint
accounts. This attribute stores the
primary account number
4. Name: Name of student
5. Hostel_Room: Room number of the
hostel
Which of the following options is
INCORRECT?
(A) BankAccount_Num is a candidate key
(B) Registration_Num can be a primary
key
DBMS
The relation R is
(A) In 1NF, but not in 2NF
(B) In 2 NF, but not in 3 NF
(C) In 3NF, but not in BCNF
(D) In BCNF
CS - 2014
14. Consider
the
relation
scheme
R = (E, F, G, H, I, J, K, L, M, N) and the set
of functional dependencies {*E, F+ *G+,
*F+ *I, J+, *E, H+ *K, L+, *K+ *M+,
*L+ *N+} on R. What is the key for R?
(A) {E, F}
(C) {E, F, H, K, L}
(B) {E, F, H}
(D) {E}
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 326
15.
16.
17.
18.
th
th
DBMS
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 327
DBMS
2.
[Ans. C]
2NF, 3NF decomposition guarantees
both dependency preservation and loss
less join.
BCNF decomposition Only guarantees
loss less join.
BCNF decomposition, at times satisfies
dependency preservation and at times
not.
BCNF wont guarantee the dependency
preservation property.
[Ans. B]
Relation = R(A, B, C, D)
F Set of FDs *( ) A B
( )AC
( ) CD E
( )BD
( ) E A+
Option (A):- CD AC Correct
( )CD E
] By transitivity
( )E A
CD A
CD C
]
] CD AC
( )A C
CD A
(By union rule)
Option (B):- BD CD
Cannot be
derived from given set of FDs
Option (C):- BCCD can be derived
(4)BD, By Augmentation rule BCCD
Option (D):- ACBC Can be derived
( )AB+By augmentation rule
AC BC
5.
[Ans. C]
Relation=R(ABCDEFG)
Set of FDs F are
[Ans. D]
Relation = R(A, B, C, D, E, H)
Set of FDs are
1)
2)
3)
4)
AB
BCD
EC
DA
A B C D E H
AEH
BEH
DEH
Candidate key = {AEH, BEH, DEH}
3.
[Ans. A]
Table has fields Simple attributes
= F1, F2, F3, F4, F5
F=set of FDs
( )F F
( )F F
]
( )F , F F
1)
2)
3)
4)
5)
6)
AB CD
AF D
DE F
CG
FE
GA
A B C D E F G
ACDEFG
CF
ABCDG
BG
AF
ADEF
ABCDG
AB
As closure of AF = AF = {ADEF}
Option (C) is incorrect.
Candidate key
=(F1, F2)[F1+F2]
Prime Attribute
= {F1, F2}
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 328
6.
7.
8.
9.
[Ans. B]
Relation = R(V, W, X, Y, Z)
F Set of FDs *VY W, WX Z, ZY V+
V
W X Y Z
VXZ
VXY
Candidate key VXY
[Ans. D]
Statement (D) is false because in BCNF
relation a prime attribute cant be
transitively dependent on a key.
10.
[Ans. A]
Since students can have joint accounts,
two students can have same bank account
number. So, BankAccount_Num can not be
candidate key.
11.
[Ans. C]
A table is said to be in BCNF if it is already
in 3 NF and all determinants are keys
12.
[Ans. B]
Relation = R(ABCDEFGH)
F Set of FDs are
[Ans. C]
In DBMS, we can see that
If A B and A C then A BC
and A BC then A B and A C
Hence answer is (C).
[Ans. C]
1) Book (Title, Author, Catalog-NO,
Publisher, Year, Price)
FDs on book are
I. Title, Author Catalog-NO
II. Catalog-NO Title, Author,
Publisher, Year
III. Publisher, Title, Year Price
Key = {Author, Title}
Prime Attributes = {Author, Title}
FD1: Title, Author Catalog-NO is in
BCNF.
FD2: Catalog-NO Title, Author,
Publisher, Year has to be decomposed
FD . : Catalog-NO Title is in NF
FD . : Catalog-NO Author is in 2NF
FD . : Catalog-NO Publisher is in NF
FD . : Catalog-NO Year is in 2NF
FD3: Publisher, title, year Price is in 2NF
Book is in 2NF
2) Collection (Title, Author, Catalog-NO)
FDs on collection are
( ) Title, Author Catalog-NO
Key = {Author, Title}
Prime Attributes = {Author, Title}
FD : Title, Author Catalog-NO is in BCNF
Collection is in BCNF
[In 3NF, 2NF, 1NF also]
DBMS
1)
2)
3)
4)
5)
CHG
ABC
BCFH
EA
FEG
A B
C
D E F G
CH
A
B
E
F
Candidate keys are *AD, BD, ED, FD+
13.
th
[Ans. A]
Candidate keys = {AD, BD, ED, FD}
Prime attributes = {A, B, D, E, F}
Lets assign highest Normal form to each
FD
1) CH G is in NF
2) A BC can be treated as
A B is in NF
A C is in NF,A is part of key3) B CFH can be written as
B C is in NF
B F is in NF
B H is in NF
4) E A is in NF, Since A is prime
5) F EG can be written as
F E is in NF
F G is in NF
Relation is in 1NF only.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 329
14.
[Ans. B]
Relation = R (EFGHIJKLMN)
F Set of FDs are
1)
2)
3)
4)
5)
E
EF
EFH
Key
15.
EF G
F IJ
EH KL
KM
LN
DBMS
[Ans. A]
S1 is true because if R(a, b) is relation
and a b is dependency then this
relation is in 1NF, 2NF, 3NF and BCNF
S2 is false because AB E cannot be
removed from minimal cover.
17.
[Ans. 8]
Given Relation = R (E, F, G, H)
Key = E
Maximum no. of Super Keys = ?
SNo SUPER KEYS
1
{E}
2
{E, F}
3
{E, G}
4
{E, H}
5
{E, F, G}
6
{E, G, H}
7
{E, F, H}
8
{E, F, G, H}
18.
[Ans. B]
Prime Attribute = Part of some candidate
key.
Relation = R (ABCDEF)
Candidate keys are {AB, CD}
Total No of prime Attributer = 4
= {A, B, C, D}
E F G H I J K L M N
EFH
[Ans. D]
S1: Manager (Name, DeptID)
Department (Dept Name, Deptid)
In a given relation Manager DeptID is a
foreign key referencing Deptid (P.K) of
relation Department.
Lets declare the foreign key by an
equivalent check assertion as follows:CREATE TABLE Manager (Name
Varchar (10),
DeptID INT (6), check (DeptID IN (select
Deptid from Department)),
PRIMARY KEY (Name));
The above use of check assertion is good
to declare the foreign key as far as
insertion is considered for relation
manager (will not insert any tuple in
Manager containing such DeptID value
which is not present in any tuple of
Department).
But the above declaration will fail to
implement changes done in Department
relation in terms of deletion & updation.
For an instance if a deptid present in
Department gets deleted, then respective
reference in Manager should also be
deleted.
S is false
S : The given table definition is not valid
due to invalid foreign key declaration.
Attribute a is declared as foreign key
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 330
DBMS
6.
7.
CS - 2006
2.
Consider the relations r1 (P, Q, R) and
r2 (R, S, T) with primary keys P and R
respectively. The relation n contains
2000 tuples and r2 contains 2500 tuples.
The maximum size of the join r1 r2 is
(A) 2000
(C) 4500
(B) 2500
(D) 5000
3.
CS - 2007
4.
Information about a collection of
students is given by the relation studInfo
(studId, name, sex). The relation enroll
(studId, CourseId) gives which student
has enrolled for (or taken) what course
(s). Assume that every course is taken by
at least one male and at least one female
student. What does the following
relational algebra expression represent?
courseld(( studld( sex=female(studInfo))
courseld(enroll)) enroll)
(A) Courses in which all the female
students are enrolled
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 331
DBMS
IV.
are
CS - 2010
10. The following functional dependencies
hold for relations R(A, B, C) and
S(B, D, E):
B A,
A C
The relation R contains 200 tuples and
the relation S contains 100 tuples. What
is the maximum number of tuples
possible in the natural join R S?
(A) 100
(C) 300
(B) 200
(D) 2000
CS - 2011
11. Consider a relational table r with
sufficient number of records, having
attributes A1, A2 An an let 1 p n
Two queries Q1 and Q2 are given below.
Q1: (
where c is a
)
constant
Q2:
where
and
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 332
DBMS
(C)
r
(D)
r
16.
employee
employee
epen ent
CS - 2014
14. Consider a join (relation algebra)
between relations r(R) and s(S) using
the nested loop method. There are 3
buffers each of size equal to disk block
size, out of which one buffer is reserved
for intermediate results. Assuming
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 333
DBMS
2.
3.
4.
[Ans. C]
Relation =R(A, B, C, D)
r =
R
r =
r
As e omposition of R into r and r is
LOSSY Spurious tuples will e generate
s = r r Natural Join]
Will get r + spurious tuples
r is a proper su set of s [r s]
1 2
4
stu info 3
enroll
enroll
Selects only
girls students
Assumes that all girl students
joined in all courses
It selects the course ID in which only a proper subset
of girl students are enrolled.
[Ans. A]
It consider only pairs of tuples that have the
same value on R.
Stu i
1
stu info =
2
3
Step: 1
[Ans. D]
All given relational query language have the
same expressive power.
[Ans. B]
Every Course
Must e taken y at least
one male and at least one female student.
Let us assume there are only 2 courses
{MCA, MBA}
MCA
Course opte
y all girls + 1-boy
[3girls + 1-boy]
MBA Course opted by 2 girls + 1-boy
[2girls + 1-boy]
Let total no of students = 5,
where 3 girls 2-boys.
{A, B, C} girls
{D, E} Boys
Student info
Enroll
Stud
Name sex
Stud Course
id
id
id
1
A
F
1
MCA
2
B
F
2
MCA
3
C
F
3
MCA
4
D
M
4
MCA
5
E
M
1
MBA
2
MBA
5
MBA
Step: 2
stu info
enroll
= Stud ID
Course ID
1
MCA
1
MBA
2
MCA
2
MBA
3
MCA
3
MBA
Step: 3 Step(2) enroll
= Stud ID
Course ID
3
MBA
Step: 4
(step.3)=MBA, course in
whi h proper su set of female stu ents are
enrolled.
5.
th
[Ans. C]
employee (name, sex, supervisor name)
Foreign key
{e. name|Employee e x
[ employee (x)
x. supervisor name # e. name
x. sex= Male]}
we are using 2 tuple variables
e free tuple varia le referring employee
x Bounded tuple variable referring all the
subordinates of the selected free tuple
varia le e
Finally the formulae x F
verifying
whether all the subordinates of the
particular employee are males (or) not.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 334
7.
[Ans. D]
Given:
There are 100 tuples
These are uniformly distributed, in the
interval [0,500]
So for values A100 There will e 200
tuples returned by the given selected query.
R
P
1
2
4
(1)
S =
Q
a
c
d
3 rows created
Row:1 P&Q are same
Row:2 Only P same
Row:3 Only Q same
P Q
1 a
P
= 1
= 1
S =
s )=
P Q
1 a
P
= 1
P Q
1 a
P
= 1
S ))
[Ans. C]
II and IV are equivalent.
10.
[Ans. A]
R (A, B, C) and S (B, D, E)
F= Set of FDs = {B A A
B is the key for R A B
R
A B C =200rows B
Key = B
Parent table = R
Parent column =B
8.
Q
a
b
d
( ran h
a ount
epsitor )
Most efficient version of this query.
a ount
P
1
2
3
[Ans. B]
b - Schema = (b-name, b-city, assets)
a - Schema = (a-num, b-name, bal)
d - Schema = (c-name, a-number)
DBMS
C}
C
S
D E
=100rows
Child table = S
Child column = B
Max rows of R S
= Max always from the child table only.
= 100 rows
100 rows
200 rows
Employee
Dept
eno ename dno
dno
dname
1
D1
D1
2
D1
D2
:
:
100
D20
D200
Child table =
Primary key =
Employee foreign
dno
key = dno
parent table =
Dept
ran h
epositor )
[Ans. D]
R (P, Q, R1, R2, R3)
S (P, Q, S1, S2)
Key= P+Q for oth ta les
omposite key
Let us consider the following instances:-
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 335
[Ans. C]
If records are accessed for a particular value
from table, hashing will do better. If records
are accessed in a range of values, ordered
indexing will perform better.
12.
[Ans. A]
R AB
R CD
B is a foreign key & referring to C & C is a
candidate key.
So,
r
r =
13.
[Ans. A]
Find the distinct names of all students who
score more than 90% in the course no. 107
1. SQL query
Condition would give all s.name having
score > 90 and attending course no. 107
and DISTINCT S.sname will give distinct
student names
TRUE
2. Relational algebra
gives projection of all students
meeting the on ition an gives
DISTINCT value
TRUE
3. Tuple calculus gives DISTINCT student
name having score > 90 and course no is
107
TRUE
4. Domain calculus
Domain calculus is equivalent to
relational algebra and provide distinct
value for the query
TRUE
14.
DBMS
[Ans. A]
=
16.
r )))
r
(
r )))
r )
[Ans. D]
Every employee
has at least one
dependent.
EMPLOYEE
empId empName empAge
1
A
50
2
B
60
3
C
70
DEPENDENT
depId
eId
depName depAge
D1
1
X
30
D2
1
Y
40
D3
2
Z
50
D4
2
U
80
D5
3
V
90
D6
3
W
100
Empi =1 An employee having 2 younger
dependents [empAge > depAge]
[Ans. A]
As Size(r(R)) < Size (s(S)), let us consider
the following illustration
Consider these relations with the following
properties:
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 336
DBMS
Empi = 2
An employee having 1
younger & 1 older dependent
[empAge < depAge]
Empi = 3
An employee having 2 ol er
dependents [empAge < depAge]
employee
employee
employee
employee
epen ent
returns {1 2 3} employee i s
epen ent
returns {2 3}
Final Answer {1, 2, 3} {2 3} = {1}
Employee whose age is greater than all his
dependents.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 337
DBMS
SQL
CS - 2005
1.
The relation book (title, price) contains
the titles and prices of different books.
Assuming that no two books have the
same price, what does the following SQL
query list?
select title
from book as B
where (select count (*) from book as T
where T.price>B. Price) < 5
(A) Titles of the four most expensive
books
(B) Title of the fifth most inexpensive
book
(C) Title of the fifth most expensive book
(D) Titles of the five most expensive
books
2.
(A)
(B)
(C)
(D)
3.
Table hobby
Roll
Hobby name
1798 chess
1798 music
2154 music
2369 swimming
2581 cricket
2643 chess
2643 hockey
2711 volleyball
2872 football
2926 cricket
2959 photography
3125 music
3125 chess
The following SQL query is executed on
the above tables:
select hostel
from student natural join hobby
where marks > = 75 and roll between
2000 and 3000;
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 338
DBMS
CS - 2006
4.
Consider the relation account (customer,
balance) where customer is a primary key
and there are no null values. We would
like to rank customers according to
decreasing balance. The customer with
the largest balance gets rank 1. Ties are
not broken but ranks are skipped: if
exactly two customers have the largest
balance they each get rank 1 and rank 2 is
not assigned.
Query 1: Select A. customer,
count (B. customer) from account A,
account B where
A. balance < = B. balance group by
A. customer
Query 2: Select A. customer,
1+ count (B. customer) from account A,
account B where A. balance< B. balance
group by A. customer
Consider these statements about Query 1
and Query 2.
1. Query 1 will produce the same row
set as Query 2 for some but not all
databases.
2. Both Query 1 and Query 2 are correct
implementations of the specification
3. Query 1 is a correct implementation
of the specification but Query 2 is not
4. Neither Query 1 nor Query 2 is a
correct implementation of the
specification
5. Assigning rank with a pure relational
query takes less time than scanning
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 339
DBMS
C.color = green)
(A) Karthikeyan, Boris
(B) Sachin, Salman
(C) Karthikeyan, Boris, Sachin
(D) Schumacher, Senna
7.
CS - 2007
8.
Consider the table employee (empId,
name, department, salary) and the two
queries Q1, Q2 below. Assuming that
department 5 has more than one
employee, and we want to find the
employees who get higher salary than
anyone in the department 5, which one of
the statements is TRUE for any arbitrary
employee table?
Q1: Select e.empId
From employee e
Where not exists
(Select * From employee s Where
s.department = 5 and
s.salary>=e.salary)
Q2: Select e. empId
From employee e
Where e. salary > Any
(Select distinct salary From employee s
Where s.department = 5)
(A) Q1 is the correct query.
(B) Q2 is the correct query.
(C) Both Q1 and Q2 produce the same
answer
(D) Neither Q1 nor Q2 is the correct
query
CS - 2008
Common Data for Questions 9 &10
Consider the following relational schema:
Student (school-id, sch-roll-no, sname,
saddress)
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 340
10.
DBMS
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 341
DBMS
CS - 2011
14. Database table by name Loan_Records is
given below.
Borrower
Bank_
Loan_
Manager
Amount
Ramesh Sunderajan 10000.00
Suresh
Ramgopal 5000.00
Mahesh Sunderajan 7000.00
What is the output of the following SQL
query?
SELECT count(*)
FROM
(SELECT Borrower, Bank_Manager FROM
Loan_Records) AS S
NATURAL JOIN
(SELECT Bank_Manager, Loan_Amount
FROM Loan_Records) AS T);
(A) 3
(C) 5
(B) 9
(D) 6
15.
CS - 2012
16. Which of the following statements are
TRUE about an SQL query?
P: An SQL query can contain a HAVING
clause even if it does not a GROUP BY
clause
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 342
departments(dept-id,
dept-name,
manager-id, location-id)
You want to display the last names and
hire dates of all latest hires in their
respective departments in the location ID
1700. You issue the following query:
SQL>SELECT last-name, hire-date
FROM employees
WHERE (dept-id, hire-date) IN
(SELECT dept-id, MAX(hire-date)
FROM employees JOIN departments
USING(dept-id)
WHERE location-id = 1700
GROUP BY dept-id);
What is the outcome?
(A) It executes but does not give the
correct result.
(B) It executes and gives the correct
result.
(C) It generates an error because of
pairwise comparison.
(D) It generates an error because the
GROUP BY clause cannot be used
with table joins in a sub- query.
Id
15
25
98
99
Name
Shreya
Hari
Rohit
Rohit
Age
24
40
20
11
C.
Id
10
99
Phone
2200
2100
Area
02
01
17.
18.
DBMS
20.
21.
CS - 2014
19. Given the following schema:
employees (emp-id, first-name,
last-name, hire-date, dept-id, salary)
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 343
8.7
19
Ganesh
8765
ganesh@civil
9.3
18
Swati
9876
swati@mech
9.4
19
Shankar
7853
shankar@cse
9.5
19
Swati
1287
swati@ee
X
Shankar
2345
shankar@math
Student
Age
Student
Name
Student Email
9.4
22.
Student
ID
DBMS
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 344
DBMS
[Ans. D]
No two books will have same price.
Let us consider the table as follows:TITLE PRICE
T1
100
T2
200
T3
300
T4
400
T5
500
T6
600
As the given Query is a Correlated Sub
Query, Outer Query executes first and
Inner Query executes second and executes
once for each row written by the outer
query.
SELECT title From book as B
[Ans. D]
SUPPLY
Supplierid Item
code
S1
I1
S1
I2
S1
I3
S2
I4
S2
I5
S3
I6
TITLE
T1
T2
T3
T4
T5
T6
WHERE (SELECT count(*) FROM book as
T WHERE T.price > B.price)<5
INNER QUERY
SELECT count (*) FROM
book as T WHERE
T.price > 100;=5
SELECT count (*) FROM
book as T WHERE
T.price > 200;=4
SELECT count (*) FROM
book as T WHERE
T.price > 300;=3
SELECT count (*) FROM
book as T WHERE
T.price > 400;=2
SELECT count (*) FROM
book as T WHERE
T.price > 500;=1
SELECT count (*) FROM
book as T WHERE
T.price > 600;=0
<5
<5
Item
Code
I1
I2
I3
I4
I5
I6
Result
Not
Qualified
<5
Qualified
<5
Qualified
<5
Qualified
<5
Qualified
<5
Qualified
INVENTORY
Ware
house
Nagpur
Nagpur
Nagpur
Nagpur
Nagpur
Nagpur
Stock
level
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 345
INNER QUERY
OUT
PUT
NOT
UNIQUE
Query: 2
S =
( .
.
(S)) (H))
(
returns only DISTINCT rows
= 3 rows {7, 6, 5}
Final Answer = Difference in no. of rows =
4 rows
4.
[Ans. C]
Table A
Customer
Balance
1
10
2
20
3
10
4
15
SELECT ITMP.supplierid
3-rows
Qualified
FROM Inventory,supply as ITMP {I1, I2,I3}
WHERE ITMP.supplierid = S1
AND
ITMP.itemcode =
Inventory.itemcode
AND
inventory.warehouse
=Nagpur;
SELECT ITMP.supplierid
2-rows
FROM Inventory, supply as ITMP{I4, I5}
WHERE ITMP.supplierid = S2
AND
ITMP.itemcode =
Inventory.itemcode
AND
Inventory.warehouse
=Nagpur;
SELECT ITMP.supplierid
1-row
FROM Inventory,supply as ITMP {I6}
WHER ITMP.supplierid = S3
AND
ITMP.itemcode =
Inventory.itemcode
AND
Inventory.warehouse
= Nagpur;
DBMS
Qualified
Table B
Customer Balance
1
10
2
20
3
10
4
15
Not
Qualified
Output of Query 1
Customer
Count (B. Customer)
1
4
2
1
3
4
4
2
[Ans. B]
Student Natural Join Hobby WHERE
Marks> =75 AND roll BETWEEN 2000 AND 3000
Roll Name
Hostel Marks Habby Name
2369 Gumma Reddy
7
86
Swimming
2581 Pradeep Pendse 6
92
Cricket
2643 Suhas Kulkarni
5
78
Chess
2643 Suhas Kulkarni
5
78
Hockey
2872 Kiran Vora
5
92
Football
2926 Manoj
5
94
Cricket
Kunkalikar
2959 Hemant
7
88
Photography
Karkhanis
Query: 1
SELECT hostel
FROM
student NATURAL JOIN hobby
WHERE marks > = 75
AND
roll BETWEEN 2000 AND 3000;
returns 7 rows *7, 6, 5, 5, 5, 5, 7+
Output of Query 2
Customer
Count (B. Customer)
1
3
2
1
3
3
4
2
If there are no duplicates of balance then
they produce same row set else not (See
table above). Both are not producing
desired output.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 346
5.
[Ans. B]
PAID
Student Amount
1
2000
Primary Key =
Student
ENROLLED
Student
Course
1
MCA
1
MBA
Primary Key =
Student + Course
7.
[Ans. C]
Counting the number of comparisions
leads to approximately 62.
8.
[Ans. B]
EMPLOYEE
Empid
Name
Dept
Salary
1
A
5
1000
2
B
5
2000
3
C
4
3000
4
D
4
1500
5
E
4
500
We want to find employees who get higher
salary than anyone in the department 5
Correct Output for the above query on the
given data would be employees {2, 3, 4}
Q1:- SELECT e. empId
FROM employee e
WHERE not exists (SELECT *
FROM employee s
WHERE
s.department=5 and
s.salary >=e.salary);
returns rows *2, 3+
student
paid
EXISTS (SELECT * FROM
enrolled WHERE
enrolled. student
= paid. student),
returns 1 rows *1+
Final Result = Query 2 and Query 4
returns identical row sets for all
databases, but there exist database for
which Query 1 and Query 2 return
different row sets on the relations.
6.
DBMS
[Ans. A]
When R.cid = c.cid and c.colour = Green
Table - 1
did
cid
day
22
103
08/10/06
31
103
06/11/06
74
103
08/09/06
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 347
INNER QUERY
OUT
PUT
NOT
EXISTS
11.
SELECT * FROM
1 row Not
employee s
Qualified
WHERE s. department
=5 and s.salary>=1000;
SELECT * FROM
No rows Qualified
employee s
WHERE s. department =5
and s.salary>=2000;
SELECT * FROM
No rows Qualified
employee s
WHERE s.department =5
and s.salary >=3000;
SELECT * FROM
1 row Not
employee s
Qualified
WHERE s. department=5
and s.salary >=1500;
SELECT * FROM
2 rows Not
employee s
Qualified
WHERE s. department=5
and s.salary >=500;
Q2:-
Sid
S1
S1
S2
S2
S3
S3
10.
SELECT
FROM
WHERE
[Ans. D]
If SELECT clause consists aggregate and
non aggregate. All non-aggregate
columns in the SELECT list must appear in
Group by clause. But in this query Group
by consists school_id instead of sch_name
[Ans. C]
Here, we used division operator.
Numerator produces all who scores more
than 35 marks, denominator checks all
exams. Hence it produces pass percentage
above 35% over all exams taken together.
PARTS
Pname
Color
Blue
Blue
Blue
Green
Green
Green
Pid
P1
P2
P3
P4
P5
P6
e. empId
employee E
e.salary
>
ANY
(SELECT
distinct
salary
FROM
employee s WHERE
s.department=5);
returns *2, 3, 4+ employees
Final Answer = Only Q2 is giving the correct
result
9.
DBMS
CATALOG
Pid
Cost
P1
P2
P3
P4
P5
P6
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 348
[Ans. B]
pid is a primary key, sname and city are
candidate keys. Hence all are prime
attributes and there is a relationship
between prime attributes hence it is not in
BCNF but in 3 NF
13.
[Ans. C]
In the given SQL query, we have to select
the pid in which the value of class filed is
AC. In the reservation table and age> 65
and the value of
passenger.pid= reservation.pid
So according to SQL Query
In this WHERE class = AC
So it select the pid = 0, 1, 5, 3 and for
SELECT *FROM passenger where age>65
and
Passenger.pid = reservation.pid from
passenger table we get the
Pid Pname Age
1
Rahul
66
2
Sourav 67
3
Anil
69
S Natural Join T
Borrower Bank Manager Loan Amount
Ramesh
Sunderajan 10000.00
Ramesh
Sunderajan 7000.00
Suresh
Ramgopal
5000.00
Ramesh
Sunderajan 10000.00
Ramesh
Sunderajan 7000.00
Query :SELECT Count(*)
FROM
((SELECT Borrower, Bank_Manager
FROM Loan_Records ) AS S
NATURAL JOIN
(SELECT Bank_Manger Loan_Amount
FROM Loan_Records) AS T);
Returns count =5
15.
16.
[Ans. C]
Borrower
Ramesh
Suresh
Mahesh
S
Bank_Manager
Sunderajan
Ramgopal
Sunderajan
T
Bank_Manager
Sunderajan
Ramgopal
Sunderajan
[Ans. A]
The entries inserted in order are
X 1 2 3 4
5
6
7
Y 1 3 7 15 31 63 127
One can also solve the recursion and find
out that Y = 2X 1
1
AC
3
AC
So the pid return from given query is(1, 3)
14.
DBMS
Loan_Amount
10000.00
5000.00
7000.00
th
[Ans. C]
P: An SQL query can contain a HAVING
clause even if it does not have a GROUT
BY clause
SELECT avg(salary)
FROM emp
HAVING avg(salary)
1000; Valid
SQL Statement, P is TRUE
Q: An SQL query can contain a HAVING
clause only if it has a GROUP BY clause
FALSE
R: All attributes used in the GROUP BY
clause must appear in the SELECT
clause
SELECT
avg(salary), min(salary),
max(salary)
FROM
emp
GROUP BY
deptno,gender;
VALID SQL Statement, R is FALSE.
S: Not all attributes used in the GROUP BY
clause need to appear in SELECT clause
TRUE
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 349
17.
[Ans. A]
A
=
(A )
ID
12
15
99
25
98
99
98
18.
ID
12
15
99
25
98
Name
Arun
Shreya
Rohit
Hari
Rohit
Rohit
Rohit
Age
60
24
11
40
20
11
20
Name
Arun
Shreya
Rohit
Hari
Rohit
C
ID
10
10
10
10
10
99
99
Age
60
24
11
40
20
Phone
2200
2200
2200
2200
2200
2100
2100
Area
02
02
02
02
02
01
01
[Ans. B]
In this (Select B. Age
from B
where B. Name = Arun)
19.
[Ans. B]
Inner query will have a join between
employee and departments and will
return dept id and hire date of
employees who are having location 1700
and latest line date (in sorted order)
20.
[Ans. C]
Will prove by taking the following
illustration with relation R and S as
follows:
R
S
a
a
1
1
1
1
2
2
2
2
Given Query:-SELECT * FROM R WHERE a
IN (SELECT S.a FROM S)
Option: (A) SELECT R.* FROM R,S WHERE
R.a = S.a
DBMS
21.
[Ans. D]
SalesRepId is a foreign key referring to
empId of the employee relation. Assume
that each employee makes a sale to at least
one customer.
EMPLOYEE
empId empName empDept
1
A
2
B
3
C
CUSTOMER
custId custName salesRepId rating
C1
1
GOOD
C2
1
GOOD
C3
2
GOOD
C4
2
BAD
C5
3
BAD
C6
3
BAD
empId = 1 Employee with all their
customers [C1, C2] having GOOD rating
empId = 2 Employee with one customer
having GOOD [C3] and other having BAD
[C4]
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 350
DBMS
custId
customer C
C.salesRepId= E.empID
C.rating < GOOD);
INNER QUERY
SELECT custId
FROM customer C
WHERE C.salesRepId = 1
AND C.rating < GOOD;
SELECT custId
FROM customer C
WHERE C.salesRepId =2
AND C.rating < GOOD
SELECT custId
FROM customer C
WHERE C.salesRepId =3
AND C.rating< GOOD;
OUT NOT
PUT EXISTS
No Qualified
rows
1
Not
row Qualified
2
Not
rows Qualified
[Ans. 19]
Key = (StudentName, StudentAge)
Composite Key
Composite Key Combination of 2
columns must be Unique
As 2 rows having same StudentName
Shankar. Obviously StudentAge should
not be fulfill the key. So X! = 19 [X can take
any value other than 19]
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 351
DBMS
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 352
(C)
(D)
DBMS
CS 2009
6.
Consider two transactions T1 and T2, and
four schedules S1, S2, S3, S4 of T1 and T2 as
given below:
T1: R1[x] W1 [x] W1 [y]
T2: R2 [x] R2 [y] W2 [y]
S1: R1[x] R2 [x] R2[y] W1 [x] W1 [y] W2 [y]
S2: R1[x] R2 [x] R2[y] W1 [x] W2 [y] W1 [y]
S3: R1[x] W1 [x] R2[x] W1 [y] R2 [y] W2 [y]
S4: R2[x] R2 [y] R1[x] W1 [x] W1 [y] W2 [y]
Which of the above schedules are conflictserializable?
(A) S1 and S2
(C) S3 only
(B) S2 and S3
(D) S4 only
CS - 2010
7.
Which of the following concurrency
control protocols ensure both conflict
serializability
and
freedom
from
deadlock?
I. 2-phase locking
II. Time-stamp ordering
(A) I only
(B) II only
(C) Both I and II
(D) Neither I nor II
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 353
8.
CS - 2012
9.
Consider the following transactions with
data items P and Q initialized to zero:
T1: read (P);
read(Q);
if P = 0 then Q: = Q + 1 ;
write (Q).
T2: read(Q);
read (P);
if Q = 0 then P: = P + 1 ;
write (P).
Any non-serial interleaving of T1 and T2
for concurrent execution leads to
(A) A serializable schedule
(B) A schedule that is not conflict
serializable
(C) A conflict serializable schedule
(D) A schedule for which a precedence
graph cannot be drawn
11.
DBMS
T2
T3
T4
Reads (X)
Writes(X)
Commit
Writes (X)
Commit
Writes (Y)
Reads(Z)
Commit
Reads (X)
Reads (Y)
commit
CS - 2014
10. Consider the following four schedules due
to three transactions (indicated by the
subscript) using read and write on a data
item x, denoted by r(x) and w(x)
respectively. Which one of them is conflict
serializable?
(A) r (x); r (x); w (x); r (x); w (x)
(B) r (x); r (x); w (x); r (x); w (x)
(C) r (x); r (x); r (x); w (x); w (x)
(D) r (x); w (x); r (x); r (x); w (x)
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 354
DBMS
[Ans. D]
Transactions must execute in order
T3 T2 T1.
Because if sales person XYZ Commission
= 49,999, then If T1 executes first then
its new commission would be
49,999 1.02 = 50,998 [which is greater
than 50,000]
Now if T2 executes second, then sales
person XYZ will get hike again, because
his commission is greater than 50,000
This is absolutely wrong.
So the perfect order of execution is
T3 T2 T1.
2.
[Ans. D]
Always, even if there is a failure of any
kind.
3.
[Ans. C]
In data base transaction system if
transaction is commit then it becomes
permanent there is no effect of any failure
so we need not redo log records 2 and 3
because transaction T1 has committed.
4.
[Ans. C]
Schedule S1 Not Conflict Serializable,
Since Cycle is formed.
Schedule S2 Confilict Serializable, Since
there is no cycle = Serial Schedule T2 T1
Schedule : S1
Schedule : S2
T1
T2
T1
T2
r1(x)
r1(x)
r1(y)
r2(x)
r2(x)
r2(y)
r2(y)
w2(y)
w2(y)
r1(y)
w1(x)
w1(x)
[Ans. B]
Schedule S2
T
R x
R
R
5.
T2
T1
x
y
x
y
y
Dependency graph T
cycles.
Schedule S3
T
R x
x
T S2 has no
T
y
y
T S Salso
Dependency graph T
has no cycles. So, S and S are conflict
serizlizable.
7.
[Ans. B]
In 2 phase locking concurrency control
protocol it ensures the conflict serilizable
schedule but it may not free from deadlock
Ex.
T
l(A)
l(A)
(A)
(B)
u(A)
Deny
T in waiting
T1
T2
l(A)
l(B)
(B)
(A)
T for unlock
[Ans. C]
T1: A required shared lock because it
reads only.
B requires exclusive lock because it
perform read and write operation.
T2 : similarly it performs shared lock on B
and exclusive lock on A.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 355
8.
[Ans. A]
Given Schedule Serializable, Since no
cycle is formed
Serial Order =T1 T3 T2
T1
T2
T3
Read(X)
Read(Y)
Read(Y)
Write(Y)
Write(X)
Write(X)
Read(X)
Write(X)
T
T1
DBMS
T2
Reads(X)
T3
T4
Writes(X)
Commit
Writes(X)
Commit
Writes(Y)
Reads (Z)
Commit
Reads (X)
Reads (Y)
Commit
T1
T2
T4
T3
T
T
12.
9.
[Ans. B]
T
r (P)
r (Q)
w (Q)
T
r (Q)
r (P)
w (P)
[Ans. D]
Schedule in option D
T
T
T
r(x)
w(x)
r(x)
r(x)
w(x)
Dependency graph (T ) (T ) (T )
Conflict serializable.
11.
[Ans. C]
Given Schedule is Recoverable since all
transactions read the committed data only.
Given Schedule is SerializableSince there is
no cycle in the graph
Equivalent Serializable Schedule =
T2 T3 T1 T4
th
[Ans. A]
Test for Conflict Serializability Precedence
Graph
Graph without Cycle Schedule is Conflict
Serializable
Graph with Cycle Schedule is NOT Conflict
Serializable
Schedule S1 No Cycle Conflict Serializable
Whereas Schedule S2 Cycle Not Conflict
Serializable
Schedule: S1
S1
T1
T2
T3
r1(X)
r3(Y)
r3(X)
r2(Y)
r2(Z)
w3(Y)
w2(Z)
r1(Z)
w1(X)
w1(Z)
No cycle schedule is conflict serializable
Equivalent serializable order =
T2 T3 T1
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 356
DBMS
r2(Z),w1(Z)
T1
T2
r2(Y),w3(Y)
r3(X),w1(X)
T3
Schedule: S2
S2
T2
T1
r1(X)
T3
r3(Y)
r2(Y)
r3(X)
r1(Z)
r2(Z)
w3(Y)
w1(X)
w2(Z)
w1(Z)
Cycle is formedSchedule is NOT conflict
serializable
Equivalent serializable order
= T2 T3 T1
r1(Z),w2(Z)
T1
T2
r2(Z),w1(Z)
r2(Y),w3(Y)
r3(X),w1(X)
T3
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 357
DBMS
File Structures
(Sequential files, Indexing, B and
CS - 2005
1.
Which one of the following is a key factor
for preferring B+ -trees to binary search
trees for indexing database relations?
(A) Database relations have a large
number of records
(B) Database relations are sorted on the
primary key
(C) B+ -trees require less memory than
binary search trees
(D) Data transfer from disks is in blocks
2.
4.
enrolled
paid
enrolled
Probe
index on
student
Sequential
scan, select
amount > x
Probe
index on
student
Indexed nested
loop join
paid
Sequential
scan
Indexed nested
loop join
Select on
amount > x
Project on
course
CS - 2006
3.
In a database file structure, the search key
field is 9 bytes long, the block size is 512
bytes, a record pointer is 7 bytes and a
block pointer is 6 bytes. The largest
possible order of a non-leaf node in a B+
tree implementing this file structure is
(A) 23
(C) 34
(B) 24
(D) 44
trees)
Project on course
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 358
6.
(A) 1
(B) 2
7.
(C) 3
(D) 4
CS - 2008
8.
Consider a file of 16384 records. Each
record is 32 bytes long and its key field is
of size 6 bytes. The file is ordered on a
DBMS
CS - 2009
10. The following key values are inserted into
a B+-tree in which order of the internal
nodes is 3, and that of the leaf nodes is 2,
in the sequence given below. The order of
internal nodes is the maximum number of
tree pointers in each node, and the order
of leaf nodes is the maximum number of
data items that can be stored in it. The
B+-tree is initially empty.
10, 3, 6, 8, 4, 2, 1. The maximum number
of times leaf nodes would get split up as a
result of these insertions is
(A) 2
(C) 4
(B) 3
(D) 5
CS - 2013
11. An index is clustered , if
(A) It is on a set of fields that form a
candidate key.
(B) It is on a set of fields that include the
primary key
(C) The data records of the file are
organized in the same order as the
data entries of the index
(D) The data records of the file are
organized not in the same order as
the data entries of the index
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 359
DBMS
2.
[Ans. D]
The transfer of data from disk to primary
memory is in the form of data blocks if a
data block is larger than indexing is easy
due to this
tree is better than binary
search tree data structure if large amount
of data can be access.
[Ans. A]
Final tree is
[Ans. A]
20
40
15
second level
third level
3.
4.
5.
7.
50
30
15
[Ans. A]
After deletion of K 50, we get following
- tree
20
[Ans. C]
Size of Key = K=9 Bytes
Size of Block = B = 512 Bytes
Size of Record Pointer = RP = 7 Bytes
Size of Block Pointer = BP = 6 Bytes
Order (non-leaf node) of B + Tree = n =?
(n BP) + (n
) K=B
(n 6) + (n
) 9 =512
n=CEIL (521/15) = CEIL (34.73) = 34
[Ans. C]
The seek time of disk is 4ms and data
transfer node is 300 MB/s. So if x = 5000
then plan 1 execute faster than plan 2 for
all database.
40
20 25
10
fourth level
50
30
30
15
10
15
20
25
40
30
40
So (i) is true
(ii) is also true
(iii) is false because root not remain
unchanged
8.
[Ans. C]
DATA FILE
File Ordered on Non Key field
Total no. of Records = 16384 records
Size of the Record = 32 Bytes
INDEX FILE
Type of Index = Secondary Index ( ey)
DENSE INDEX
Size of Key = 6 Bytes
Size of block pointer =10 Bytes
[Ans. A]
Order (leaf node) = max (value, record
pointers) = n =?
Size of Block = B = 1K bytes
= 1024 Bytes
Size of Record Pointer = RP = 7 Bytes
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 360
10.
DBMS
Insert: 4
4
3*
4*
8* 10*
6*
Insert: 2
4
[Ans. A]
A clustering index is defined on the fields
which are of type non-key and ordering.
2* 3*
4*
6*
8* 10*
Insert: 1
4
[Ans. C]
Insert into B+ Tree in the order 10, 3, 6,
8, 4, 2, 1 & Calculate the No. of leaf Splits
2
Max Pointers = 3
Min Pointers = CEIL (3/2) =2
Min Pointers for ROOT = 2
K1
I2
1* 2*
3*
4*
6*
8* 10*
Max Keys = 2
Min Keys = 1
[Ans. C]
Clustered if the data is ordered in same
order as the index order
Insert : 10
10*
Insert: 3
3* 10*
Insert: 6
6
3*
6*
1
10*
Insert: 8
6
3*
6*
8* 10*
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 361
Computer Networks
CS 2007
3.
Match the following :
P. SMTP 1. Application layer
Q. BGP
2. Transport layer
R. TCP
3. Data link layer
S. PPP
4. Network layer
5. physical layer
(A) P 2, Q 1, R 3, S 5
(B) P 1, Q 4, R 2, S 3
(C) P 1, Q 4, R 2, S 5
(D) P 2, Q 4, R 1, S 3
4.
CS 2008
6.
How many bytes of data can be sent in 15
seconds over a serial link with baud rate
of 9600 in asynchronous mode with odd
parity and two stop bits in the frame?
(A) 10,000 bytes
(C) 15,000 bytes
(B) 12,000 bytes
(D) 27,000 bytes
CS 2014
7.
In the following pairs of OSI protocol
layer/sub-layer and its functionality. The
INCORRECT pair is
(A) Network layer and Routing
(B) Data
Link
Layer
and
Bit
synchronization
(C) Transport layer and End-to-end
process communication
(D) Medium Access Control sub-layer
and Channel sharing
8.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 362
Computer Networks
[Ans. B]
Spanning Tree Algorithm is used for
bridges for avoiding loops in the routing
paths. Spanning Tree algorithm will make
sure that there will be only one path
between every 2 LANs
2.
[Ans. D]
Consider choices
(A) Packet size = 4 then message size =
4 3 = 1 byte (required 24 packets)
(B) Packet size = 6 then message size =
6 3 = 3 bytes (required 8 packets)
(C) Packet size = 7 then message size =
7 3 = 4 bytes (required 6 packets)
(D) Packet size = 9 then message size =
9 3 = 6 bytes (required 4 packets)
So 4 packets is optimum message size & 9
is optimum packet size.
3.
[Ans. B]
SMTP ---------- Application layer
BGP ------------ Network layer
TCP ------------ Transport layer
PPP ------------- Data link layer
4.
[Ans. C]
Total no. of source = 10
Packet size = 1000 bits
Output capacity of multiplexer= 5000 bits
Average number of backlogged of
packet = 3.45
5.
[Ans. D]
Mean Number of hop = 5.26
6.
[Ans. B]
How many bytes of data can be sent in 15
seconds?
Baud Rate = 9600 [9600 signals can be
transmitted per second]
[Ans. B]
Since Bit Synchronization
Physical
Layer Responsibility, Its not Data Link
Layers Responsibility
8.
[Ans. B]
8-bit delimeter = 01111110 We will
stuff with 0 after every 5 consecutive 1s
Output String = 011111 00101 [Stuffed
bit has been highlighted]
Then, Input String = 0111110101 [After
destuffing the stuffed 0]
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 363
Computer Networks
3.
4.
5.
CS 2006
6.
Station A needs to send a message
consisting of 9 packets to Station B using
a siding window (window size 3) and
go-back-n error control strategy. All
packets are ready and immediately
available for transmission. If every 5th
packet that A transmits gets lost (but no
acks from B ever get lost), then what is
the number of packets that A will
transmit for sending the message to B?
(A) 12
(C) 16
(B) 14
(D) 18
CS 2007
7.
In Ethernet when Manchester encoding is
used the bit rate is
(A) Half the baud rate
(B) Twice the baud rate
(C) Same as the baud rate
(D) None of these
8.
1
(B) (1 p)
(D) 1 (1 p)n 1
9.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 364
10.
11.
12.
14.
Computer Networks
CS 2013
15. Determine the maximum length of the
cable (in km) for transmitting data at a
rate of 500 Mbps in an Ethernet LAN with
frames of size 10,000 bits. Assume the
signal speed in the cable to be
2,00,000 km/s.
(A) 1
(C) 2.5
(B) 2
(D) 5
CS 2008
13. A computer on a 10Mbps network is
regulated by a token bucket. The token
bucket is filled at a rate of 2Mbps. It is
initially filled to capacity with 16
Megabits. What is the maximum duration
for which the computer can transmit at
the full 10Mbps?
(A) 1.6 seconds
(C) 5 seconds
(B) 2 seconds
(D) 8 seconds
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 365
Computer Networks
[Ans. C]
CSMA/CD is not suitable for a high
propagation delay network like satellite
network.
2.
[Ans. A]
Access Method = CSMA/CD
Bandwidth = B = 1Gbps = 109 bits/sec
Distance = d = 1km = 103 mts
Speed of Signal = s = 2 108 mts/sec
Minimum Frame Size =
=?
= 2 d/s B bits
= 2
3.
4.
5.
[Ans. C]
109=10,000 bits
[Ans. D]
Bandwidth = B = 4 Kbps
= 4 103 bits/sec
Propagation Delay = Tp = 20 ms
= 20 10 sec
Protocol = Stop-and-Wait
Transmission Time for Ack = Negligible
= 0 sec
Channel Efficiency = 50% = 1/2
[Utilization]
Minimum Frame Size = F = ?
T
fficiency
T
2T
1
2
2 20 10
4 10
160 bits
[Ans. C]
2
n
10
3
6.
Number of packets = 16
7.
[Ans. A]
Manchester ncoding
2 signals will be
used for sending 1-bit. For sending 10
bits, we have to send 20 signals. Hence
baud rate is twice the bandwidth.
Bandwidth = Baud rate/2 [Half the baud
rate]
8.
[Ans. A]
p(1) = n p 1
=
n
1 n 1
= np 1
100
15 10
10
9.
p 1
[Ans. C]
LAN = Token Ring
Bandwidth = B = 10 bits/sec
Propagation Speed = 200 mts/micro
seconds [signal travels 200 meters in
10 seconds]
1 bit delay in this network = ?
As B= 10 bits/sec, To place 1-bit in the
channel it takes 10 sec
As signal travels 200 meters in 10-6
seconds, then how much distance 1-bit
travels in 10 sec ?
10 seconds 200 meters
10 seconds ? meters
= 20 meters
[Ans. C]
Round
trip
propagation
delay
(2 T ) 46.4 sec 46.4 10
Frame size
2 T
andwidth
46.4 10
10 10
464 bits
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 366
10.
[Ans. B]
Polling delay 80 s
Max t
8000 bits, 800 s at 10 Mbps
Max throughput =
10
DR
10 Mbps
11.
[Ans. C]
LAN = Token Ring
Total no. of Stations = N = 10
Ring Latency = t = 5 ms
Transmission Time = t = 3 ms
Max Utilization
U = (N t ) / ((N t +t )
= (103) / ((103) + 5)
= 30/35
= 0.857
12.
[Ans. D]
LAN = Token Ring
Total no. of Stations = N = 15
Ring Latency = t = 3 ms
Transmission Time = t = 5 ms
Max Utilization
U= (N t ) / ((N t )+ t )
= (155) / ((155 )+ 3)
= 75/78
= 0.961
13.
[Ans. B]
Bandwidth = B =10 Mbps
Token Bucket filled at the rate = r
= 2 Mbps
Capacity of Token Bucket = C
= 16 Mega bits
Max Duration at which computer can
transmit at fully 10 Mbps rate = S = ?
S = C/(B r)
= 16/(10 2)
= 2 seconds.
14.
[Ans. B]
Min frame size
15.
2
2
Computer Networks
[Ans. B]
Distance of the Cable = d = ? [in kms]
Bandwidth = B = 500 Mbps
= 500 106 bits/sec
LAN = Ethernet Access Control
Protocol = 1 Persistent CSMA/CD
Size of Frame = F = 10,000 bits
Speed of Signal = S = 2,00,000 km/sec
d
2
bits
s
10,000 = 2 (d/ 2, 00,000) 500 106
d = 2 kms
data rate
10
2 10
10
2 10
2000 bits = 250 bytes
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 367
Computer Networks
(B) 2
(D) 2
2.
CS 2006
3.
Station A uses 32 byte packets to transmit
messages to station B using a sliding
window protocol. The round trip delay
between A and B is 80 milliseconds and
the bottleneck bandwidth on the path
between A and B is 128 kbps. What is the
optimal window size that A should use?
(A) 20
(C) 160
(B) 40
(D) 320
4.
5.
]
]
(C) [log
(D) [log
CS 2008
8.
Data transmitted on a link uses the
following 2D parity scheme for error
detection :
Each sequence of 28 bits is arranged
in a 4 7 matrix ( rows r through r ,
and columns d thorugh d ) and is
padded with a column d an row r of
parity bits computed using the Even
parity scheme . Each bit of column d
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 368
10.
11.
Computer Networks
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 369
15.
Computer Networks
(A)
(B)
(C)
(D)
R2
R1
T1 T2 T3
T1 T2 T3
T2 = T3 , T3 < T1
T1 = T3, T3 > T2
[Ans. B]
In the case of selective reject protocol; the
maximum window size =
2.
3.
[Ans. B]
Given round trip delay
t = 80 ms = 80 10
R = 128 Kbps = 128 10 bps
L = Rt = 128 10 80 10
So, optimal window size
[Ans. A]
Message = data word=1010001101
Divisor x
x
x
1
110101 6 bits]
CRC = ? [Remainder]
Augmented data word
= data word + 5 bits[zeros]
= 101000110100000
110101 101000 1101010110
110101
111011
110101
011101
000000
111010
110101
011111
000000
111110
110101
n
4.
[Ans. C]
Ethernet frame include a CRC field and IP
packet include a checksum field.
5.
[Ans. C]
The link later uses a window from control
protocol with a window size of N packets
and round trip time is equal to N units.
Goodput = Packets/unit time
= N packets/N units = 1.
6.
[Ans. B]
Message = data word =11001001
Divisor x
1
1. x
0. x
0. x
1. x
1001 4 bits]
Code word
= data word +3 redundant bits =?
Augmented dataword = 11001001 000
010110
000000
101100
110101
110010
110101
001110
000000
01110
40
01110
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 370
9.
[Ans. C]
The polynomial generator used for CRC
checking must satisfy at least two
conditions to detect odd numbers of
errors:
1. It should be not divisible by x
2. It should be divisible by 1 + x
Therefore 1 x is a factor of G(x)
10.
[Ans. D]
The link is a duplex hence we need not to
wait for twice the propagation time for
sending the frame belonging to next
window. If the sender window is of size N.
Transmitting 10 bits require = 1 sec
1
N 1000 bits require
N 10
10
N 10 sec Nm sec
Nm sec = 25 m sec, N = 25 2
Minimum number of bits required is 5 to
represent sequence numbers distinctly
11.
[Ans. B]
Time taken to send 10 bits 1 sec
Time taken to send 2 frames = 32 m sec
(1 frame = 1000 bits)
Time taken for the first frame to be
acknowledged 25 2 50 m sec
Then waiting time 50 32 18 m sec
12.
[Ans. A]
Size of files = 10
Total Routes = 2{ , }
Total links = 3 { , , }
Length of each Link
= d= 100 km = 100 10
Speed of signal of each link
= s= 10 mts Sec
Remainder 011
Code word = Data word + Remainder
11001001 011
7.
[Ans. C]
Frame Size = K bit
Propagation delay = t sec/km
Channel capacity = Rbits/sec
Distance = L km
Round trip delay = 2Lt sec.
Window size w =
1
1
# of bits = log
8.
[Ans. C]
The receiver will calculate all the row and
column parities and found that there is an
error in 1-row and 2- columns.
No. of errors detected in rows = 1 [r1]
No. of errors detected in columns = 3 [d5,
d2, d0]
Minimum possible errors
= max (errors in rows, errors in columns)
= max (1, 3) = 3 errors.
0
Computer Networks
L1
S
1
0
1
0
0
1
0
0
0
0
1
1
1
0
0
1
L2
R
d= 100 kms
s = 10 mts sec
L3
R
d= 100 kms
s = 10 mts sec
D
d= 100 kms
s = 10 mts sec
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 371
P4
S
L1
P3
P2
L2
14.
P1=6 ms
L3
Computer Networks
[Ans. *] Range 28 to 30
Total number of Stations in the Ring = n
= 10 stations [including monitor station]
Length (or) distance of Ring
= 2 km = 2
10 mts
Propagation Speed = 2
10 m/s
Token Holding time of each station
= 2 micro seconds = 2
10 seconds
Ignore token transmission time
Minimum time monitor station should
wait before assuming that token is lost is
= ? [in Micro Seconds]
Minimum time monitor station should get
the token = (n 1) token holding time +
ring latency
th
[Ans. 5]
Size of Frame = F = 1KB = 1024 Bytes
= 1024 8 bits
Bandwidth
1.5 Mbps
1.5
10 bits/sec
One Way Latency= Propagation
Time = T = 50 msec 50 10 sec
Utilization = 60% = 60/100
Minimum number of bits required to
represent the sequence number= ?
Let window size = number of frames in
sender window = n
Utilization
= n F bits / (F + 2 B) bits
60
n
1024 8 bits 1024
8
100 2
2
50
10
1.5
10 bits
n
60 1024
8
2
50
10
2
1.5
10
1024
8
100
n 949152
11.58
12 approx
2
81920
n = 24
Total number of Frames in Sender
Window = Sender Window Size
= 24 frames.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 372
Computer Networks
[Ans. D]
Given Bandwidth = 10 bytes/sec
L 10 bytes
Case: 1
L = 1000 bytes
Header size = 100 bytes
Total Frame size = 1000+100=1100
bytes
1100 8
T
1100 s
10
8
So, T
3300 s
Case: 2
L 100 bytes
Header size = 100 bytes
Total Frames size = 100 + 100 = 200 bytes
T
or 10 packets T
2000 s
So, T
2000 200 200 2400 s
Case: 3
L = 50 bytes
Header size = 100 bytes
Total frame size = 50 + 100 = 150 bytes
T
or 20 packets T
So, T
3000 150
T
T
T
T
3000 s
150 3300 s
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 373
Computer Networks
2.
3.
(A)
Table for
node A
A B B 1
C C 1
D B 3
E C 3
F C 4
(C)
Table for
node B
A A 1
B C C 1
D D 1
E C 2
F D 2
(B)
Table for
node C
A A 1
B B 1
C D D 1
E E 1
F E 3
(D)
Table for
node D
A B
B B
C C
D
E E
F F
3
1
1
1
1
CS 2008
4.
Two popular routing algorithms are
Distance vector (DV) and Link state (LS)
routing . Which of the following are true?
S1: Count to infinity is a problem only
with DV and not LS routing
S2: In LS, the shortest path algorithm is
run only at one node
S3: In DV, the shortest path algorithm is
run only at one mode
S4: DV requires lesser number of network
messages than LS
(A) S1, S2 and S4 ONLY
(B) S1, S3 and S4 ONLY
(C) S2 and S3 ONLY
(D) S1 and S4 ONLY
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 374
CS 2010
Statement for Linked Answer Questions 5
and 6:
Consider a network with 6 routers R1 to
R6 connected with links having weights
as shown in the following diagram.
7
R2
AS
6
R1
4
R3
6.
R6
5.
R5
CS 2011
Statement for Linked Answer Questions 7
and 8:
Consider a network with five nodes, N1 to
N5 as shown below
N1
1
N5
N2
N4
R4
N3
Computer Networks
7.
8.
CS 2012
9.
An Internet Service Provider (ISP) has the
following chunk of CIDR-based IP address
available with it: 245.248.128.0/20. The
ISP wants to give half of this chunk of
addresses of Organization A, and a
quarter of Organization B, while retaining
the remaining with itself. Which of the
following of a valid allocation of
addresses to A and B?
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 375
Computer Networks
12.
13.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 376
Computer Networks
2.
3.
4.
5.
[Ans. B]
Associated with distance vector routing
algorithm
[Ans. C]
Table for node B
A
A
B
C
C
D
D
E
C
F
D
Routing table
For R1
R2
R3
R4
R5
R6
1
1
1
2
2
R1
R2
R3
R4
R5
R2
R3
R4
R5
R6
12
7
9
1
5
Next hop
R2
R2
R2
R5
R5
12
8
9
1
4
Next hop
R3
R4
R3
R4
R6
For R4
R1
R2
R3
R5
R6
[Ans. C]
For R5
R4
8
6
R1
3
2
9
9
13
Next hop
R1
R2
R4
R5
R5
For R3
[Ans. D]
S1 True, Since ount To Infinity is only
a problem with DV but not LS
S2
alse, since in LS, the shortest path
algorithm is run at all nodes
S3
alse, since in DV, we dont use any
shortest path algorithm
S4 True, since in DV, each node shares
its routing table only with its
neighbors, where as inLS each node
broadcast its routing table to all
nodes in the network.
5
2
7
8
12
Next hop
R3
R3
R4
R4
R4
For R2
[Ans. A]
Node A goes down at time t. At time
t 100 the cost from Node to node
A will definitely be > 100 and finite,
because Node will receive cost from
neighbor D where as D will have 3
neighbors {B, C, E} and at least one
neighbor will give finite cost.
R2
5
3
12
12
16
Next hop
R3
R3
R3
R3
R3
R3
R5
R1
R2
R3
R4
R6
R6
4
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 377
For R6
9.
[Ans. A]
Network ID = 245.248.128.0/20
alf of this IP addresses to A
ISP wants
VLSM
Quarter to Organization
to give
Retaining the remaining with
itself [Quarter]
Total subnets 2
2 level subnetting
osts Subnet 2
2
Next hop
R1
16
R5
R2
12
R5
R3
13
R5
R4
5
R5
R5
4
R5
So it is clear visualize from the all routing
table construction that we never use the
direct path between
6
R1
R2
and
R4
Computer Networks
R6
[Ans. B]
After changing the weights of unused link
R1 R2 & R4 R6 to 2. Then the no. of
unused links are only one [R5 R6]
R2
R4
6
R1
8
2
R6
4
R3
R5
Link R5-R6 will
be unused
7.
8.
[Ans. A]
In the next round, every node will send
and receive distance vectors to and from
neighbours, and update its distance
vector. N3 will receive (1, 0, 2, 7, 3) from
N2 and it will update distance to N1 and
N5 as 3 and 5 respectively
Total soultions 2
S. No
Organization Network ID/
Subnet mast
A 50
245.248.128.0 21
1
25
245.248.136.0 22,
245.248.140.0/22
A 50
245.248.136.0 21
2
25
245.248.128.0 22,
245.248.140.0/22
[Ans. C]
In the next ground, N3 will receive
distance from N2 to N1 as infinite. It will
receive distance from N4 to N1 as 8. So it
will update distance to N1 as 8+2 =10
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 378
10.
Computer Networks
[Ans. C]
Network Layer = 4 times &
Data link layer = 6 times
S
Network
Network
Data link
Data link
Physical
Physical
11.
[Ans. D]
S1 True, since in Link State Routing
every node has to execute the
shortest path algorithm.
S2
False, since looping problem is not
eliminated completely by Split
Horizon.
S3 True, since in Link State each node
broadcast the topology changes to
all other nodes in the network,
where as Distance Vector informs
only to its neighbors.
12.
[Ans. 1]
IP Address = 131.23.151.76
Binary Value of given IP Address =
10000011. 00010111. 10010111.
0100110
We always compare the IP with the
Highest Mask.
131.19.0.0/16
10000011.00010011.00000000.
00000000 Match Failed
131.22.0.0/15
10000011.00010110.00000000.
00000000 Match Success
As the first 15 network bits of
131.22.0.0/15 and 131.23.151.76 are
same. So the outgoing interface will be
1.
13.
[Ans. A]
RIP Routing Information Protocol uses
Distance Vector Routing Algorithm
OSPF Open Shortest Path First Protocol
uses Link State Routing Algorithm
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 379
Computer Networks
3.
4.
5.
6.
7.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 380
CS 2006
8.
For which of the following reason does
Internet Protocol (IP) use the
time-to-live (TTL) field in the IP
datagram header?
(A) Ensure packets reach destination
within that time
(B) Discard packet that reach later than
that time
(C) Prevent packets from looping
indefinitely
(D) Limit the time for which a packet
gets queued in intermediate routers
9.
10.
Computer Networks
11.
12.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 381
(C)
B1
H2
H1
B3
H6
H5
1 B4
3
H9
13.
14.
H4
H3
2
B5
Computer Networks
H10
H8
B2
H12
H11
Port
3
1
4
CS 2007
15. The address of a class B host is to be split
into subnets with a 6 bit subnet number.
What is the maximum no. of subnets and
the maximum no. of hosts in each subnet?
(A) 62 subnets and 262142 hosts
(B) 64 subnets and 262142 hosts
(C) 62 subnets and 1022 hosts
(D) 64 subnets and 1024 hosts
16.
17.
(B)
Hosts
H1, H2
H3, H4
H5, H6
H7, H8, H9, H10
H11, H12
Hosts
H1, H2, H3, H4
H5, H7, H9, H10
H7, H8, H11, H12
Hosts
H1, H2, H3, H4
H5, H6, H9, H10
H7, H8, H11, H12
Port
3
1
4
2
(D)
H7
Hosts
H3, H4
H5, H6, H9, H10
H1, H2
H7, H8, H11, H12
Port
4
3
1
2
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 382
CS 2008
19. What is the maximum size of data that the
application layer can pass on to the TCP
layer below?
(A) Any Size
(B) 216 bytes size of TCP header
(C) 216 bytes
(D) 1500 bytes
20.
21.
Computer Networks
23.
CS 2009
24. While operating a TCP connection, the
initial sequence no. is to be derived using
a time of day (TOD) clock that keeps
running
even when the host is down.
The low order 32 bit of the counter of the
TOD clock is to be used for the initial
sequence numbers. The clock counter
increments once per milli second. The
maximum packet lifetime is given to be
64s.
Which one of the choices given
below is closest to the minimum
permissible rate at which sequence
numbers used for packets of
a
connection can increase?
(A) 0.015/s
(C) 0.135/s
(B) 0.064/s
(D) 0.327/s
CS 2010
25. One of the header fields in an IP datagram
is the Time-to-Live (TTL) field. Which of
the following statements best explains the
need for this field?
(A) It can be used to prioritize packets.
(B) It can be used to reduce delays.
(C) It can be used to optimize
throughput.
(D) It can be used to prevent packet
looping.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 383
26.
CS 2012
27. In the IPV4 addressing format, the
number of networks allowed under Class
C address is
(A) 2
(C) 2
(B) 2
(D) 2
28.
29.
CS 2013
30. The transport layer protocols used for
real time multimedia, file transfer, DNS
and email, respectively are
(A) TCP, UDP, UDP and TCP
(B) UDP, TCP, TCP and UDP
(C) UDP, TCP, UDP and TCP
(D) TCP, UDP, TCP and UDP
31.
Computer Networks
CS 2014
32. Let the size of congestion window of a
TCP connection be 32 KB when a timeout
occurs. The round trip time of the
connection is 100 msec and the maximum
segment size used is 2 KB. The time taken
(in msec) by the TCP connection to get
back to 32 KB congestion window is _____.
33.
34.
ISP2
LAN L2
S LAN L1
35.
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 384
37.
Computer Networks
2.
3.
[Ans. B]
In both TCP & UDP, packets of same
session will be routed in different paths,
because they are using IP protocol in the
Network Layer which is purely a
connection less protocol. Theoretically we
say that TCP is connection oriented
protocol, it doesnt mean that packets of
same session will travel in the same path,
we are simulating the connection by using
buffers at both sender and receiver.
Finally TCP is using a Virtual connection.
[Ans. D]
ARP: Finding the MAC address that
corresponds to an IP address
[Ans. D]
In a class B network initial two octets are
all 1s but third octet specifies the
physical network for subnet of 64
department or 2 so initial 6 bits of third
octets are 1s
11111111 . 11111111 .11111100 . 00000000
255
.
255
.
252 .
0
4.
[Ans. C]
ICMP reply packet is returned to A by
each router en-router to B.
5.
[Ans. B]
Congestion window = cwnd = 4KB
Receiver window = rwnd = 6KB
Current Window Size = min(cwnd, rwnd)
= min(4KB, 6KB) = 4KB
Just to confuse us they provided the
additional information like Last Byte Sent
and Last Byte Acknowledged, which are
totally not required in finalizing the
window size.
6.
[Ans. A]
Probability (p via L = 1 b
Probability (p via L = 1 b
Probability p) via L or L = p
7.
p
p
p
[Ans. D]
Class of network = class-C network
[n=24, h=8] [25h hosts/Network]
Network Address = 204.204.204.0
Requirement = 3 subnets
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 385
Subnet No of Hosts/Subnet
1
100
2
50
3
50
Types of subnetting = VLSM
No of subnets = 2
No of hosts/subnet =2
2
2 levels subnetting required.
Initially Total Subnets = 2 2
2
n 1 1 bit to be taken from host
n 25
h 8
9.
[Ans. C]
The two computers
configured as follows:
IP address
and
8.
1
2
3
1
2
3
are
203.197.75.201
AND
255.255.128.0
255.255.192.0
203.197.0.0
203.197.64.0
Network address
Network address
203.197.2.53 203.197.00000010.00111001
255.255.192.0 255.255.11000000.00000000
203.197.0.0
203.197.0.0
203.197.75.201
255.255.128.0
203.192.0.0
10.
[Ans. C]
Boolean And (Destination Address, Mask)
Must give the Network ID
Given Destination Address =
144.16.68.117 = 144.16.68.01110101
Router always considers the Highest
Mask first, then second highest, and so
on
First Highest Mask:Destination Network ID =144.16.68.64
and Mask = 255.255.255.224
Boolean And (144.16.68.117,
255.255.255.224)=144.16.68.96 Not
matching with NetworkID
Second Highest Mask:Destination Network ID =144.16.68.0 and
Mask = 255.255.255.0
Boolean And (144.16.68.117,
255.255.255.0)=144.16.68.0 Matched
with Network ID
Hence, the outgoing interface = Eth2
11.
[Ans. A]
Because UDP generate the error that
machine you are trying to reach is not
responding unlike TCP.
12.
[Ans. D]
Broadcast Address with in a network
All host bits will be 1s. ontinuous 1s]
We cannot confidently say the exact no. of
network bits in a subnetted network.
As all options are appropriate for the
given question.
Total solution = 2
Hosts/
subnet
100
50
50
100
50
50
203.197.2.53
and
Netmask
S. No Subnet
Computer Networks
[Ans. C]
TTL field in IP Datagram To prevent
packets from looping indefinitely.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.comPage 386
1024
[Ans. B]
TCP is using an appropriate RTT
estimation algorithm to set the timeout
value of a TCP connection. It is dynamic
and will change with every segment.
Initial value of RTT is greater than that of
twice the propagation delay.
17.
[Ans. D]
Difference between two consecutive
packets is amount of data carried in first
packet.
Here, 290 230 = 60
X = 60
Y = 230
18.
[Ans. A]
Application layer can pass data of Any
Size to Transport Layer. The Transport
Layer can send data of any size in
multiple segments. Segmentation &
Reassembly is the responsibility of
Transport Layer to send data of any size
given by the application layer.
19.
[Ans. B]
The maximum size of data that the
application layer can pass on to the TCP
layer is 2 bytes size of TCP header.
[Ans. A]
By looking at the above diagram Bridge
3 will broadcast to all the hosts as
follows:Hosts
Port
H1, H2, H3, H4
3
H5, H6, H9, H10
1
H7, H8, H11, H12
2
20.
[Ans. C]
11111111 . 11111111 . 11111000 .
00000000
No. of hosts per subnet
=2
2 2048 2= 2046
21.
[Ans. C]
Connect ( ) system call returns an error.
[Ans. C]
The class B is defined as follows
22.
[Ans. D]
In the slow start phase, the size of the
congestion window increases exponentially.
23.
[Ans. D]
Connect system call is responsible for
synchronize the packets
[Ans. A]
Spanning tree for the given diagram is as
follows:B1
H1 H2
H3 H4
3
2
1
B5
B3
2
H5 H6
H7 H8
B4
B2
H9 H10
H11 H12
15.
16.
14.
2
1022
Computer Networks
0
1
16
0
net id
31
host id
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.comPage 387
24.
[Ans. B]
0.064 is closest to the minimum
permissible rate at which sequence
number used for packet of a connection
can increase.
25.
[Ans. D]
Whenever Time to live field reaches 0
we discard the packet. So, it can be used
to prevent packet looping
26.
27.
[Ans. C]
Numbers of networks in class are 2
as in class there
28.
[Ans. D]
IP address of A = 10.105.1.113
10.105.1.01110001
IP address of B = 10.105.1.91
10.105.1.0101011011
29.
For finding network address we take AND
of IP address with the netmask N. So we
check one by one.
(A) (i) 255.255.255.0 = N
10.105.1.01110001
Taking AND
10.105.1.00000000
IP address of A
[Ans. C]
UDP and TCP are transport layer protocol.
TCP supports electronic mail.
Option correct
[Ans. C]
1st 2 MSS
} Slow Start
2nd 4 MSS
3rd 8 MSS
4th 9 MSS } additive increase
5
10
Time out threshold
8 4
6th
7th
8th
9th
10th
Computer Networks
30.
[Ans. C]
Real time multimedia UDP
File transfer - TCP
DNS UDP
Email TCP
31.
[Ans. C]
M = 0: Means to more fragmentation so it
represent the last fragment.
HLEN = 10:
Header length 10 4 40 bytes
Payload: 400 40 360 bytes [0 to 359]
Fragment offset : 300 means
300 8 2400 bytes
Sequence number of first fragment = 2400
Sequence number of last fragment
= 2400 + 359
= 2759
Option (C) is correct
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.comPage 388
32.
Round
Threshold
Current
Congestion
Window
2KB
4KB
16KB
8KB
16KB
16KB
16KB
18KB
16KB
Phase
100msec
Slow-Start
Phase
Slow-Start
Phase
100msec
16KB
Congestion
Avoidance
Phase
100msec
20KB
16KB
100msec
22KB
16KB
Congestion
Avoidance
Phase
Congestion
Avoidance
Phase
24KB
16KB
100msec
26KB
16KB
10
28KB
16KB
11
30KB
16KB
12
32KB
16KB
Congestion
Avoidance
Phase
Congestion
Avoidance
Phase
Congestion
Avoidance
Phase
Congestion
Avoidance
Phase
Congestion
Avoidance
Phase
100msec
ISP1
30
ISP2
27
26
LAN L2
35.
[Ans. D]
Host A sends a datagram D to Host B and
it has been delivered successfully.
All the 3 given options can change while
datagram D reaches ost .
1) TTL It decrements at every router.
[Initial Value will be different from the
final value]
2) Checksum As IPV4 header will be
reconstructed at every router;
obviously checksum also will be
calculated at every router. So the
initial value of checksum will be
different from the final value.
3) Fragment Offset Any intermediate
router can fragment the packet if
packet size is greater than maximum
transmission unit [MTU] of the next
network. So obviously the initial value
of fragment offset will be different
from the final value.
36.
[Ans. 256]
Given that each host has a globally unique
IPV4 address and we have to design
50 bit unique Id. So, 50 bit in the sense
(32 + 18). So, it is showing that IP
Address (32 bit) followed by 18 bits.
1000 unique Ids 1 sec
2 unique ids 2 1000 2
256
100msec
100msec
100msec
100msec
1200 msec
33.
31
29 28
S LAN L1
100msec
100msec
[Ans. 26]
Initial TTL Value = 32
TTL value will be decremented by 1 at
each Router on the way to the
Destination.
TTL value will be 26 when packet reaches
R
32
Round
Trip Time
Slow-Start
Phase
Slow-Start
Phase
Computer Networks
[Ans. C]
The listen function converts an
unconnected socket into a passive socket,
indicating that the kernel should accept
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.comPage 389
37.
Computer Networks
[Ans. A]
Size of received IP Datagram
= 4404 bytes = 20 byte IP Header + 4384
payload
Maximum Transmission unit [MTU]
= 1500 bytes
Obviously, Router will fragment the 4384
Payload as follows:
S.No
1
2
3
Size of
1500
1500
1444
Datagram
IP Header
200
20
20
Payload
1480
1480
1424
MF bit
1
1
0
Value
Starting
0
1480
2960
Payload
Byte No
Ending
1479
2959
4383
Payload
Byte No
Fragment
0/8 =
1480/8 2960/8
Offset
0
= 185
= 370
Thus for 3 IP fragment values are as
follows:
Size of Datagram = 1444 bytes
MF bit Value = 0 [Since this is the last
fragment]
Fragment Offset = 370
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.comPage 390
Computer Networks
Application Layer
CS 2005
1.
A HTML form is to be designed to enable
purchase of office stationery. Required
items are to be selected (checked). Credit
card details are to be entered and then
the submit button is to be pressed. Which
one of the following options would be
appropriate for sending the data to the
server? Assume that security is handled
in a way that is transparent to the form
design.
(A) only GET
(B) only POST
(C) either of GET or POST
(D) neither GET nor POST
CS 2006
2.
HELO and PORT, respectively
commands from the protocols
(A) FTP and HTTP
(B) TELNET and POP3
(C) HTTP and TELNET
(D) SMTP and FTP
are
CS 2008
3.
Provide the best matching between the
entries in the two columns given in the
table below:
I
Proxy Server a.
Firewall
II
aZaA, D
b.
Caching
III
SLIP
c.
P2P
IV
DNS
d.
PPP
(A) I a, II d, III c, IV b
(B) I b, II d, III c, IV a
(C) I a, II c, III d, IV b
(D) I b, II c, III d, IV a
CS 2010
4.
Which one of the following is not a clientserver application?
(A) Internet chat
(C) E-mail
(B) Web browsing
(D) Ping
CS 2011
5.
Consider different activities related to
email
m1: Send an email from a mail client to a
mail server
m2: Download an email form mailbox
server to mail client
m3: Checking email in a web browser
Which is the application level protocol
used in each activity?
(A) m1: HTTP m2: SMTP m3: POP
(B) m1: SMTP m2: FTP m3: HTTP
(C) m1: SMTP m2: POP m3: HTTP
(D) m1: POP m2: SMTP m3: IMAP
CS 2012
6.
The protocol data unit (PDU) for the
application layer in the Internet stack is
(A) Segment
(C) Message
(B) Datagram
(D) Frame
CS 2014
7.
Identify the correct order in which the
following actions take place in an
interaction between a web browser and a
web server.
1. The web browser requests a webpage
using HTTP.
2. The web browser establishes a TCP
connection with the web server.
3. The web server sends the requested
webpage using HTTP.
4. The web browser resolves the
domain name using DNS.
(A) 4,2,1,3
(C) 4,1,2,3
(B) 1,2,3,4
(D) 2,4,1,3
8.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 391
webpage
loading
(including
the
embedded image)?
(A) Q needs to send at least 2 HTTP
requests to S, each necessarily in a
separate TCP connection to server S
(B) Q needs to send at least 2 HTTP
requests to S, but a single TCP
connection to server S is sufficient
(C) A single HTTP request from Q to S is
sufficient, and a single TCP
connection between Q and S is
necessary for this
(D) A single HTTP request from Q to S is
sufficient, and this is possible
without any TCP connection between
Q and S
9.
Computer Networks
2.
[Ans. D]
HELO and PORT commands are from
the protocol SMTP and FTP.
3.
[Ans. D]
Proxy server
KaZaA, DC++
SLIP
DNS
4.
5.
[Ans. C]
GET or POST can be used sending the
data to the server.
aching
P2P
PPP
irewall
[Ans. D]
Ping is utility to check connectivity either
between client-client or client-server
6.
[Ans. C]
PDU is called a message in application
layer, segment in transport layer,
datagram in network layer and frame in
data link layer
7.
[Ans. A]
Firstly DNS will translate the URL into IP
address, then TCP connection will be
established. After that browser will
request for webpage and at the end
server will respond for request
8.
[Ans. B]
Q: Client Accessing a Static HTML web
page from HTTP Server
S: Server Static HTML page has exactly
one Static mbedded Image located in S
only
No Caching
How HTML Web Page Loads?
HTTP Uses TCP Protocol 1-TCP
Connection must be established first
[Ans. C]
m1 Send an email from a mail client to
a mail server SMTP
m2 Download an email from a mail
client to a mail server POP
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.comPage 392
Computer Networks
9.
[Ans. C]
1) Station Q will be downloading a file
from TTP server and 3 routers
R1, R2, and R3 between Q and H.
2) Sniffing at R2 alone
what
information will be disclosed?
Only IP addresses & Port Numbers
3) As IP addresses & Port Numbers
remains same for the entire journey
to the destination, so sniffing will get
both IP addresses and Port Numbers
of Q and .
4) URL Station Q alone knows the
URL and requests the DNS server for
destination IP. As URL wont be
included in the packet, so the routers
in the middle are totally unaware of
URLs.
5) Link Layer Addresses of Q and H
Ethernet Address (or) MAC address
(or) Physical Address. As the
physical addresses changes from
Hop to Hop, Sniffing at R2 will know
only the physical addresses of R1 and
R2 but not Q and H.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 393
Computer Networks
Network Security
CS -2005
1.
Suppose that two parties A and B wish to
setup a common secret key (D-H key)
between themselves using the DiffieHellman key exchange technique. They
agree on 7 as the modulus and 3 as the
primitive root. Party A chooses 2 and
party B chooses 5 as their respective
secrets. Their D-H key is:
(A) 3
(C) 5
(B) 4
(D) 6
CS -2008
4.
The total number of keys required for a
set of n individuals to be able to
communicate with each other using
secret key and public key cryptosystems,
respectively are :
(A) n (n 1) and 2n
CS -2007
2.
Exponentiation is a heavily used
operation in public key cryptography.
Which of the following options is the
tightest upper bound on the no. of
multiplications required to compute
b modulo m, 0b, nm?
(A) O (log n)
(C) O (n/log n)
(D) O (n)
(B) O (n )
CS -2009
5.
In the RSA public key cryptosystem, the
private & public keys are (e, n) & (d, n)
respectively, where n=p * q and p and q
are large primes. Besides, n is public & p
& q are private . Let M be an integer such
that 0<M<n & (n) = (p 1) (q 1).
Now consider the following equations.
(A) M = Me mod n
M = (M )d mod n
(B) ed = 1 mod n
(C) ed = 1 mod (n)
(D) M = Me mod (n)
M = (M )d mod (n)
Which of the above equations correctly
represent RSA cryptosystem?
(A) I and II
(C) II and IV
(B) I and III
(D) III and IV
3.
(B) 2n and
(C)
and 2n
(D)
and n
CS -2011
6.
A layer-4 firewall (a device that can look
at all protocol headers up to the transport
layer ) CANNOT
(A) Block entire HTTP traffic during
9:00 PM and 5:00 AM
(B) Block all ICMP traffic
(C) Stop incoming traffic from a specific
IP address but allow outgoing traffic
to the same IP address
(D) Block TCP traffic from a specific user
on a multi-user system during
9:00PM and 5:00AM
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 394
Computer Networks
CS -2013
7.
Using public key cryptography, X adds a
digital signature to message M, encrypts
<M, > and sends it to Y, where it is
decrypted. Which one of the following
sequences of keys is used for the
operations?
(A) ncryption :Xs private key followed
by Ys private key;
Decryption: Xs public key followed
by Ys public key
(B) ncryption: Xs private key followed
by Ys public key;
Decryption: Xs public key followed
by Ys private key
(C) ncryption: Xs public key followed
by Ys private key;
Decryption : Ys public key followed
by Xs private key
(D) ncryption : Xs private key followed
by Ys public key;
Decryption : Ys private key followed
by Xs public key
CS- 2014
8.
Which of the following are used to
generate a message digest by the network
security protocols?
(P) RSA
(Q) SHA 1
(R) DES
(S) MD5
(A) P and R only
(C) Q and S only
(D) R and S only
(B) Q and R only
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 395
Computer Networks
[Ans. B]
p=7
g = primitive root = 3
Party A chooses = a = 2
Party B choose = b = 5
D-H Key = k =?
k= g
(mod p) = 3
(mod 7) = 4
2.
[Ans. C]
O(n/ log n) is the tightest upper bound.
3.
[Ans. D]
A pushdown automata with two stacks
4.
[Ans. C]
8.
[Ans. C]
RSA (Rivert, Shamir, Adleman) is a public
key crypto system.
SHA 1 (Secure Hash Algorithm) is a
hash function to generate a message
digest
DES (Data Encryption standard) is a
symmetric key algorithm for encryption
MD5 is a message digest algorithm
[Ans. B]
I and III equation correctly represent RSA
cryptosystem
6.
[Ans. D]
To block TCP traffic from specific user,
requires information of specific user
which is done by application layer. To
block HTTP data, layer-4, i.e., transport
layer can be used because it can block
port used by HTTP
7.
[Ans. D]
Decrypting first with Ys private key
ensures confidentiality and rest of the
things follows that way
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 396
Compiler Design
Introduction to Compilers
CS-2005
1.
Consider line number 3 of the following
C program.
int min( ){
/* Line 1 */;
int I, n;
/* Line 2 */;
fro(I=0, I<n,I++)
/* Line 3 */;
}
Identify the compilers response about
this line while creating the object-module
(A) No compilation error
(B) Only a lexical error
(C) Only syntactic errors
(D) Both lexical and syntactic errors
CS-2010
2.
Which data structure in a compiler is used
for managing information about variables
and their attributes?
(A) Abstract syntax tree
(B) Symbol table
(C) Semantic stack
(D) Parse table
CS-2011
3.
In a complier, keywords of a language are
recognized during
(A) Parsing of the program
(B) The code generation
(C) The lexical analysis of the program
(D) Dataflow analysis
CS-2014
4.
Which one of the following is NOT
performed during compilation?
(A) Dynamic memory allocation
(B) Type checking
(C) Symbol table management
(D) Inline expansion
2.
[Ans. C]
In 2nd line no mis-spelling is there. It is int
only.
Error is underlined function fro ( )
which is a syntactical error rather than
lexical so correct option is C.
[Ans. B]
As we know symbol table is a Data
structure containing record for each
identifier, with fields for the attribute of
the identifier. The symbols entered into
[Ans. C]
Keywords are recognized during lexical
analysis
4.
[Ans. A]
Dynamic memory allocation is performed
at run time not on compile time.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 397
Compiler Design
Syntax Analysis
CS-2005
1.
The grammar A AA |(A)| is not
suitable for predictive-parsing because
the grammar is
(A) ambiguous
(B) left-recursive
(C) right-recursive
(D) an operator-grammar
2.
3.
5.
6.
CS-2006
4.
Consider the following grammar.
S S*E
SE
E F + E
E F
F id
Consider the following LR(0) items
corresponding to the grammar above.
(i) S S*.E
(ii) E F.+E
(iii) E F+.E
Given the items above, which two of them
will appear in the same set in the
canonical sets-of-items for the grammar?
(A) (i) and(ii)
(C) (i) and (iii)
(B) (ii) and (iii)
(D) None of these
7.
CS-2007
8.
Which one of the following is a top-down
parser?
(A) Recursive descent parser
(B) Operator precedence parser
(C) An LR(k) parser
(D) An LALR(k) parser
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 398
9.
10.
CS-2008
13. Which of the following describes a handle
(as
applicable
to
LRparsing)
appropriately?
(A) It is the position in a sentential form
where the next shift or reduce
operation will occur
(B) It is a non-terminal whose
production will be used for reduction
in the next step
(C) It is a production that may be used
for reduction in a future step along
with a position in the sentential form
where the next shift or reduce
operation will occur.
(D) It is the production p that will be
used for reduction in the next step
along with a position in the
sentential form where the right hand
side of the production may be found.
14.
12.
Compiler Design
CS-2010
15. The grammar S aSa | bS | c is
(A) LL(1) but not LR(1)
(B) LR (1) but not LL(1)
(C) Both LL(1) and LR(1)
(D) Neither LL(1) nor LR(1)
CS-2012
Statement for Linked Answer Question 16
and 17:
For the grammar below, a partial LL(1)
parsing table is also presented along with
the grammar. Entries that need to be
filled are indicated as E1, E2, and E3. is
the empty string, $ indicates end of input,
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 399
E1
E2
AS
AS
Error
E3
CS-2013
18. What is the maximum number of reduce
moves that can be taken by a bottom up
parser for a grammar with no epsilon and
unit production
(i.e., of type A and A a )to parse a
string with n tokens?
(A) n/2
(C) 2n 1
(B) n 1
(D)
19.
16.
The FIRST and FOLLOW sets for the nonterminals A and B are
(A) FIRST(A) = {a,b,} = FIRST(B)
FOLLOW (A) = {a,b}
FOLLOW (B) = {a,b,$}
(B) FIRST(A) = {a,b,$}
FIRST (B) = {a,b,}
FOLLOW (A) = {a, b}
FOLLOW (B) = {$}
(C) FIRST(A) = {a,b,} = FIRST(B)
FOLLOW(A) = {a,b}
FOLLOW(B) =
(D) FIRST(A) = {a,b,} = FIRST(B)
FOLLOW(A) = {a,b}
FOLLOW(B) = {a,b}
17.
Compiler Design
CS-2014
20. A canonical set of items is given below
S . R
R.
On input symbol < the set has
(A) a shift-reduce conflict and a
reduce-reduce conflict.
(B) a shift-reduce conflict but not a
reduce-reduce conflict.
(C) a reduce-reduce conflict but not a
shift-reduce conflict.
(D) neither a shift-reduce nor a reducereduce conflict.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 400
21.
Compiler Design
[Ans. A]
Given grammar is Ambiguous,that is the
reason that it is not suitable for Predictive
paring.
2.
[Ans. D]
E
E+n|En|n
Input String n + n n
E + n n reduction E
n
En
reduction E
E+n
E
reduction E
En
So the reduction are n, E + n, E n
3.
[Ans. B]
S
(S) | a
Parsers
No. of States
SLR (1)
n
LR(1)
n
LALR(1)
n
The number of states of deterministic
finite automata in SLR (1) and LALR (1)
parsers are equal, so n
n . The number
of states of deterministic finite automata
in LR (1) or canonical LR is greater than
the number of states of deterministic
finite automata of SLR(1) and LALR(1)
So n
n
n .
4.
[Ans. D]
Construct the canonical set-of-items and
observe the same.
5.
[Ans. A]
Construct Predictive parser table as
follows
Nonterminal
Id
*
$
S
S
FR
R
R
*S
R
F
F
id
So M[S, id] = {S
FR}
and M[R, $] = {R }
6.
[Ans. D]
SA |
a b|
A aA|a
b|b
From the above grammar,
( ) *a b +
a b|
(A) a
A aA|a
( ) b
b|b
By substituting C, A and B in S.
S AC L(S) = {ambn| m > n}
(S) *a b |m n+
S
(S) *a b |m n or m n+ *a b |i
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 401
j+
7.
8.
9.
[Ans. A]
In the q no. 6 if grammar generates a b
or a b then the length is max (l, m) if it
generates a b initially we include two
extra derivation so the total length is
max (l, m) + 2.
lm
aabbab.
lm
So aabbab is generated by the grammar.
12.
[Ans. A]
Predictive parser and recursive descent
parser are example of top-down parser.
Where as LR(k) and LALR(k) parser are
bottom up parser
[Ans. B]
There are two parse trees for the string
aabbab from left most derivation and one
from right most derivation.
S
[Ans. A]
S
i C t SS | a
S
eS |
C
b
S
i C t SS
i b t SS [apply C
Compiler Design
b]
S
B
a
a
10.
11.
[Ans. A]
Regular grammar is well recognized by
LL(1) parsers and LR (1) parser is stronger
and more than powerful than LL (1) so
regular grammar is also accepted by LR (1)
parser. Every regular set has LR (1)
grammar. So both statements are correct.
[Ans. C]
S
aB
lm
aaBB
lm
aabB
lm
aabbS
lm
aabbaB
b
a
B
b
13.
[Ans. D]
Definition of handle is given in (D) option.
14.
[Ans. B]
LALR (1) parser uses the LR (1) items. So
LALR (1) parser or for a grammar G can
have S-R conflict if add only if the LR (1)
parser for G has S-R conflicts.
15.
[Ans. C]
S aSa|bS|c
The above grammar is LL (1) because,
First ,aSa- first ,bS- (a) (b)
&&
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 402
17.
A
B
b
S bAa
S
AS
S
X c.X, $
X .c.X, $
X .d, $
X .cX, c|d
X .cX, c|d |$
X .d, c|d | $
1.
2.
[Ans. C]
S aAb | bAa |
AS
BS
LL(1) Parsing table:
a
S aAb
S
AS
S
[Ans. D]
X c.X, c|d
X .cX, c|d
X .d, c|d
[Ans. A]
S aAbB | bAaB |
AS
BS
First of S = {a, b, }
First of A = {a, b, }
First of B = {a, b, }
Follow of S = {$, a, b}
Follow of A = {b, a}
Follow of B = {$, a, b}
18.
19.
Compiler Design
3.
4.
$
S
error
S
[Ans. B]
If n tokens are there in string, then one
reduction is required for each token. But
at the end two tokens will be reduced to
two terminals because grammar does not
have any unit production. So for last two
token =1
)
For remaining (n
) tokens = (n
20.
[Ans. D]
No any conflict, because both items will
be in different states of canonical sets.
21.
[Ans. B]
Consider the following derivation tree
S
T
T
Total = 1 + n 2
=n 1
*
U
id
id
+
Q
id
id
P
Q
id
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 403
Compiler Design
1.
2.
E.val=number.val
E(1).val = E(2).val + E(3).val
E(1).val = E(2).val E(3).val
(D) Precedence of
is higher than
that of
, and both operators are
left associative; expression is
evaluated to 9
CS-2006
3.
Consider the following translation
scheme.
S R
R * *print **); R |
E F
*print ( ); }| F
F (S) | id {print (id.value);}
Here id is a token that represents an
integer and id.value represents the
corresponding integer value. For an input
* 3 4, this translation scheme prints
(A) 2 * 3 + 4
(C) 2 3 * 4 +
(B) 2 * + 3 4
(D) 2 3 4 + *
CS-2008
4.
Which of following are true?
I. A programming language which does
not permit global variables of any
kind & has no nesting of
procedures/functions, but permits
recursion can be implemented with
static storage allocation
II. Multi-level access link(or display)
arrangement is needed to arrange
activation records only if the
programming
language
being
implemented
has
nesting
of
producers/ functions
III. Recursion in programming languages
cannot be implemented with
dynamic storage allocation.
IV. Nesting of producers/ functions &
recursion require a dynamic heap
allocation scheme and cannot be
implemented with a stack based
allocation scheme for activation
records
V. Programming
languages
which
permits a function to return a
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 404
(A)
(B)
(C)
(D)
Compiler Design
[Ans. C]
E
number | | Then A
compiler detects shift-reduce conflict, and
resolves the conflict in favor of a shift
over a reduce action. Consider the
following configuration where shiftreduce conflict occurs
Stack Input
2.
[Ans. C]
With look ahead we would prefer to shift
because the look ahead has higher
precedence than over + and both
operation are left associative. So
expression 3
6
7 will be
evaluated.
3.
[Ans. D]
[Ans. A]
Consider each statement separately
I.
If a programming language doesnt
permit global variables and no
nesting procedures then we cant
use the recursion with static
storage because there is no stack
support. For example Fortran
doesnt support the recursion. So
statement is false
II.
Statement is true.
III.
Recursion
in
programming
languages will be implemented
with dynamic storage. For example
C language implement recursion
with the help of heap if size is also
increases because heap stores the
all activation records of a recursion.
So statement is false.
IV.
Statement is false because we can
implement recursion either with
the help of heap or a stack.
V.
Statement is true.
S
R
E
*
{print}
id
{print}
id
3
{print}
id
E {print}
F
{print}
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 405
Compiler Design
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 406
CS-2010
5.
Which languages necessarily need heap
allocation in the runtime environment?
(A) Those that support recursion.
(B) Those that use dynamic scoping.
(C) Those that allow dynamic data
structures.
(D) Those that use global variables.
CS-2011
6.
Consider two binary operators and ' '
with the precedence of operator being
lower than that of the operator .
Operator
is right associative while
operator is left associative. Which one of
the following represents the parse tree
for expression (7 3 4 3
)
(A)
c a b;
d c a;
e c a;
x c c;
if (x a) *
y a a;
+
else {
d d d;
e e e;
}
7.
8.
(B)
7
2
3
7
4
3
3
(C)
(D)
2
7
2
3
3
4
3
4
7
CS-2013
Common Data for Questions 7 & 8
The following code segment is executed
on a processor which allows only register
operands in its instructions. Each
instruction can have almost two source
operands and one destination operand.
Assume that all variables are dead after
this code segment.
Compiler Design
CS-2014
9.
One of the purposes of using intermediate
code in compilers is to
(A) make parsing and semantic analysis
simpler.
(B) Improve error recovery and error
reporting.
(C) Increase the chances of reusing the
machine-independent code
optimizer in other compilers.
(D) Improve the register allocation.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 407
10.
11.
Compiler Design
2.
[Ans. D]
(A) i%2 is inner loop invariant, it can be
moved before inner loop
(B) 4*j is common sub expression
appeared in two statements
(C) 4*j can be reduced to j<<2 by
strength reduction.
(D) There is no dead code in given code
segment. So there is not scope of
dead code elimination in this code.
Hence only option (D) is FALSE.
[Ans. D]
Both work1 and work2 performs the
same task so S1 is true. But code in work2
will improve performance.
In work1:
int x = a[i+2];
Here a[i+2] is computed twice.
return a[i + 2] 1
In work2;
t
i
t
a,t -;
return t
3
Therefore option S2 is also correct.
3.
[Ans. B]
Some code optimizations are carried out
on the intermediate code because
program analysis is more accurate on
intermediate code than on machine code.
4.
[Ans. B]
Recursion cannot be implemented with
static storage allocation.
L attributed definition can be evaluated
if all rules are at the end and all attributes
are synthesized.
So I and IV are correct.
5.
[Ans. C]
Runtime environment mean we deal with
dynamic memory allocation and heap is a
dynamic data structure. So it is clear that
those languages that allow dynamic data
structure
necessarily
need
heap
allocation in the runtime environment.
6.
[Ans. B]
2
7
3
4
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 408
7.
[Ans. B]
c a b;
x c c;
if (x a) * (i)
y a a;
+
else {
d
c a;
e c a; . (ii)
d d d;
e e e;
+
(i) Is to store c*c, it needs one memory
spill.
(ii) Is uses previous same(i) memory
spill to store c*a.
Number of memory spills are used in
above program is one. With the use of
one memory cell and two registers the
above optimized code can be executed.
8.
[Ans. B]
R
R
R c a b
R
R R
d ca
R
R
R e c a
R
R R
x cc
if(R
R )
if(x 0)
{
R
R R
y ab
}
else
{
R
R R
d dd
R
R R
e ea
}
4 registers are required
Option (B) is correct
9.
[Ans. C]
Intermediate code is machine
independent code which makes it easy to
retarget the compiler to generate code for
newer and different processors.
10.
Compiler Design
[Ans. A]
e, d
c
a, d
11.
th
[Ans. D]
x=4*5
x= 20 is the example of constant
folding not of common sub expression
elimination
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 409
SE & WT
2)
Evolutionary
model
b)
3)
Componentbased
software
engineering
Spiral
development
c)
4)
d)
3.
4.
Specifications
can be
developed
incrementally
Requirements
compromises
are inevitable
Explicit
recognition
of risk
Inflexible
partitioning of
the project
into stages
(A)
(B)
(C)
(D)
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 410
SE & WT
[Ans. A]
Functional dependences can be measure
between two metrics
a) Cohesion
b) Coupling
Coupling is the measure of interdependencies
among modules. As per Modularity coupling
should be low.
Low
High
Content
coupling
Common
coupling
Control
coupling
Stamp
coupling
Low
coupling
Data coupling
Procedural
cell
Inclusion
coupling
coupling
External
coupling
Coupling spectrum
Import
coupling
2.
[Ans. B]
Waterfall model is inflexible partitioning
because if once a phase is completed, it is
difficult to repeat that if any error
encounters in the later phases
Model is incremental
development
Spiral model is used where risk faction is
more important
3.
[Ans. C]
Option (A) is false because implementation
details are not given in requirement
documents.
Option (B) is false because practically it
cannot be achieved perfectly
Option (D) is false because requirement
review is done on requirement document
after that design phase starts.
Option (C) is true.
4.
[Ans. B]
Cohesion is a measure of internal strength
within a module, whereas coupling is a
measure of inter dependency among the
modules. So in the context of modular
software design there should be high
cohesion and low coupling.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 411
SE & WT
Process Modeling
CS 2009
1.
Consider the following statements about
the Cyclomatic complexity of the control
flow graph as a program module. Which of
these are true?
I. The Cyclomatic complexity of a
module is level to maximum
number of linear independent
circuits in a graph.
II. The Cyclomatic complexity of a
module is the number of decisions in
the module plus one where a decision
is effectively any conditional statement
in the module.
III. The Cyclomatic complexity can also be
used as a number of linearly
independent paths that should be
tested during path coverage testing.
(A) I &II
(C) I & III
(B) II & III
(D) I, II & III
CS 2011
3.
Which one of the following is NOT
defined in a correct good Software
Requirement Specification (SRS)
document?
(A) Functional Requirement
(B) Non - Functional Requirements
(C) Goals of Implementation
(D) Algorithms for software
Implementation
CS 2013
4.
The following figure represents access
graphs of two modules M1 and M2. The
filled circles represent methods and the
unfilled circles represent attributes. If
method m is moved to module M2 keeping
the attributes where they are, what can we
say about the average cohesion and
coupling between modules in the system
of two modules?
Module M1
CS 2010
2.
The Cyclomatic complexity of each of the
module A & B shown below is 10. What is
the Cyclomatic complexity of the sequential
integration shown on the right hand side.
Module M2
A
A
B
B
(A) 19
(B) 21
(C) 20
(D) 10
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 412
SE & WT
[Ans. B]
Cyclomatic complexity V(c) can be evaluated
by
4.
[Ans. A]
If a method m is moved to module M2 by
Keeping the attributes where they are
average cohesion and coupling between
modules will not change in the system.
Cohesion M2 and M1 are interchanged but
average cohesion will be the same for the
given system after moving the method m to
module M2
[Ans. A]
Cyclomatic complexity also known as
structural complexity because it gives
internal view of code. It is used to find the
number of independent paths.
So in the problem
3.
[Ans. D]
A software requirements specification
(SRS), a requirements specification for a
software system, is a complete description
of the behavior of a system to be developed.
In addition it also contains non-functional
requirements. Algorithms are developed
during design phase.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 413
SE & WT
Project Management
CS-2009
1.
Which of the following statements are
true?
I. The context diagram should depict the
system as a single bubble.
II. External entities should be identified
clearly at all levels of DFDs
III. Control information should not be
represented in a DFD
IV. A data store can be connected either to
another data store or to an external
entity.
(A) II & III
(C) I & III
(B) I, II & IV
(D) I, II & III
(A) 4000
(B) 5000
3.
(C) 4333
(D) 4667
CS-2011
2.
A company needs to develop a strategy for
Software Product development for which it
has a choice of two programming language
L1& L2. The number of lines of code (LOC)
developed using L2 is estimated to be twice
the LOC developed with L1.The product will
have to be maintained for five years. Various
parameters for the company are given in
the table below.
Parameter
Language L1 Language L2
Man years
LOC /10000 LOC/10000
needed for
development
Development $ 10,00, 00 $ 7,50,000
cost per man
year
Maintenance 5 years
5 years
time
Cost of
$ 1,00, 000 $ 50, 000
maintenance
per year
Total cost of the project indicates cost of
yeayearyearm
development & maintenance. What is the
aintenancema
LOC for L1per
for which the cost of the project
intenance
using
L
is
equal to the cost of the project
1
year
using ?
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 414
SE & WT
[Ans. C]
II. In DFD external entities are represented
only at level 0 DFD or context diagram
IV. Between every external agent & data
store process is compulsory, i.e
Invalid Notations
Valid Notations
2.
[Ans. B]
L1 = x
L2 = 2x
Given,
Cost of project using L1
= Cost of project using
3.
[Ans. A]
Effort in person per month = ab
=2.8(40)1.20 = 234.22 Person month
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 415
SE & WT
CS - 2011
3.
The following is comment written for a
C function.
/*This function computes the roots of
quadratic equation.
ax2 + bx + c = 0 the function stores
two real roots in * root1 & * root2 &
returns the status of validity of
roots. In handles four different
kinds of cases
i. When coefficient a is zero
irrespective of discriminant
ii. When discriminant is positive.
iii. When discriminant is zero
iv. When discriminant is negative
Only in cases (ii) & (iii) the stored roots
are valid otherwise 0 is stored in the
roots. The function returns 0 when the
roots are valid & 1 otherwise. The
function also ensures root1 >= root2
int get_QuadRoots (float a, float b, float c,
float *root 1, float *root2)*/
A software test engineer is assigned the
job of doing black box testing. He comes
up with the following test cases, many
of which are redundant
Test
Input set
Expected output set
case
a
b
c Root Root 2 Return
1
value
T1
0.0 0.0
7.0 0.0
0.0
1
T2
0.0 1.0
3.0 0.0
0.0
1
T3
1.0 2.0
1.0
1.0
1.0
0
T4
4.0
12.0 9.0 1.5
1.5
0
T5
1.0
2.0
3.0 3.0
1.0
0
T6
1.0 1.0
4.0 0.0
0.0
1
Which one of the following options
provide the set of non redundant
tests
using
equivalence
class
partitioning approach from input
perspective for black testing?
(A) T1, T2, T3, T6
(C) T2, T4, T5, T6
(B) T1, T3, T4, T5
(D) T2, T3, T4, T5
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 416
CS - 2013
Common Data for Question 4 and 5
The procedure given below is required
to find and replace certain characters
inside an input character string supplied
in array A. The characters to be replaced
are supplied in array oldc, while their
respective replacement characters are
supplied in array newc. Array A has a
fixed length of five characters, while
arrays oldc and newc contains three
characters each.
However, the procedure is flawed.
void find_and_replace (char *A, char *oldc,
char *newc) {
for (int i = 0 ; i < 5 ; i++)
for (int j = 0 ; j < 3 ; j++)
if (A[i] == oldc [j])
A [i] = newc[j] ;
}
The procedure is tested with the
following four test cases.
4.
5.
SE & WT
1.
w
2.
w
3.
w
4.
w
The tester now tests the program on all
input strings of length five consisting of
h
w h
duplicates allowed. If the tester carries
out this testing with the four test cases
given above, how many test cases will
be able to capture the flaw?
(A) Only one
(C) Only three
(B) Only two
(D) All four
If array A is made to hold the string
2.
[Ans. B]
These are all the activities encountered in
a software life cycle. Requirement capture
means requirement analysis we gather
the information about a particular
domain.
4.
[Ans. B]
There is problem in the given code because
Break statement is missing.
Correct implementation is
for (int j = 0; j < 3; j++)
if (A[i] == oldc[j])
{
A[i] = newc[j];
break;
}
In both the questions whether array contain
repeated element or not, flaw is due to oldc
and newc string only.
Flaw is in test case 3 and 4.
i = 0, j = 0
A[0] = a
oldc [0] = b
a
i = 0, j = 1
A[0] = a
[Ans. D]
h
h
h
h
3.
[Ans. C]
T1, & T2 checking same condition a = 0
hence, any one of T1 & T2 is redundant
T3 and T4: in both cases
discriminant (D) = b2 4ac = 0
Hence any one of it is redundant.
T5 : D > 0
T6: D < 0
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 417
oldc [1] = c
a c
i=0j=2
A[0] = a
oldc [2] = a
A [0] == oldc[2]
A [0] = newc[2]
Array content abcde
i = 1 j =0
a [1] = b
oldc [0] = b
a [1] == oldc[0]
a [1] = newc[0]
Array content = accde
i=1j=1
a [1] = c
oldc [1] = c
a[1] == oldc[1]
a[1] = newc[1]
adcde
flow
Two successive replacement but if should
break after one replacement.
5.
SE & WT
i= 0 j = 1
a [0] = b
a [0] = oldc[1]
a [0] = newc[1]
array content abcde
flow a
two replacements
[Ans. C]
There is problem in the given code because
Break statement is missing.
Correct implementation is
for (int j = 0; j < 3; j++)
if (A[i] == oldc[j])
{
A[i] = newc[j];
break;
}
In both the questions whether array contain
repeated element ot not, flaw is due to oldc
and newc string only.
Flaw is in test case 3 and 4.
Array abcde
i=0j=0
a [0] = a
oldc [0] = b
a [0] == oldc [0]
a [0] = newc [0]
array content bbcde
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 418
SE & WT
HTML Structure
CS - 2005
1.
Consider the three commands: PROMPT,
HEAD and RCPT. Which of the following
options indicate a correct association of
these commands with protocols where
these are used?
(A) HTTP, SMTP, FTP
(B) FTP, HTTP, SMTP
(C) HTTP, FTP, SMTP
(D) SMTP, HTTP, FTP
CS - 2009
2.
Consider the HTML table definition given
below:
<table border=1>
<tr><td rowspan=2>ab</td>
<td colspan=2> cd </td>
</tr>
<tr><td>ef</td>
<td rowspan=2>gh</td>
</tr>
<tr><td colspan=2>ij</td>
</tr>
</table>
The number of rows in each column and
the number of columns in each row are:
(A) (2,2,3) and (2,3,2)
(B) (2,2,3) and (2,2,3)
(C) (2,3,2) and (2,3,2)
(D) (2,3,2) and (2,2,3)
CS - 2011
3.
HTML (Hyper Text Markup language) has
language elements which permit certain
actions other than describing the
structure of the web document. Which
one of the actions is NOT supported by
pure HTML (without any client or server
side scripting) pages?
(A) Embed web objects from different
sites into same page
(B) Refresh the page automatically after
a specified interval
(C) Automatically redirect to another
page upon download
(D) Display the client time as part of the
page
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 419
SE & WT
[Ans. B]
PROMPT: This command is used in FTP
(File Transfer Protocol)
HEAD: HEAD command is used in HTTP,
asks for the response identical to the one
that would correspond to a GET request,
But without the response body.
RCPT: This command is used in SMTP. It
is used to establish the return address or
return path.
2.
[Ans. C]
Rowspan is used to specifying how many
rows a cell should span Colspan is used to
specifying how many columns a cell should
span
Table looks like.
cd
ab
ef
gh
ij
3.
[Ans. D]
Date and Time can be displayed using
JavaScript
(A) For Embedding Object Tag is
available. <Object> Following
Objects can be Embedded,
ActiveX Controls, Flash,
Fireworks etc.
(B) <META http-equiv="refresh"
Content="5"> this will refresh a
page after 5 seconds
(C) <META http-equiv="refresh"
Content="5;
URL=http://www.othersite.com"> this
will Redirect a page after 5 seconds
(D) It needs JavaScript. Pure HTML does
not have any tag to show time on the
page.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 420
SE & WT
CS - 2006
2.
Consider the following XML DTD describing
course information in a university:
<! ELEMENT Univ (Course+ , Prof+) >
<! ELEMENT Course (Title, Eval* ) >
<!ATTLIST Course number ID #REQUIRED
Instructor IDREF # IMPLIED >
<! ELEMENT Title ( # PCDATA) >
<! ELEMENT Eval( # PCDATA ) >
<! ATTLIST Eval Score CDATA # REQUIRED >
<! ELEMENT Prof Empty >
<! ATTLIST Prof Name ID # REQUIRED
Teaches IDREF # IMPLIED >
What is returned by the following
XQUERY?
Let $ as := //@ Score
For $c in /Univ/Course [Eval]
Let $cs :=$?c/Eval?@ Score
Where min ($cs) >avg ($ as)
return $c
(A) The professor with the lowest course
evaluation
(B) Professors who have all their course
evaluation above the university average
(C) The course with the lowest evaluation
(D) Course with all evaluations above the
university average
CS - 2013
3.
Match the problem domains in GROUP I with
the solution technologies in GROUP II.
GROUP I
GROUP II
(P) Service oriented
1) Interoperability
computing
(Q) Heterogeneous
2) BPMN
communicating
systems
(R) Information
3) Publish-findrepresentation
bind
(S) Process description 4) XML
(A)
(B)
(C)
(D)
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 421
SE & WT
[Ans. D]
Book tag is repeated twice. <title> can be
either
1) Zero or more (*)
2) Zero or one (?)
<type>is EMPTY and have an attribute.
2.
[Ans. D]
Return $c - Query return 'c' where 'c' is
set as Course with all Evaluations
Where min ($cs) >avg ($ as) - min(cs) is
minimum score of each evaluation in a
course
avg(as) is average of all the scores in all
courses from all professors.
3.
[Ans. C]
Service oriented computer (
publish find bind
H
p
Information representation XML
Process
p
BPMN.
th
th
th
THE GATE ACADEMY PVT.LTD. H.O.: #74, KeshavaKrupa (third Floor), 30 Cross, 10 Main, Jayanagar 4 Block, Bangalore-11
: 080-65700750, info@thegateacademy.com Copyright reserved. Web: www.thegateacademy.com
Page 422