CS 2011 - WordPress.com

CS – 2011
Q.1
Given that:
P – Regular language
Q – Context free
Such that Q  P
Option (A) P  Q  p*q*  pnqn = pnqn → context free
So not regular
(B) P – Q :  P  𝑄 𝑐 because Q is context free language then
complement of context free may or may not be then no guarantee of
regular language.
(C) * - P : -  *  𝑃𝑐 - complement of Regular language
always regular.
(D) * - Q:- similar to option(B) context free not closed in
complement
So option (C) is correct option.
Q.2 (A)
Q.3 (B)
Q.4 (C) P + P [3] – P[1]
P [3] = E = ascii value – 69
P [1] = A = ascii value – 65
04
So P + 4 i.e. = * P  Point to P + 4 ie. 2
So it will print 2011
Q.5 (D)
Q.6 (B) Page fault service time = 10 ms
Average memory access time = 20 ns
Page fault rate P =
1
106
So EAT = P  𝑡𝑝 + (1 – P)(tm)
= 10 
1
106
 10−3  109 + ( 1 -
1
106
)  20
= 10 + 19.9
= 29.9 ns  30ns
Q.7 (A)
Q.8 (D)
Q.9 (B)
So both K4 and Q3 are planar
Q.10 (A)
Q.11 (A) mod n = 2𝑑
Mod 258 ≤ 2𝑑
258 < 2𝑑
258 < 29
So 9 D flip flop needed
Q.12 (B) 𝑃̅𝑅 + 𝑃̅𝑄
(P + 𝑄̅ + 𝑅̅ ) (P + 𝑄̅ + 𝑅) (P + 𝑄 + 𝑅̅ )
Given that product of max term for that K – map
F = P + 𝑄̅ 𝑅̅
So option (B)
Q.13 (A)
Q.14 (D) 2 – input  NOR
A
0
0
1
1
B
0
1
0
1
A
1
0
0
1
B
Option a and b are direct logic diagram for XNOR gate.
Option C : 
A
0
0
1
1
B
0
1
0
1
𝐴̅
1
1
0
0
o/p
1
0
0
1
Circuit of option C give the result of XNOR gate so it is equivalent to
X – NOR gate
So option (D) is correct option
Q.15 (D)
Q.16 (D)
Q.17 (D)
Q.18 (B) (A) DFA and NFA are equivalent expressive power
(B)DPDA and NPDA have different expressive power NPDA is more
powerful then DPDA
(C) All the type of turing machine has same expressive power.
(D) Similar to C Option.
Q.19 (A) Lines of code = 40,000
The multiplicative factor (D) = 2.8
The exponential factor (E) = 1.20
Q.20
So effort  2.8  (40)1.20
 2.8  83.64
 234.22 person per month
(C)
Q.21 (B)
Let LOC for L1= x
and LOC for L2 = 2x
since cost of projects are equal =>
project cost for L1 = project cost for L2
(x/10000) *10^6 + 5*10^5 = (2x/10000)*750000 + 50000*5
solving these equations we get
x= 5000
Q.22 (C) M1: SMTP, M2: POP, M3: HTTP
Q.23 (A) We know that one of the outcome is Head then total cases are =
{HT, TH, HH}
And favorable case = {HH}
Then P (Head) =
1
3
Q.24 (A) It can not block entire HTTP traffic because it is higher layer protocol
(Application layer) transport layer block upto TCP protocol.
Q.25 (C) The keywords of a language are recognized during the lexical analysis of
the program.
Q.26 (C) In this query from clause use the table S
Borrower
Ramesh
Suresh
Mahesh
Bank manager
Sunderajan
Ramgopal
Sunderajan
and table T
Bank manager
Sunderajan
Ramgopal
Sunderajan
after natural join of S T
Loan Amount
10000
5000
7000
So total number of row count is 5
Q.27 (C) Discriminate of quadratic equation is 𝑏 2 -4ac
There are four condition of discriminate so we need 4 test cases.
(i) When coefficient a is zero, then for this test case (T1 and T2)
(ii) When discriminate is positive then for this test case (T3 or T4)
(iii) When discriminate is zero, then for this test case T5
(iv) And when discriminate is negative then for this test case T6
So option (C) only
Q.28 (A) Option (B) accept the sting ‘b’ so it is in – correct, option (C) and option
(D) both accept string ‘bba’ so it is also incorrect option, then
correct option is (A)
Q.29 (B) Seek time = 10ms
Rotational speed = 6000 rpm
Avg. acc.  latency + avg. seek + transferred
1
60 ×1000
2
6000
 
 5 + 10 ms
+ 10 + 0
= 15 ms
15 ms to load single libraries then to load 100 libraries it will take
= 15 ms  100
= 1500 ms
=
1500
1000
sec
1.5 sec
So correct ans. is (B)
Q.30 (D) Cache size = 8 kb
Block size = 32 byte
Then bits for off set = 5 bit
No. of blocks = cache size/ block size
No. of Blocks
=
=
8 × 210
32
213
25
= 28
ie. 8 – bit for index
so number of bits for tag
= MM bits – index bit – off set bits
= 32 – 8 – 5
= 19 bits
So total size of memory needed at the cache controller
= (19 + 1 + 1)  number of block
= (21)  28
= 5376 bits
Q.31 (B) Let n = 3 and k = 1
So n + 1
Q.32 (B) Time taken in non pipeline :
= 5 + 6 + 11 + 8
= 30 ns
So speed up =
𝑛𝑜𝑛−𝑝𝑖𝑝𝑒𝑙𝑖𝑛𝑒
ℎ𝑖𝑔ℎ𝑒𝑠𝑡 𝑝ℎ𝑎𝑠𝑒 𝑡𝑖𝑚𝑒
30
30
=
11+1
=
1𝑔2
= 2.5
Q.33 (A) Product of the eigen value = determine of matrix
So check one bye one option
Determinate of matrix = 1  4  3
= 12
So only option (A) will give result then correct option is (A)
Q.34 (C) When a query contain equal condition then hashing is better but when a
query contain rang condition then B+ Tree is bitter So hashing will out
perform ordered indexing on Q1, because it contain equal but not on Q2.
Q.35 (C) Multiply as (M1  (M2  M3))  M2, so
1st :- (M2  M3) = (M2) 𝑞 × 𝑟  (M3) 𝑟 × 𝑠
= (M2  M3) 𝑞 × 𝑠
and total operation = q  r  s
= 100  20  5
= 10000
2nd :- M1  (M2  M3) = (M1) 𝑝 × 𝑞  (M2  M3) 𝑞 × 𝑠
= (M1  (M2  M3)) 𝑝 × 𝑠
and total operation = p  q  s
= 10  100  5
= 5000
3rd :- (M1  (M2  M3))  M4 = M1  (M2  M3)
= (M1  (M2  M3)  M4) 𝑝 × 𝑡
and number of multiplication = p  s  t
𝑝×𝑠
 (M4) 𝑠 × 𝑡
= 10  5  8
= 4000
Then total number of multiplication = 10000 + 5000 + 4000
= 19000
Correct option (C)
Q.36 (A) f1 = 2𝑛
f2 = 𝑛3/2 = n√𝑛
f3 = nlog 2 𝑛
f4 = 𝑛log2 𝑛
So correct order is f3 < f2 < f4 < f1
Q.37 (D) Given
Expression = (a – b) + (e – (c + d))
Then
Load ax, c
Load bx, d
add ax, bx
ax  ax + bx, bx free
Load bx, e
sub bx, ax
bx  bx – ax, ax free
Load ax, a
Load cx, b
sub ax, cx
ax  ax – cx,
add bx, ax
So total number of register needed to evaluate this expression is ax, bx,
cx total three so correct option is (D)
Q.38 (A)
𝑃0
𝑃1
𝑃0
𝑃2
0
1
5
13
22
Waiting time of 𝑃0 = 13 – 0 – 9 = 4
𝑃1 = 5 – 1 – 4 = 0
𝑃2 = 22 – 2 – 9 = 11
Avg. waiting time =
4+11
3
= 5 ms
So avg. waiting time = 5 ms.
Q.39 (A) Total no. of cases = P(5,2)= 20
And favorable cases = 5
4
4
3
Total 4
3
2
2
1
Then probability =
4
20
=
1
5
Q.40 (D)
Standard deviation get affected by scaling only and not by shifting… so
sigma_y = a*sigma_x
So (D) is incorrect.
Q.41 (A)
Q.42 (D)
∫ e^(2ix) dx =
1/2i* [e^(2ix)] from 0 to pi/2 = 1/2i *[e^(i*pi)- e^0]
= 1/2i * (cos (pi) + I sin(pi)- 1) = 1/2i * (-1-1)
= 1/2i * (-2)
= -1/i
multiplying by ‘i’ in numerator and denominator ..
= -i/ i^2
= -i/-1
=i
Hence (D) is correct.
Q.43 (A) Px x is a prime number.
If x can be factorized then one of the factor must be either x itself and other
factor should be 1.
Q.44 (B) Given a binary tree ,it can be populated in one way only.
Q.45 (A) Without pipeline :
2 + 500  7 = 3502
Before loop
after loop
With DMA = 20 + 500  2 = 1020
Speed up =
3502
1020
= 3.4
Q.46 (C) L1 = {0p1q  p, q  N} it is Regular
L2 = {0p1q  p, q  N and p = q } it is context free
L3 = {0p1q0r  p, q, r  N and p = q = r} it is context sensitive
(A) True,
(B) True,
(C) False, because it is not context free language.
(D) True,
Q.47 (B)
Q.48 (B) Inputs in D – flip – flop:
Outputs: P
Q
R
(1) DP = R
0
0
0(Initial)
1st clock 0
1
0
(2) DQ = ̅̅̅̅̅̅̅̅
𝑅+𝑃
2nd clock 0
1
1
3rd clock 1
0
0
(3) DR = Q. 𝑅̅
4th clock 0
0
0
So here total number of distinct outputs states is 4 (000, 010, 011, 100)
so it is mod – 4 counter.
Q.49 (D) If value of PQR is 0 1 0 then after the clock edge output is 011. See in
the solution number 48.
Q.50 (D)
So o/p = 1 + 1 = 2
Q.51 (B) Similar to question 50
Output
So o/p: = 5 + 4 + 3 = 12
Q.52 (B) Cost of the minimum spanning tree of such given graph is
3 + 4 + 6 = 13
So check option wise. Put value of n = 4 in option and check it
(A)
1
12
(11 × 42 − 5 × 4) =
1
12
(156) = 13
(B) 16 – 4 + 1 = 13
(C) 24 – 11 = 13
(D) 2  4 + 1 = 9
So option (D) is clearly not a ans. now check for n = 5 the sample graph
So cost of minimum spanning tree
= 4 + 3 + 6 + 8 = 21
Now take option (A)


1
12
1
12
1
12
(11𝑛2 − 5𝑛)
(11 25 − 55)
so it will wrong option
(B) 𝑛2 − 𝑛 + 1 = 25 - 5 + 1 = 21
(C) 6n – 11 = 6  5 – 11 = 19
So we can easily see that option (B) give correct value of MST.
Q.53 (C)
So (MST) = 4 + 8 + 3 + 6 + 10 = 31
Q.54 (A) Routing table for node N3
So option (A)
Q.55 (C) So cost to N1 in the distance vector of N3:
2 + 4 + 3 + 1 = 10
Because N3 has neighbors N2 and N4
N2 has made entry  in own table or N4 has distance of 8 to N1 and N3
has the distance of 2 to N4.
56) (B)
57) (B)
58) (A)
59) (B)
logP = (1/2)logQ= (1/3)logR
logP = log(Q^1/2)= log(R^(1/3))
P= Q^1/2 = R^1/3.
so P^2 =Q
P^3=R
Now in option (b)
Q^2 = P^4 = P * P^3 = PR
So (B) is true.
60)(C)
61)(C)
Let transporter receives n orders each day.
also let pending orders = p
7* 4 = 28 = p+4n…………(1)
Also
3*10 = 30 = p+10n………..(2)
by (1) and (2)
30 = 28+6n
so (n = 1/3)
And p = 28- (4/3) = 80/3
So for finishing job at the end of 5 th day…
let x trucks will be needed..
5x = p + 5n
x= p/5 + n
x= 16/3 + 1/3
x= 17/3
X= 5.67..
So minimum 6 trucks will be needed.
62) (D)
10*(10-1/10)^3 = 10*729/1000
7.29 liters
63) (C)
64) (D)
65) (A)
V+F = (4q + 100/q)
for minimum cost of V+F..differentiate wrt to ‘q’ and equate it with 0=>
d(V+F)/dq = 4 – 100/q^2 = 0
q^2 = 25
so q=5.
For testing q=5 to be a minimum value
again differentiate wrt q,,we get a positive value as
=> (-100)*(-2)/q^3
=> 200/q^3
for q=5
we get 200/125
=1.6
which is positive ,,hence function is minimum at q=5.
so 5 is answer.