You are on page 1of 13

25

GATE COMPUTER SCIENCE


PRACTICE SET-3

This Practice Set '’Gate Computer Science


Practice Set-3’' is taken from our Book:

ISBN : 978-9386629029
26

PRACTICE SET 3
INSTRUCTIONS
1. There are a total of 65 questions carrying 100 marks. Duration of the set is 3 hrs.
2. This question paper consists of 2 sections, General Aptitude (GA) for 15 marks and the subject specific
GATE paper for 85 marks. Both these sections are compulsory.
3. The GA section consists of 10 questions. Question numbers 1 to 5 are of 1-mark each, while question numbers 6 to
10 are of 2-marks each. The subject specific GATE paper section consists of 55 questions, out of which question
numbers 11 to 35 are of 1-mark each, while question numbers 36 to 65 are of 2-marks each.
4. Questions are of Multiple Choice Question (MCQ) or Numerical Answer type. A multiple choice question will have
four choices for the answer with only one correct choice. For numerical answer type questions, the answer is a number
and no choices will be given.
5. Questions not attempted will result in zero mark. Wrong answers for multiple choice type questions will result in
1
NEGATIVE marks. For all 1 mark questions, mark will be deducted for each wrong answer. For all 2 marks questions,
3
2
mark will be deducted for each wrong answer..
3
6. There is NO NEGATIVE MARKING for questions of NUMERICAL ANSWER TYPE.

GENERAL APTITUDE 4. Operators *, $, ® are defined by


x-y x+y
QUESTION 1 TO 5 CARRY ONE MARKS EACH x*y= ; x$y = ; x ® y = xy..
x+y x-y
Find the value of (55 * 5) ® (55 $ 5).
1. Choose the best word to fill the blank.
(a) –1 (b) –2
Paula’s _______ humor does not amuse many people; (c) 1 (d) 2
rather many find it offensive and hurtful.
a b
(a) nebulous (b) truncated 5. If log + log = log(a + b) then
b a
(c) stoic (d) vitriolic
2. Choose the best word to fill the blank. (a) a + b = 1 (b) a – b
(c) a = b (d) a2 – b2 = 1
The play’s _______ debut was not a good sign for the
struggling producer. QUESTION 6 TO 10 CARRY TWO MARKS EACH
(a) Unsubstantial (b) inauspicious 6. Walk into any supermarket or pharmacy and you will find
(c) copious (d) disembodied several shelves of products designed to protect adults
3. Replace the underlined portion with the phrase that best and children from the sun. Additionally, a host of public
completes the sentence. If the sentence is correct as is, health campaigns have been created, including National
choose (a). When making a chocolate torte, only the best Skin Cancer Awareness Month, that warn us about the
ingredients should be used. sun's damaging UV rays and provide guidelines about
(a) only the best ingredients should be used. protecting ourselves. While warnings about the sun's
(b) you should use only the best ingredients. dangers are frequent, a recent survey found that fewer
(c) the best ingredients only should be used. than half of all adults adequately protect themselves from
(d) one should have used only the best ingredients. the sun.
27
This paragraph best supports the statement that TECHNICAL SECTION
(a) children are better protected from the sun's dangerous
rays than adults. QUESTION 11 TO 35 CARRY ONE MARK EACH
(b) sales of sun protection products are at an all-time
high. é2 0 0 0ù
ê8 1 7 2 úú
(c) adults are not heeding the warnings about the ê
dangers of sun exposure seriously enough. 11. The determinant of the matrix ê 2 0 2 0 ú is
ê ú
(d) more adults have skin cancer now than ever before. ë9 0 6 1û
7. Four people witnessed a mugging. Each gave a different
description of the mugger. Which description is probably (a) 4 (b) 0
right? (c) 15 (d) 20
12. A polynomial p(x) satisfies the following
(a) He was average height, thin, and middle-aged.
p(1) = p(3) = p(5) =1
(b) He was tall, thin, and middle-aged.
p(2) = p(4) = – 1
(c) He was tall, thin, and young. The minimum degree of such a polynomial is _______
(d) He was tall, of average weight, and middle-aged. 13. The Newton-Raphson iteration
8. Jullie leaves home at 11:00 a.m. and rides to Mary’s house Xn + 1 = (Mn/2) + 3/(2xn)
to return Mary’s bicycle. She travels at 12 miles per hour can be used to solve the equation
and arrives at 11:30 a.m. She turns right around and walks (a) X2 = 3 (b) X3 = 3
home. How fast does she walk if she returns home at 1:00 (c) X2 = 2 (d) X3 = 2
p.m.? 14. Four fair coins are tossed simultaneously. The probability
(a) 1 (b) 2 that at least one head and one tail turn up is _______
(c) 3 (d) 4 15. The binary relation S = f (empty set) on set A= {1, 2, 3} is
9. Manjeet lends equal sum of money at the same rate of (a) Neither reflexive nor symmetric
interest to A and B. The money lends to A becomes twice (b) Symmetric and reflexive
of the original amount in just four years at simple interest. (c) Transitive and reflexive
While Manjeet lends to B for the first two years at (d) Transitive and symmetric
compound interest and for the rest two years at simple 16. Which of the following is equivalent to p Å p , where Å
interest. If the difference between the amount A and B represents the Ex-OR operation?
after 4 years is ` 3300. What is the amount that Manjeet
(i) p Å Øp (ii) Ø ( p Å Øp )
lends to each one?
(a) ` 7200 (b) ` 9600 (iii) ( p Å q ) Ú ( Øp Å Øq ) (iv) Øp Å p
(c) ` 10,000 (d) ` 11,500 (a) (i) and (iv) (b) only (ii)
10. The chart shows the colors of replacement parts for (c) only (iii) (d) All of these
pocket PCs. The total number of parts shipped is 1,650.
17. The J-K flip-flop in which J = Q and K = 1, is initially cleared

and then clocked for 8 pulses, the sequence at the Q output


Boxed Set of Replacement Parts
will be
Part Color Number of Prices
(a) 10101010 (b) 01010101
Green 430
(c) 10011001 (d) 10110100
Red 425 18. A computer system stores floating point numbers with a 16
Blue bit mantissa and an 8 bit exponent, each in 2’s complement.
Yellow 345 The smallest and largest positive values which can be stored
TOTAL 1650 are
(a) 1 × 2–128 and 215 × 2128
(b) 1 × 2–256 and 215 × 2255
If a person is randomly grabbed a part out of the box,
(c) 1 × 2–128 and 215 × 2127
what is the probability that the part would be blue?
(d) 1 × 2–128 and (215 – 1) × 2127
(a) 1/4 (b) 1/9 19. We have a file of 105 pages and assume that 5-buffer pages
(c) 1/12 (d) 3/11 are available to sort that file. The cost of sorting using 4-
way merge sort is _____
28
20. The boolean function as a sum of product for a given 26. What value would the following function return for the input
x = 95?
( )
function f(A, B, C, D) = A + BC ( B + CD ) is equal to Function fun (x : integer) : integer;
begin
(a) A + BC + ACD + BCE if x > 100 then fun: = x – 10
(b) AB + BC + ACD else fun: =fun (fun (x + 11))
end:
(c) AB + BC + ACD + BCD (a) 89 (b) 90
(d) (c) 91 (d) 92
AB + AB + ACD + BCD
21. Relation R is decomposed using a set of functional 27. The postfix form of A Ù B*C - D + E / F / ( G + H ) is
dependencies F, and relation S is decomposed using another (a) AB Ù C * D - EF / GH + / +
set of functional dependencies G. One decomposition is
(b) AB Ù * C - D + EF / GH +
definitely, BCNF, the other is definitely 3 NF, but is not known
to make a guaranteed identification, which of the following (c) AB Ù C + D - EF / GH / - +
tests should be used on the decompositions? (d) AB Ù C * D * EF / GH + / +
(Assume that closures of F and G are available) 28. Consider the following program :
(a) Dependency preservation main ( )
(b) BCNF definition {
(c) Both (a) and (b) int i = 257;
int *iptr = & i;
(d) 3 NF definition
printf (“%d %d”, * ((char*) iptr),* ((char*) iptr + 1));
22. Two computers that communicate with each other uses a
}
simple parity check to detect errors for ASCII transmissions.
What should be the output of the above program?
Which of the following events will always lead to an
(a) 257, 297 (b) – 128, 127
undetected error?
(c) 127, 127 (d) None of these
(a) One bit or any odd number of bits inverted in a byte 29. Which one of the following well formed formulae is
during transmission tautology?
(b) Two bits or any even number of bits inverted in byte
during transmission (a) "x$yR ( x, y ) « $y"xR ( x, y )
(c) One bit or any odd number of bits inverted in a block
of data during transmission.
(b) ("x éë$yR ( x, y ) ® ( x, y )ùû ) ® "x$yS ( x, y )
(d) Two bits or any even number of bits inverted in a block
during transmission
(c) ëé ("x$y ( p(x, y) ® R(x, y) ) ûù
23. Simplify using K-Map and represent result in SOP form. ® [ "x$y(ØP(x, y)"R(x, y) ]

Y = f (A,B,C,D) = S(0,1, 2, 6,7,10,14) + Sd(3,8,11,5) (d) "x"yp ( x, y ) ® "x"yp ( y, x )


where Sd represent don’t care condition. 30. Post order traversal of a given binary search tree T produce
the following sequences of keys 10, 34, 24, 48, 50, 45, 60, 85,
(a) A + BC (b) C + A B 75, 55
Which of the following sequence is an in-order traversal of
(c) A + CD (d) C + BD Tree T?
24. The value of a float type variable is represented using the (a) 10, 24, 35, 45, 48, 50, 55, 60, 85, 75
single-precision 32-bit floating point format of IEEE-754 (b) 10, 24, 45, 35, 48, 50, 55, 60, 85, 75
standard that uses 1 bit for sign, 8 bits for biased exponent (c) 10, 24, 35, 45, 50, 48, 55, 60, 75, 85
and 23 bits for mantissa. A float type variable X is assigned (d) 10, 24, 35, 45, 48, 50, 55, 60, 75, 85
31. To insert n random elements into an initially empty Binary
the decimal value of – 14.25. The representation of X in
Search Tree (BST) for n ³ 1, the running time is
hexadecimal notation is
(a) O(n2 log n) (b) O(n)
(a) C1640000H (b) 416C0000H (c) O(n2) (d) O(n log n)
(c) 41640000H (d) C16C0000H 32. An algorithm is made up of two modules M1 and M2. If
25. The minimum size of ROM required to complete truth table order of M1 is f(n) and M2 is f ¢(n), then the order of the
of an 8-bit multiplexer is algorithm is
(a) 32K × 16 bits (b) 64 K × 32 bits (a) max [f(n), f ¢(n)] (b) min (f(n), f ¢(n))
(c) 16 K × 32 bits (d) 32 K × 32 bits (c) f(n) + f ¢(n) (d) f(n) * f ¢(n)
29
33. Consider the following : 39. Which of the given options provides the increasing order
int fun (int n) of asymptotic complexity of functions f1, f2, f3 and f4?
{ if (n%2 == 0) f1(n) = 2n f2(n) = n 3/2
return n; f3(n) = n log2 n f1(n) = nlog2n
else return (2* fun (n – 1); (a) f3, f2, f4, f1 (b) f3, f2, f1,f4
} (c) f2, f3, f1, f4 (d) f2, f3, f4, f1
What is the worst case time complexity of given function ? 40. Mala has a colouring book in which each English letter is
(a) O(log n) (b) O(n log n) drawn two times. She wants to paint each of these 52 prints
(c) O(n) (d) None of these with one of k colours, such that the colour-pairs used to
34. Language L1 is polynomial time reducible to language L2. colour any two letters are different. Both prints of a letter
Language L3 is polynomial time reducible to L2, which in can also be coloured with the same colour. The minimum
turn is polynomial time reducible to language L4. Which of value of k that satisfies this requirement is _____
the following is/are true? 41. Consider the following languages :
I. If L4 Î P , then L2 Î P { }
L1 = 0i1j2i 3 j | i, j ³ 0
II. If L1 Î P or L3 Î P, then L2 Î P
L2 = {0i1j2k | i, j ³ 0 and ( i = 3j or j = 3k )}
III. L1 Î P , if and only if L3 Î P
Which statement is true?
IV. If L4 Î P , then L1 Î P and L3 Î P (a) L1 is context-free
(a) II only (b) III only (b) L2 is context-free
(c) I and IV only (d) I only (c) Both L1 and L2 is context free
35. In the given figure, a DFA M has start state A and accepting (d) None of these
state D. Which of the following regular expressions denotes 42. Consider the TM given below
the set of all words accepted by M?
0, 0, R B, B, L
A B F
1 1 1, 1, R
0, 0, R
1 1, 0, R
1
A B C D If the above TM is started with some arbitrary binary string
0 on tape, enclosed by blanks and with the read-write head
0 on first bit of the string, then the final contents of tape after
0 machine halts will be
0
(a) same as initial content
(a) 001 (b) 10*1*0 (b) will be a string from (0 + 1) 0*
(c) 10*1*010 (d) (011)*011 (c) will be a string from (0 + 1) 1*
2n
(d) will be string from *
æ 1ö 43. Consider two languages L1 = {anbm | n, m ³ 1} and L2 =
36. What is the value of lim ç1- ÷ ?
n®¥ è n ø {anbm | n, m ³ 1, n ¹ m}, which of the following is true.
(a) L1 Ç L 2 is regular
(a) 0 (b) e–2
–1/2 (b) L1 Ç L 2 is context free
(c) e (d) 1
(c) L1 is context free
37. What is the probability that a divisor of 1099 is a multiple of
(d) L1 and L2 both are context free
1096 ?
44. Which of the following language is described by regular
(a) 1/625 (b) 4/625 expression over [0, 1]
(c) 12/625 (d) 16/625 (0 + 1)*1*(0 + 1)*0?
38. Four matrices M1, M2, M3 and M4 of dimensions p × q, q × r, (a) Set of all string containing at least 10
r × s and s × t respectively can be multiplied in several ways (b) Set of all string end with 0
with different number of total scalar multiplications. For (c) Set of all string containing odd number of 0’s
example when multiplied as ((M1 × M2) × (M3 × M4)), the (d) Set of all string containing substring 10
total number of scalar multiplications is pqr + rst + prt. When 45. Which of the following grammar is an operator grammar?
multiplied as (((M1 × M2) × M3) × M4), the total number of (a) S ® aAb/aA/B (b) S ® aA/Bc/e
scalar multiplications is pqr + prs + pst. A ® AcB/D A ® aB/B
If p = 10, q = 100, r = 20, s = 5, and t = 80, then the minimum B®C
number of scalar multiplications needed is (c) S ® AA/c (d) S ® cB/aA
(a) 248000 (b) 44000 A ® Bc/a A ® bB
(c) 19000 (d) 25000 B®Î
30
46. Consider the following propositional statements : 51. Considering an operating system capable of loading and
executing a single sequential user process at a time. The
P1 : ( ( A Ù B ) ® C ) º ( ( A ® C ) Ù ( B ® C ) )
disk scheduling algorithm used in FCFS. If FCFS is replaced
P2 : (( A Ú B ) ® C ) º ( ( A ® C ) Ú ( B ® C ) ) by SSTF, claimed by the vendor to given 50% better
benchmark results, what is the expected improvement in IN/
Which one of the following is true? OUT performance of user programs?
(a) P1 is a tautology, but not P2 (a) 50% (b) 40%
(b) P2 is tautology but not P1 (c) 25% (d) 0%
(c) Both P1 and P2 are tautologies 52. The following program consists of 3 concurrent processes
(d) Both P1 and P2 are not tautologies and 3 binary semaphores. The semaphores are initialized as
47. The following DFA accepts the set of all strings over [0, 1] S0 = 1, S1 = 0, S2 = 0.
Process P0 Process P1 Process P2
1 1 1 while (true) Wait (S1) Wait (S2)
0, 1
that 0 0 release (S0) release (S0)
{
wait (S0)
(a) begin with 0 print (0)
(b) begin with 00 release (S1)
(c) contain substring 00 release (S2)
(d) contain at most two 0’s }
48. Which regular expression does not describe the language How many times will process P0 print 0?
containing at least two 0’s and ends with 1 over alphabet {0, 1}. (a) Atleast twice (b) Exactly twice
(a) (0 + 1)*0 (0 + 1)*0(0 + 1)*1 (c) Thrice (d) Exactly once
(b) (0 + 1)*0(0* + 1*)*0 0*(0 + 1)*1 53. A multilevel page table is preferred in comparison to a single
(c) 0*0(0 + 1)*0(0 + 1)*1 level page table for translating virtual address to physical
(d) (0* + 1*)*0 0*(0* + 1*)*0(0 + 1)*1 address because
49. Consider the processes listed below {P1, P2, P3, P4 and P5} (a) It help to reduce the no. of page faults in page
with the burst time and priority. Assume that all process replacement algorithm.
arrive at time O. (b) It has a side buffer which is used for translation.
(c) It reduce memory access time to read and write.
Process Burst time Priority (d) It helps to reduce the size of page table need to
P1 3 1 implement the virtual address space.
P2 7 2 54. Which of the following is FALSE?
(a) Deadlock avoidance is less restrictive than deadlock
P3 2 2
prevention.
P4 4 4 (b) In deadlock avoidance, the request for resource is
P5 1 3 always granted if the request state is safe and resulting
state is safe.
Which of the following algorithm results in the minimum (c) In deadlock prevention, the request for resource is
average waiting time (over all processes)? always granted if resulting state is safe.
(a) FCFS (d) Deadlock avoidance requires knowledge of resource
(b) SJF requirement.
(c) Non-premptive priority 55. Which of the following queries will give the names of
(d) Round Robin Scheduling (quantum = 1) employee who is earning maximum salary?
50. Disk request received by a disk drive for cylinders 5, 25, 18, (a) select name from emp
3, 39, 8 and 35 in that order. A seek takes 5 ms per cylinder where sal = (select max (sal) from emp emp);
moved. How much seek time is needed to serve these (b) select name from emp
requests for a Shortest Seek First (SSF) algorithm? Assume where sal > = all (select sal from emp);
that the arm is at cylinder 20 when last of the request is (c) Both (a) and (b) are correct queries but processing is
made with none of the requests yet served. too high in B than A
(a) 125 (b) 750 (d) Both (a) and (b) are correct queries but processing is
(c) 295 (d) 935 too high in A than B
31
56. Consider the schema R = (S T U V) and dependencies 61. A 4 km long broadcast LAN has data transfer rate of 108 bps
S ® T, T ® U, U ® V, U ®V and V ® S and uses CSMA/CD. The signal travels along the UTP wire
Let R = (R1 and R2 ) be a decomposition such that at 2 × 108 m/s. What is the minimum packet size that can be
R1 Ç R 2 = f . The decomposition is used on this network?
(a) 200 bytes (b) 20 bytes
(a) Not in 2NF (b) In 2NF but not in 3NF
(c) 2000 bites (d) 150 bits
(c) In 3NF but not in 2NF (d) In both 2NF and 3NF
62. You have a class C 193.158.12.0/28 network. How many
57. Consider two relation schema R1 = (A, B, C, D, E) and R2 =
usable subnets and hosts do you have?
(A, B, C, D, E).
(a) 16 subnets, 16 hosts (b) 14 subnets, 14 hosts
Statement 1 is the functional dependency of R1 and
(c) 20 subnets, 6 hosts (d) 50 subnets, 2 hosts
Statement 2 is the functional dependency of R2.
63. Let R be a relation, which of the following comments about
1. A ® B, AB ® C, D ® AC, D ® E
the relation R is/are correct?
2. A ® BC, D ® AE
1. R will necessarily have a composite key, if R is in BCNF
Which of the following statements is true?
but not in 4 NF.
(a) Functional dependency of R1 is equivalent to functional
2. If R is in 3 NF and if every key of R is simple, then R is
dependency of R2
in BCNF.
(b) Functional dependency of R1 and R2 are not equivalent
3. If R is in BCNF and if R has at least one simple key,
(c) We cannot compare functional dependency of R1 and
then R is in 4 NF.
R2
4. If R is in 3 NF and if its every key is simple, then R is in
(d) None of the above
5 NF.
58. Which of the following statement is true?
(a) Only 1 (b) 1 and 2
(a) A prime attribute can be transitively dependent on a
(c) 1, 2 and 3 (d) All of these
key in 2 NF.
64. Which of the following is true about a transparent router ?
(b) A prime attribute can be transitively dependent on a
(a) It connects two LANs
key is 3 NF.
(b) It connects two WANs
(c) A relation with any attributes is in BCNF.
(c) It connects LAN and WAN
(d) A prime attribute can be transitively dependent on a
(d) None of the above
BCNF relation.
65. Consider the following routing table at an IP router.
59. Which of the following is FALSE regarding BCNF?
(a) To decide if a given database schema is in BCNF, is Network No. Net Mask Next Hop
NP-complete problem 128.96.170.0 255.255.254.0 Interface 0
(b) BCNF cannot have any transitive dependency
128.96.168.0 255.255.254.0 Interface 1
(c) Every set of FD’s for relations can be represented by a
BCNF schema. 128.96.166.0 255.255.254.0 R2
(d) A relation schema R is in BCNF if for every set of 128.96.164.0 255.255.252.0 R3
attributes X in R and attribute A in R, X is super key 0.0.0.0 Default R4
whenever X ® A
For each IP address in Group I identify the correct choice of
60. The employee information of an organization is stored as
the next hop from Group II using the entries from the routing
Emp (name, sex, salary, dept, DOB)
table above.
Consider the following query :
Group I Group II
select dept from emp
i. 128.96.171.92 a. Interface 0
where sex = “F”
ii. 128.96.167.151 b. Interface 1
group by dept
iii. 128.96.163.151 c. R2
having avg (salary) > (select avg salary from emp)
iv. 128.96.165.121 d. R3
The above query returns
e. R4
(a) The average salary of female emp is more than the avg
(a) i–a, ii–c, iii–e, iv–d
salary in company.
(b) i–a, ii–d, iii–b, iv–e
(b) The avg salary of female emp is more than avg salary
(c) i–b, ii–c, iii–d, iv–e
in dept
(d) i–b, ii–c, iii–e, iv–d
(c) The avg salary is more then female emp in dept.
32

HINTS & SOLUTIONS


1. (d) Vitriolic (adj.) means bitterly scathing; conflict. P´ 4´ r
9. (b) A: P =
2. (b) Inauspicious (adj.) means not favourable or 100
unfortunate; not promising success. Þ r = 25%
3. (b) This is the only option in which the sentence 2
construction is clear and unambiguous. In option (a) æ 25 ö 25P
B : P ç1 + ÷ =
and (c), the sentence reads as though the ingredients è 100 ø 16
were making the torte. Option (d) is incorrect because
25 P 2 ´ 25 25 P
there is a shift in tense from present (making) to past Again ´ =
perfect (should have used). 16 100 32
Therefore total amount of A after 4 years = 2P
æ 55 - 5 ö æ 55 + 5 ö and total amount of B after 4 years
4. (c) ç ÷®ç ÷
è 55 + 5 ø è 55 - 5 ø
25P 25P 75P
= + =
50 60 16 32 32
Þ ® Therefore difference in amount
60 50
75P 11p
50 60 = - 2P = = 3300
Þ ´ =1 32 32
60 50
Þ p = 9600
a b 10. (d) 430 + 425 + 345 = 1200 parts are accounted for. Since
5. (a) log + log = log(a + b) the total is 1650; 1650 – 1200 = 450 blue parts. When
b a
randomly picking a part, the chance of getting blue
450 3
æa bö is 450 out of 1650 = = .
Þ log ç ´ ÷ = log ( a + b ) 1650 11
èb aø 11. (a)
12. 4
Þ log1 = log (a + b)
13. (a) Given : X n+1 = (X n / 2) + 3/(2X n )
Þ a+b = 1
f (X n )
6. (c) The last sentence gives direct support for this We know, X n-1 = X n - f '(X )
n
response. Although children might be better protected
from the sun than adults, the paragraph does not X2 = 3
specifically cite statistics about children, so we can't
X 2 -3 = f (X 2n )
know for sure, ruling out option (a). There is no
evidence provided in the paragraph to support f '(X n ) = 2X n
option (b) and (d).
7. (b) Tall, thin, and middle-aged are the elements of the X 2n - 3 2X 2n - X 2n +3
X n+1 = X n - =
description repeated most often and are therefore the 2´n 2´ n
most likely to be accurate.
X 2n + 3 X n 3
8. (d) The distances are equal. Therefore, = = +
2´n 2 2´ n
3 14. 7/8 Atleast one head and one tail
6= x
2 1
Probability that only head =
12 = 3x 16
x=4 Probability that only head or only tail
She walked at 4 mph. 1 1 1
= + =
16 16 8
33
Probability that no all head or no all tail
J
Clock pulse Q K Q ( t + 1)
1 7
= 1- =
8 8
(Q)
1 0 1 1 1
15. (d) Binary relation S = Q on set A = {1, 2, 3} is {Q, 1}, {Q, 2},
2 1 0 1 0
{Q, 3} which is not reflexive not symmetric
3 0 1 1 1
16. (b) Given p Å p = pp + pp = 0 4 1 0 1 0
Solve each option one by one 5 0 1 1 1

(i) p Å Øp = p Å 0 So, the sequence will be 10101010.


18. (d) To find the smallest positive value in the form mantissa
(Q Ø negatives the value of p ) × radixexponent, we choose the smallest positive mantissa,
and the smallest negative exponent.
= p.0 + p.0 = p
Since, the mantissa is an integer, the smallest positive
(ii) Ø ( p Å Øp ) = Ø ( p Å 0 ) = Ø ( p ) = 0 value possible is 1.
Since the exponent is an 8-bit two’s complement value,
(iii) ( p Å q ) Ú ( Øp Å Øq ) = ( pq + pq ) Ú 0 the smallest negative exponent is (10000000)2 i.e., –27
= – 128
= pq + pq Hence the smallest positive value is 1 × 2–128. The
largest positive value will consist of the largest positive
(iv) Øp Å q = 0 Å p = 0.p + 0.p = p mantissa and the largest positive exponent.
17. (a) From the given description, the circuit will look like The largest mantissa is 0111111111111111, which’s 2’s
complement is +215 – 1. The largest exponent is
01111111, which’s 2’s complement is +27 – 1 (+ 127).
Hence, the largest positive value is (215 – 1) × 2+127.
19. 840 Units
J Q
é105 ù
In the first pass we can create ê ú = 21 sorted subfiles
CLK ê 5 ú
each 5 page long
Q
1 K
In second pass by 4-way merging, one can create é 21 ù = 6
ê4ú
ê ú
Truth table of J-K flip-flop is sorted subfiles, each 20 page long (except last).

é6ù
Again applying 4-way merge sort, we can create ê ú = 2
Q J K Q ( t + 1) ê4ú
0 0 0 0 sorted subfiles.
0 0 1 0 These two can be merged to get the final sorted file.
0 1 0 1 We require a total of 4-passes.
0 1 1 1 Total cast will be 2 × 105 × 4 = 840 units.
1 0 0 1
1 0 1 0 20. (b) Þ ( A + BC ) B + ( A + BC ) CD
1 1 0 1
Þ AB + BC + ACD + BCD
1 1 1 0
= AB + ACD + BC (1 + D )

Truth table for given circuit will be = AB + ACD + BC


34
21. (b) If closures of F and G are available, then by using 27. (a) A Ù B*C - D + E / F / ( G + H )
BCNF definition we can identify the decomposition.
22. (b) If two bits or any even number of bits are inverted in A Ù B * C - D + E / F / GH +
byte during transmission, then this error cannot be AB Ù *C - D + E / F / GH + ( Ù has highest precedence)
detected by just only simple parity check to detect
AB Ù C * -D + E / F / GH +
error.
AB Ù C * - D + E / F / GH + /
23. (c) Representing Y in Karnaugh Map
AB Ù C * - D + EF / GH + /

AB AB Ù C * D - + EF / GH + /
CD 00 01 11 10 AB Ù C * D - EF / GH + /
0 1 3 2
00 1 1 d 1 28. (d) The integer value 257 is stored in the memory as
4 5 7 6
00000001 00000001. So, the individual bytes are taken
01 0 0 1 1 by casting it to char* and get printed.
12 13 15 14 29. (c)
11 0 0 d 1
9 11
30. (d) BST is
8 10
10 d 0 d 1

55
Þ Y = f (A, B, C, D) = C D + A
75
45
S E M
24. (a) 85
1 bit 8 bits 23 bits 24 50 60
(14.25)10 = (1110.01)2
1110.01 × 20 = 1.11001 × 23 10
35 48
S: 1
E : (3 + 127)10 = (10000010)2
31. (d) The procedure of inserting an element in the binary
M : 11001000 ------- search tree takes O (h) time, where h is the height of
Value stored: the tree.
It is known that the expected height of a randomly
1 1 0 0 0 0 0 10 1 1 0 0 1 0 0 0 0 - - -
built binary search tree on n keys is O (log n).
[C 1 6 4 0 0 0 ]H
\ The running time to insert an element = O(h)
25. (c) = O(log n)
\ The running time to insert n elements = O (n log n)
26. (c) fun = fun (fun (106))
32. (c) We know that, the order of the algorithm is equivalent
= fun (96) to the total sum of the order of that modules.
= fun (fun (107)) So, the order of given algorithm
= fun (97) = Order of module M1 + Order of module M2
= f(n) + f ¢(n)
= fun (fun (108))
33. (d) Loop terminate in O(1) time if n is even and O(2) time if
= fun (98) n is odd.
= fun (fun (109)) 34. (c) L 2 £ pL 4
= fun (99)
L1 £ pL 2
= fun (fun (110))
= fun (100) If L4 Î P
= fun (fun (111)) then L2 Î P
= fun (101) L1 Î P ,
= 91
Hence option (c).
35
35. (d) Minimum string that it will accept = 011 and it will 42. (b) The TM leaves the starting 0 and 1 as it is and then
always be in end but as at state A and B there are converts remainder of string to 0’s due to 0, 0, R and 1,
looping of 1 and 0. So, it will accept (0/1)*. 0, R combination of state B.
\ Regular expression = (011) * 011
\ (0 + 1) 0* enclosed by blanks will be the final
2n æ - n ö2 contents of tape after TM halts in F.
æ 1ö æ 1ö
36. (b) lim ç1- ÷ =ç lim ç1- ÷ ÷
n®¥ è n ø ç n®¥ è n ø ÷ 43. (b) There is the theorem which shows that intersection of
è ø
a regular language and context free language is context
= (e)–2 = e–2 free as L1 is regular and L2 is context free.
-f (x)
æ 1 ö 44. (b) The regular expression generate
[because lim ç1- ÷
n®¥ è f (x) ø {0, 00, 10, 000, 110, 100, 110, .....}
37. (a) Total number of divisors of 1099 = 299 × 599 = 2 × 5 and all string end with 0.
that are most direct of 1096 45. (a) Grammar with no Î production so that no consecutive
º (99 + 1)(991 + 1)
symbols on RHS of productions are non-terminals, will
1096 × 103
be operator grammar.
Þ 1096, 2 × 1096, 4 × 1096, 9 × 1096, 8 × 1096
From the given option, only option (a) does not contain
1000 any grammar with Î production and consecutive non-
=0
n
terminal symbols on RHS.
Þ 10 × 1096, 20 × 1096, 29 × 1096, 40 × 1096, 50 × 1096
n = 1 – 100 125 × 1096, 250 × 1096, 500 × 1096, 100 × 46. (d) P1 : ( ( A Ù B ) ® C ) º ( ( A ® C ) Ù ( B ® C ) )
1096, 100 × 1096, 200 × 1096
= total 16 LHS : ( A Ù B) ® C º AB ® C

10 1
\ Required probability = = = ( AB )¢ + C º A¢ + B¢ + C
10000 625
38. (c) Multiply as (M1 × (M2 × M3 )) × M4
RHS : ( A ® C ) Ù ( B ® C ) ¹ ( A ¢ + C )( B¢ + C )
Total number of scalar multiplication is
= qrs + pqs + pst = A ¢B¢ + C
= 10000 + 5000 + 4000 = 19000 Þ RHS ¹ LHS
39. (a) n = 1024
\ P1 is not tautology
f1(n) = 21024
f2(n) = 215 P2 : (( A Ú B ) ® C ) º ( ( A ® C ) Ú ( B ® C ) )
f3(n) = 10 × 210
f4(n) = 102410 = 2100 LHS : ( A Ú B ) ® C º A + B ® C
\ f3, f2, f4, f1 is required increasing order
40. 9 Want to paint 52 with k-color no adjacent letter will have = ( A + B )¢ + C
the same colour. This problem is 9 colourable, so k = 9
41. (b) L1 is not context-free but L2 is context-free grammar = A ¢B¢ + C
For L2, the grammar is
RHS : ( A ® C ) Ú ( B ® C ) = ( A¢ + C ) + ( B¢ + C )
S ® AT | ZB, A ® 000 A1|Î, B ® 111B2 |Î, T ® 2T |Î,

Z ® 0Z |Î A ¢ + B¢ + C

For example, The string accepted by the above grammar is Þ LHS ¹ RHS
S ® AT S ® ZB Þ P2 is also not tautology.
® 000 A12 T ® 0Z111B2 47. (d) The strings accepted by above DFA are { Ù , 1, 10, 0,
® 000000 A1122T ® 00Z111111B22 01, 00, 011, 011, 000111 .. only those contains at most
® 0000001122 ® 0011111122 two 0’s]
36
48. (c) 0*0(0 + 1)*0(0 + 1)*1 also have at least two 0’s but it Let us suppose P1 executes and release S0 (Now value
will never start with 1. of S0 is 1).
49. (b) SJF results in minimum waiting time of 4 s as Gantt Now there are two possibilities either P0 or P2 can
chart execute.
Let us take P2 executes and releases S0, so at the end
P5 P3 P1 P4 P2 P0 execute and print 0 (mean two 0’s) but if P0 executes
0 1 3 6 10 17 before P2, then total of 3 0’s will print (one at the time
Waiting time for of P0 and then P2 which release S0 so P0 executes again).

P1 = 3 So, the correct answer is atleast two 0’s.


P2 = 10 53. (d) Multilevel page table is used to reduce the page table
P3 = 1 size.
P4 = 6 54. (a)
P5 = 0 55. (d) Select name from emp
3 + 10 + 1 + 6 + 0 where sal = (select max(sal) from emp);
So, average waiting time = = 4s
5 This query will find the max salary, there is no
50. (c) The head will move in the following order : comparison, but
select name from emp
20 where sal > = all (select sal from emp);
This query will compare the salary of one employee to
18 other’s one by one. So, there are many comparisons
25
due to which performance of A is better than that of B.
35
56. (d) Decomposition is in both 2NF and 3NF. Because, S is
candidate key and there is no partial dependency and
39 transitive dependency holds.
5 8
3
57. (a) The candidate key for R1 is AD, because the closure of
AD contains all the attributes, i.e.,

Total moves = (20 – 18) + (25 – 18) + (35 – 25) + (39 – 35) + {AD}+ = {A, B, C, D, E}
(39 – 8) + (8 – 5) + (5 – 3) = 59 and closure of FD is
Seek takes 5 ms per cylinder moved {A ® B, AB ® C, A ® C, D ® AC, D ® A, D ® C, D ® E}
Þ Seek time = 5 × 59 = 295 ms The candidate key for R2 is AD and closure of FD is
51. (d) It is important to note that SSTF (Shortest Seek Time {A ® B, A ® C, A ® BC, D ® A, D ® C, D ® E, D ® AC}
First) is the optimal scheduling scheme for the access
As we can see clearly
of file only. Therefore, the IN/OUT performance of the
user program is determined by many input and output R1 @ R 2
devices and not only by the disk. So, when FCFS is Hence, functional dependency of R1 is equivalent to that of
replaced by SSTF, it improves only disk performance, R2.
not the IN/OUT performance. This implies, 58. (b) Attributes can be transitively dependent on a key in 3
improvement in performance of user program is 0%.
NF.
52. (a) Initially P0 will execute because only S0 = 1, it will print
59. (c)
single 0.
60. (a)
Now when S1 and S2 are released by P0 then any one
d
of them can be executed. 61. (c) L = R ´ bits = 2000 bits.
v
37
62. (b) Class C 193.158.12.0/28 network means there are 28 65. (a) Network ranges are
bits in the subnet. So, the subnet mask is
0 . 0 . 0 . 0 – default
11111111.11111111.11111111.11110000. 128 . 96 . 164 . 0
There are 4 bits belonging to the subnet and 4 bits to R3
belonging to host in the fourth octet. 128 . 96 . 165 . 0
128 . 96 . 166 . 0
So, 4 bits of subnet mask corresponds to to R2
128 . 96 . 167 . 255
(24 – 2) = 16 – 2 = 14 subnets
128 . 96 . 168 . 0
and 4 bits belonging to host address corresponds to to interface 1
128 . 96 . 169 . 255
(24 – 2) = 16 – 2 = 14 hosts. 128 . 96 . 170 . 0
63. (d) All the given statements above the relation R are true. to interface 0
Hence, the correct answer is option (d). 128 . 96 . 171 . 255
64. (c) Router is used to connect LAN to WAN. Ans = A
A– 1
B– 3
C– 5
D– 4

You might also like