Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Lim Lim Lim: CS - 2008 Q.1 (A)

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 14

CS – 2008

𝑠𝑖𝑛𝑥
𝑥−𝑠𝑖𝑛𝑥 𝑥(1− )
𝑥
Q.1 (A) lim = lim 𝑐𝑜𝑠𝑥
𝑥→∞ 𝑥+𝑐𝑜𝑠𝑥 𝑥→∞ 𝑥(1+ 𝑥 )
𝑠𝑖𝑛𝑥
(1− )
𝑥
= lim 𝑐𝑜𝑠𝑥
𝑥→∞ (1+ 𝑥 )
𝑠𝑖𝑛𝑥
1− lim
𝑥→∞ 𝑥
= 𝑐𝑜𝑠𝑥
1+ lim
𝑥→∞ 𝑥
1−0
= 1+0 = 1

Q.2 (D)

And union of all set is = U


Q.3 (D)

Q.4 (D) Exponent all zero e = 0


And mantissa all zero m = 0
Represent special number zero

Q.5 (A)

f(a, b, c, d) = 𝑏̅𝑑̅ + 𝑎̅. 𝑑̅

Q.6 (D) √12.1𝑟 = 11r


r can not be 2 so let r = 3
√(19 + 23 + 1) = 3+1
√9 + 6 + 1 = 4
√16 = 4
So correct option is (D)
Any value > 2

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.8 (C) f1 = m (4, 5, 6, 7, 8)


f3 = m (1, 6, 15)
f = m (1, 6, 8, 15)
choose option one by one.
If 9 take f2 = m (4, 6), then
f1.f2 = m (4, 6)
f = ((f1.f2)+f3) = m (1, 6, 15)
false option
so take next option, if a select f2 = (6, 8)
then,
f1.f2 = m (6, 8)
f = ((f1.f2)+f3) = m (1, 6, 8, 15)
so correct value of f2 = (6, 8)

Q.9 (D) L = {𝑎𝑝  p is prime number}


This language is context sensitive language
We can accept this language by linear bounded automata as well as turning machine.
So correct option (D)

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.20 (D) An extension of indexed allocation.

Q.21 (A)
Note error has following expression in trapezoidal method=>

where ξ is some number between a and b.

error = * f''( ) = * f''( )

f '(x) = xex+ex

f ' '(x) = xex+ex+ex = (x+2)ex


maximum error will be at 2

if we substitute = 2then error will be *3e2

if we equate *3e2 = then we will get n = 1000e

Q.22 (C) According to Newton – Raphson iteration


𝑓(𝑥 )
𝑥𝑛+1 = 𝑥𝑛 – 𝑓(𝑥𝑛)
𝑛
Let us convert the given expression to above form.
𝑥𝑛 𝑅
𝑥𝑛+1 = + 2𝑥𝑛
2
𝑥𝑛 𝑅
= 𝑥𝑛 - + 2𝑥𝑛
2
𝑥𝑛 𝑅
= 𝑥𝑛 – ( 2 − 2𝑥𝑛)
𝑥 2 𝑛 −𝑅
= 𝑥𝑛 - 2𝑥𝑛
 f(x) = 𝑥 2 − 𝑅 and f(x) = 2x
𝑥2 = R
x = √𝑅

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

Q.24 (A) Easily verifiable by Mathematical Induction.

Q.25 (B) Given : y = 3𝑥 4 − 16𝑥 3 + 24𝑥 2 + 37


For maximum value or minimum
𝑑𝑦
= 12𝑥 3 − 48𝑥 2 + 48𝑥 = 0
𝑑𝑥
𝑥 − 4𝑥 2 + 4𝑥 = 0+48𝑥 = 0
3

𝑥(𝑥 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𝑄̅

Q.27 (C) Total combination are CMC


CMM
CCC
CCM
Probability of CMC = 0.6  0.4 = 0.24 - Favorable
CMM = 0.6  0.6 = 0.36
CCC = 0.4  0.4 = 0.16 - Favorable
CCM = 0.4  0.6 = 0.24
Total favorable = 0.24 + 0.16 = 0.4
Total probability = 1
So P =0.4/1

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.30 (A) (xFsa(x))  (ypda(y)  equivalent (x, y))

Q.31 (B) It can solved by Truth table:


P Q PVQ (PQ) PQ PQ PQ
T T T F T F F
T F T F F T F
F T F T F F F
F F T F T F T

Using above table


P Q I II III IV
T T T T T T
T F T T T T
F T F F F T
F F T T T T

So, I, II and III are logicaly equivalent

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.40 (B) Example:-


arr [] = {1, 2, 3, 3, 3, 3, 10}  =3
output = No. of comparision
use binary search methodology to find the first occurrence of the given number.
Minimum number of comparison required to determined is 0(logn)

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.54 (A) II and V only.


Q.55 (B) An LALR(1) parser for a grammar G can have shift – reduce (S – R) conflict if and only if the LF(1)
parser for G has S – R conflict.
Q.56 (D)
Q.57 (C) Number of bits for subnet mask = 21
Number of bits for host = 11
So number of host = 211 -2 = 2046
Q.58 (B) If the capacity of the token bucket is C bytes token arrival Rate is R byte/sec. and the maximum
possible transmission rate is M B/S then the time (S) in seconds it is possible to transmit is
𝐶
S = 𝑀−𝑅 second
16
= 10−2 = 2 second.
Q.59 (B)
Q.60 (B) There is the correction in the program.
int y, z
**PPz + = 1; Z = ** PPZ; ….(X = 4, C = 5, Z = 5)
*Py + = 2; y = *Py; …….(X = 4, C = 7, Z = 5, Y = 7)
X + = 3;…… (X = 7, C = 7, Z = 5, Y = 7)
Return x + y + z; ……. (7 + 7 + 5 =19)
So, O/P = 19
Q.61 (D) Its accept character input ?1(c = get char ())! = \𝑛⌋ ?2 for beginning all character after reverse
functions so ?2 put char©;
Q.62 (B) The program swaps two successive and then goes on to swap. The next two successive elements
until it reaches the end of the list.
Q.63 (C) Xb has to be 1 since both P(s) and V(s) operation are performing Pb(Xb) if it is 0 all processes
executing these operation would be blocked if yb is 1, it is possible that two processor can execute P(s) one
after other (implying 2 process in critical section) so it has to be 0.
Q.64 (A)
Q.65 (A) In deadlock prevention there is no guarantee that the request for a resource is granted even though
the resulting state is safe state. Deadlock prevention works by eliminating one of the four necessary
condition for deadlock.
Q.66 (B) It is same as writing n fork statement one after another.
Each fork generate a child process other than the parent process.
Total number of process is 2𝑛 and total number of child processes is 2𝑛 − 1
Q.67 (B)
Frame address needs 36-12=24 bits
and a page table stores frame address in its PTE,,hence 24,24,24 is correct option.

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(7) + 3f1(6) = 2  547 + 3  182 = 1640

2  f1(6) + 3f1(5) = 2  182 + 3  61 = 547

2  f1(5) + 3f1(4) = 2  61 + 3  20 = 182

2  f1(4) + 3f1(3) = 2  20 + 3  7 = 61

2  f1(3) + 3f1(2) = 2  7 + 3  2 = 20

2  f1(2) + 3f1(1) =22+31=7

2  f1(1) + 3f1(0) =21+30=2


Now for f2:
x[0] = y[0] = z[0] = 0
x[1] = 1, y[1] = 2, z[1] = 3
i=2
x[2] = y[1] + z[0]
x[2] = 2 + 0 = 2
y[2] = 2  [2] = 2  2 = 4
z[2] = 3  [2] = 3  2 = 6

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.

Q.78 (D) X1 = 2 = [0, 1]


X2 = 3 = [01, 10, 11]
X3 = 5 = [010, 011, 101, 110, 111]
X4 = 8 = [0101, 0110, 0111, 1010, 1011, 1101, 1110, 1111]
X5 = 13 = [01011, 01010, 01101, 01110, 01111, 10101, 10110, 10111, 11010, 11011, 11101,
11110, 11111]
So Xn = Xn – 1 + Xn – 2
X5 = X4 + X3
=8+5
= 13
Q.79 None is correct…x5=13
Q.80 (B) using induction..(through some sample table X)
Q.81 (C) The last entry shows whether the subset which sums to W is found.
Q.82 (B) All entity are must be convert in to tables and there are two Relations R1 and R2. The Relation
R1 is many to one and total participation of many is given then table for R1 Relation does not create. The
R2 relation is the weak relation. Table for weak relation will be never created.
So total number of table is three all for entity M, P, N.
Q.83 (A) M [ M1, M2, M3, P1]
P [ P1, P2]
N [ P1, N1, N2]
So correct option will be ‘A’
Q.84 (C)
Q.85 (A)

You might also like