Lim Lim Lim: CS - 2008 Q.1 (A)
Lim Lim Lim: CS - 2008 Q.1 (A)
Lim Lim Lim: CS - 2008 Q.1 (A)
𝑠𝑖𝑛𝑥
𝑥−𝑠𝑖𝑛𝑥 𝑥(1− )
𝑥
Q.1 (A) lim = lim 𝑐𝑜𝑠𝑥
𝑥→∞ 𝑥+𝑐𝑜𝑠𝑥 𝑥→∞ 𝑥(1+ 𝑥 )
𝑠𝑖𝑛𝑥
(1− )
𝑥
= lim 𝑐𝑜𝑠𝑥
𝑥→∞ (1+ 𝑥 )
𝑠𝑖𝑛𝑥
1− lim
𝑥→∞ 𝑥
= 𝑐𝑜𝑠𝑥
1+ lim
𝑥→∞ 𝑥
1−0
= 1+0 = 1
Q.2 (D)
Q.5 (A)
Q.7 (C) The most efficient algorithm for finding the number of connected components in an undirected
graph on n vertex and m edges has the complexity is (m+n).
Q.10 (B) I. Whether the intersection of two regular language is Infinite is decidable.
II. whether a given context free language is Regular is undecidable.
III. whether two push – down automata accept the same language is undecidable.
IV. whether a given grammar is context – free is decidable.
Q.11 (D)
Q.12 (A)
Q.13 (D)
Q.14 (A) Maximum size of data that the application layer can pass on the TCP layer below is any size. First
division of data at TCP layer and the maximum size of data at TCP layer is 216 byte application layer can
transfer any size of data.
Q.15 (C)
Q.16 (A)
o Clustering index is defined on the field which are non key and ordering
o Primary index is defined on the field which are key and ordering.
o Secondary index in defined on the field which are non – key and non – ordering it can also be
defined on ordering or key field, but it is not useful in that case.
Q.17 (D)
Q.18 (A) a = (x > y ) ? ( ( x > z) ? x : z) : ((y > z) ? y : z)
Solve by option elimination method.
(A) x = 3, y =4, z = 2
a = (3 > 4 ) ? ( ( 3 > 2) ? 3 : 2) : ((4 > 2) ? 4 : 2)
0 condition false then
else part
so o/p = 4
so correct option is (A)
Q.19 (C)
Q.21 (A)
Note error has following expression in trapezoidal method=>
f '(x) = xex+ex
Q.23 (C)
Planer graph can be colored with at most 4 colors.
So the minimum Independent set has size = n/4…..(It means at least n/4 vertices are nonadjacent )
So the largest vertex cover can be of size= n-n/4 = 3n/4
𝑥(𝑥 2 + 4𝑥 + 4 = 0
𝑥(𝑥 − 2)2 = 0
x = 0, 2, 2
𝑑2 𝑦
= 36𝑥 2 − 96𝑥 + 48
𝑑𝑥 2
At x = 0
𝑑2 𝑦
𝑑𝑥 2
= +48
𝑑2 𝑦
At x = 2 = 36 4 – 96 2 + 48 = 0
𝑑𝑥 2
So only 1 local minima..so 1 extremum (at x=0.)
Q.26 (A) (P + Q) (P.𝑄̅ + P.R) (𝑃̅𝑅̅ + 𝑄̅ )
(P + 𝑄̅ ) (P𝑄̅ 𝑃̅𝑅̅ + P𝑄̅ 𝑄̅ + 𝑃𝑅𝑃̅𝑅̅ + 𝑃𝑅𝑄̅)
(P + 𝑄̅ ) (P𝑄̅ + P.R. 𝑄̅ )
(P + 𝑄̅ ) (P𝑄̅ (1+r))
(P + 𝑄̅ ) (P𝑄̅ )
P𝑄̅ + P𝑄̅
P𝑄̅
1 0
Q.28 (A) (i) [ ]
0 0
1− 0
[ ]=0
0 −
(1 - ) ( -) = 0
Hence Eigen values are = 0,1
0 1
(ii) [ ]
0 0
0− 1
[ ]=0
0 −
( -) ( -) = 0
Hence Eigen values are = 0,0
1 −1
(iii) [ ]
1 1
1− −1
[ ]=0
1 1−
(1 − ) 2 + 1 = 0
2 − 2 + 2 = 0
1
−1 0
(iv) [ ]
1 −1
−1 − 0
[ ]=0
1 −1 −
(−1 − ) (−1 − ) - 1 = 0
(1 + ) 2 - 1 = 0
2 + 2 + 1 = 0
= 0, -2
So, matrix have an Eigen value equal to 1 is only one.
Q.29 (A)
P(X<= -1) = P(Y>=2)
rewriting this in terms of standard normal distribution : with normal random variable=z
P(z<= (x-mean_x) / (sd_x) ) = P(z>= (y-mean_y ) / (sd_y)
P(z<= (-1-1) / (2) ) = P(z>= (2-(-1))/ sd _y)
P(z<=(-1)) = P(z>= (3)/ sd _y)
But in normal pdf ,, P(z<=(-1)) = P(z>= 1),,since its symmetric about axis .
so we can conclude that 3/ sd_y = 1
sd_y = 3
Q.32 (B)
Q.33 (C) The auto increment addressing mode. The amount of increment depends on the size of the data
item accessed.
Q.34 (D)
Q.35 (B) For inclusion to hold between two cache hierarchy
L1 must be write through cache
L2 cache must be at least as large as L1 cache.
Q.36 (B)
Q.37 (B)
Q.38 (B)
Q.39 (D) f(n) = 2𝑛
g(n) = n!
n(n) = 𝑛𝑙𝑜𝑔𝑛
Ln can be written as 𝑛𝑛 so
𝑛𝑙𝑜𝑔𝑛 < 2𝑛 < 𝑛𝑛
So n(n) < f(n) < g(n)
So correct option is
n(n) = 0 (f(n))
and g(n) = (f(n))
Q.41 (C) For maximum number of split operations apply right biasing in B = Tree
Ten successive insertion 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 order = 4. Maximum number of key a Node can have = 3
1 1.2 1, 2, 3
1, 2, 3, 4
Q.42 (D)
𝑛 4𝑛
Q.43 (B) T(n) = T( 5) + T( 5 ) + n
Q.44 (B) Subset sum problem with binary encoding belongs to NP complete class. So it can not be solved in
polynomial time by any algorithm.
NOTE: By applying some space reductions Subset sum problem with unary encoding can be solved in
polynomial time and hence it belongs to class P.(so (a) is true)
Q.45 (D) v d p v d p v d p v d p
a 0 a 0 a 0 a 0
b 1 a b 1 a b 1 a b 1 a
c c 3 b c 3 b c 3 b
d d d d
e e -2 b e -2 b e -2 b
f f f 0 e f 0 e
g g g g 3 f
h h h h
v d p v d p v d p v d p
a 0 a 0 a 0 a 0
b 1 a b 1 a b 1 a b 1 a
c 3 b c 3 b c 3 b c 3 b
d 6 c d 6 c d 6 c d 6 c
e -2 b e -2 b e -2 b e -2 b
f 0 e f 0 e f 0 e f 0 e
g 3 f g 3 f g 3 f g 3 f
h -2 c h -2 c h -2 c h -2 c
since all the vertex are reachable from vertex a so it computes the corrects shortest path distance to all the
vertex.
So correct ans. Is (D)
Q.46 (D) To find the binary tree two of the order i.e. in order, post order and in order, pre order should be
given, By using only post order unique binary tree can not be found.
Q.47 (B) Using bottom up heap construction/insertion .
Q.48 (D) a, b, c are true statements option (D) is false. Because recursively enumerable is not closed in
subset problem.
Q.49 (B)
Product auto mata z y:
Q.50 (C) I, III, IV are true, but II is false because we can not removed production from starting production.
Like :- S AB
A
B
Q.51 (C) Here X b b c c surely represents palindrome and X b c d f g
arithmetic expression with match pair are simple and 1 = {wcw wt (a, b ) * } checking that identifier are
declared before their use and 1 = { anbmcndm n 1, m 1} Number of formal parameter in the declaration
of a function agree with the number of actual parameter in a use of that function.
Q.52 (C) P 1, Q – 2, R – 3, S – 4.
One possible approach to select the right option would be the elimination trick, for example R – 1 is not right
match because 001 (1) but it is not accepted by R.
Q.53 (A) I. is regular because the language is a’s followed by even number of b’s.
II. is not regular because to scan b’s we should remember the number of a’s.
III. is not regular for the same reason in II
IV. is regular because the language contain all possible strings with (a, b) which contain only 1 c.
So option (A)
Q.68 (D) Querie iv is equivalent to iii because ( R – ( R – S) = R S and R S contain only those (p, q)
pair that are their in both R and S and all project the same column P ii is not equivalent to other ones it
only checks to see the presence of column value P in both R and S
Q.69 (C) Collection is in BCNF and book is not in 3NF because transitive dependency exist on non – prime
attribute but it is in 2 NF because No partial dependency exists
so correct and is C
Not be careful with the word only.
Q.70 (C) Size of the index file = key field + block pointer
Or
Entry size = 6 + 10 =16 byte
𝑡𝑜𝑡𝑎𝑙 𝑟𝑒𝑐𝑜𝑟𝑑 ×𝑖𝑛𝑑𝑒𝑥 𝑓𝑖𝑙𝑒
Then, No. of blocks at first level = 𝐵𝑙𝑜𝑐𝑘 𝑠𝑖𝑧𝑒
16384×16
= = 256
1024
256×16
Number of blocks at second level = = 4
1024
So 256 and 4
Q.71 (D) Size of the cache = 64k byte
2 way set associative
Block size = 16k byte
𝑐𝑎𝑐ℎ𝑒 𝑠𝑖𝑧𝑒
So no. of Blocks = 𝐵𝑙𝑜𝑐𝑘 𝑠𝑖𝑧𝑒
64 × 210
= 24
26 ×210
No. of blocks = = 212
24
𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑏𝑙𝑜𝑐𝑘𝑠
No. of sets = 𝑠𝑒𝑡 𝑠𝑖𝑧𝑒
212
= = 211
21
MM address is 32 – bit long so Tag bit = 32 – 11 – 4 = 17 bit
Then, size of the tag directory is = No. of bits for tag × Number of blocks
= 17 × 212 = 22 17 K bits = 68 K bits
Q.72 (B)
Q.73 (C) Since each block size is 2 element each cache miss will bring one extra element into cache saves
us half of the time.
Q.74 (B) The function f1 contain recursive call then Recurrence relation for that function equal to
T(n) = T(n – 1) + T(n – 2) + 1
Solve the relation by tree method you will get the complexity (2𝑛 )
The function f2 contain for loop which run’s n time so complexity for function f2 will be (n)
So correct option is (2𝑛 ) and (n)
Q.75 (C) f1(8) = 1640
2 f1(4) + 3f1(3) = 2 20 + 3 7 = 61
2 f1(3) + 3f1(2) = 2 7 + 3 2 = 20
i=3
x[3] = y[2] + z[1] = 4 + 3 = 7
y[3] = 2 [3] = 2 7 = 14
z[3] = 3 [3] = 3 7 = 21
i=4
x[4] = y[3] + z[2] = 14 + 6 = 20
y[4] = 2 [4] = 2 20 = 40
z[4] = 3 [4] = 3 20 = 60
similarly for I = 5, 6, 7, 8.
You will get the result [8] = 1640
So correct option is 1640 and 1640.
Q.76 (A) The instruction following the conditional branch instruction in memory in executed.
Q.77 (D) Branch condition depend on the Register R1 and R1 Register update in I3 instruction so I3 can not
occupy delay so it value of R1 Register depend on R2 and R3 value and R2 update in I1 instruction so we
can not put I1 in delay slot remaining instruction is I2 and I4. Instruction I4 use the result of instruction I2 so,
it should be execute before I4 so only I4 instruction remaining to put in delay slot. So correct option will be
I4.