Gate CS - 1998
Gate CS - 1998
Gate CS - 1998
com
Join discussion of this test paper at http://forum.gatementor.com
SECTION - A
1. This question consists of 35 THIRTY-FIVE multiple questions of ONE mark each.
For each question, four possible alternatives (A, B, C and D) are given, out of
which ONLY ONE is correct. Indicate the correct answer in the boxes
corresponding to the questions only on the FIRST sheet of the answer book.
1.1 A die is rolled three times. The probability that exactly one odd number turns up
among the three outcomes is
1 3 1 1
(a) (b) (c) (d)
6 8 8 2
1.3 Which of the following statements applies to the bisection method used for
finding roots of functions:
(a) converges within a few iterations
(b) guaranteed to work for all continuous functions
(c) is faster than the Newton-Raphson method
(d) requires that there be no error in determining the sign of the function.
1.4 Consider the function y = x in the interval [-1,1]. In this interval, the function is
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
GATE CS - 1998 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
1.6 Suppose A is a finite set with n elements. The number of elements in the largest
equivalence relation of A is
(a) n (b) n2 (c) 1 (d) n + 1
1.7 Let R1 and R2 be two equivalence relations on a set. Consider the following
assertions:
(i) R1 ∪ R2 is an equivalence relation
(ii) R1 ∩ R2 is an equivalence relation
Which of the following is correct?
(a) Both assertions are true
(b) Assertion (i) is true but assertion (ii) is not true
(c) Assertion (ii) is true but assertion (i) is not true
(d) Neither (i) nor (ii) is true
1.9 If the regular set A is represented by A = (01 + 1)* and the regular set ‘B’ is
represented by B = ((01)*1*)*, which of the following is true?
(a) A ⊂ B (b) B ⊂ A
(c) A and B are incomparable (d) A = B
1.10 Which of the following set can be recognized by a Deterministic Finite state
Automaton?
(a) The numbers 1, 2, 4, 8, ……………. 2n , ………… written in binary
(b) The numbers 1, 2, 4, ………………., 2n , …………..written in unary
(c) The set of binary string in which the number of zeros is the same as the
number of ones.
(d) The set {1, 101, 11011, 1110111, ………..}
1.12 The string 1101 does not belong to the set represented by
(a) 110*(0 + 1) (b) 1 ( 0 + 1)* 101
(c) (10)* (01)* (00 + 11)* (d) (00 + (11)*0)*
1.13 What happens when a bit-string is XORed with itself n-times as shown:
B ⊕ B ⊕ B ⊕ ( B K n times
( (
(a) complements when n is even (b) complements when n is odd
(c) divides by 2n always
(d) remains unchanged when n is even
1.16 In serial communication employing 8 data bits, a parity bit and 2 stop bits, the
minimum band rate required to sustain a transfer rate of 300 characters per
second is
(a) 2400 band (b) 19200 band
(c) 4800 band (d) 1200 band
1.18 Which of the following devices should get higher priority in assigning interrupts?
(a) Hard disk (b) Printer
(c) Keyboard (d) Floppy disk
1.19 Which of the following addressing modes permits relocation without any change
whatsoever in the code?
(a) Indirect addressing (b) Indexed addressing
(c) Base register addressing (d) PC relative addressing
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
GATE CS - 1998 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
1.21 Which one of the following algorithm design techniques is used in finding all pairs
of shortest distances in a graph?
(a) Dynamic programming (b) Backtracking
(c) Greedy (d) Divide and Conquer
(a) A – R B – P C – Q D - S (b) A – R B – P C – S D - Q
(c) A – P B – R C – S D - Q (d) A – P B – S C – R D - Q
1.23 How many sub strings of different lengths (non-zero) can be found formed from a
character string of length n?
n ( n + 1)
(a) n (b) n2 (c) 2n (d)
2
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
GATE CS - 1998 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
1.28 A linker reads four modules whose lengths are 200, 800, 600 and 500 words,
respectively. If they are loaded in that order, what are the relocation constants?
(a) 0, 200, 500, 600 (b) 0, 200, 1000, 1600
(c) 200, 500, 600, 800 (d) 200, 700, 1300, 2100
1.30 When the result of a computation depends on the speed of the processes
involved there is said to be
(a) cycle steating (b) rare condition
(c) a time lock (d) a deadlock
1.31 A counting semaphore was initialized to 10. Then 6 P (wait) operations and 4V
(signal) operations were completed on this semaphore. The resulting value of the
semaphore is
(a) 0 (b) 8 (c) 10 (d) 12
1.32 A computer has six tape drives, with n processes competing for them. Each
process may need two drives. What is the maximum value of n for the system to
be deadlock free?
(a) 6 (b) 5 (c) 4 (d) 3
1.33 Given two union compatible relations R1(A,B) and R2 (C,D), what is the result of
the operation R1A = CAB = DR2?
(a) R1 ∪ R2 (b) R1 × R2 (c) R1 − R2 (d) R1 ∩ R2
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
GATE CS - 1998 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
1.34 Which normal form is considered adequate for normal relational database design?
(a) 2 NF (b) 5 NF (c) 4 NF (d) 3 NF
There is an index file associated with this and it contains the values 1,3,2,5 and
4.Which one of the fields is the index built from?
(a) Age (b) Name (c) Occupation (d) Category
1 4 8 7
0 0 3 0
4 2 3 1
3 12 24 2
(a) 3 (b) 1 (c) 2 (d) 4
1 a bc
2.2. Consider the following determinant ∆ = 1 b ca .
1 C ab
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
GATE CS - 1998 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
2.3. The binary relation R = {(1,1)} , (2,1) , (2, 2) , (2, 3) , (2, 4) , (3,1) , (3,2) , (3, 3) , (3, 4) on
the set A = {1,2,3,4} is
(a) reflexive, symmetric and transitive
(b) neither reflexive, nor irreflexive but transitive
(c) irreflexive, symmetric and transitive
(d) irreflexive and antisymmetric
2.4. In a room containing 28 people, there are 18 people who speak English, 15
people who speak Hindi and 22 people who speak Kannada. 9 persons speak both
English and Hindi, 11 persons speak both Hindi and Kannada whereas 13 persons
speak both Kannada and English. How many people speak all three languages?
(a) 9 (b) 8 (c) 7 (d) 6
2.5. Let L be the set of all binary strings whose last two symbols are the same. The
number of states in the minimum state deterministic finite 0 state automaton
accepting L is
(a) 2 (b) 5 (c) 8 (d) 3
1 1 0 0 1
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
GATE CS - 1998 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
2.11. A complete n-ary tree is one in which every node has O or n sons. If x is the
number of internal nodes of a complete n-ary tree, the number of leaves in it is
given by
(a) x(n – 1) +1 (b) xn - 1 (c) xn + 1 (d) x(n+1)
2.12. What value would the following function return for the input x = 95?
Function fun (x:integer):integer;
Begin
If x > 100 then fun : x – 10
Else fun : fun(fun (x + 11))
End;
(a) 89 (b) 90 (c) 91 (d) 92
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
GATE CS - 1998 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
Root 2 KB
A 4 KB B 6 KB C 8 KB
D 6 KB E 8 KB F 2 KB G 4 KB
What will be the size of the partition (in physical memory) required to load (and
run) this program?
(a) 12 KB (b) 14 KB (c) 10 KB (d) 8 KB
2.17. Consider n processes sharing the CPU in a round-robin fashion. Assuming that
each process switch takes s seconds, what must be the quantum size q such that
the overhead resulting from process switching is minimized but at the same time
each process is guaranteed to get its turn at the CPU at least every t seconds?
t − ns t − ns t − ns t − ns
(a) q ≤ (b) q ≥ (c) q ≤ (d) q ≥
n −1 n −1 n +1 n +1
2.19. Which of the following query transformations (i.e. replacing the l.h.s. expression
by the r.h.s. expression) is incorrect? R1 and R2 are relations, C1, C2 are selection
conditions and A1, A2 are attributes of R1?
( ) (
(a) σ c1 σ c1 ( R1 ) → σ c 2 σ c 2 ( R1 ) ) ( ) (
(b) σ c1 π A1 ( R1 ) → π A1 σ c1 ( R1 ) )
(c) σ c1 ( R1 ∪ R2 ) → σ c1 ( R1 ) ∪ σ c1 ( R2 ) (d) π A1 (σ c1 ( R1 ) ) → σ c1 (π A1 ( R1 ) )
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
GATE CS - 1998 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
2.20. Suppose the domain set of an attribute consists of signed four digit numbers.
What is the percentage of reduction in storage space of this attribute if it is
stored as an integer rather than in character form?
(a) 80% (b) 20% (c) 60% (d) 40%
3. (a) Two friends agree to meet at a park with the following conditions. Each will
reach the park between 4.0 p.m. and 5.00 p.m. and will see if the other has
already arrived. If not, they will wait for 10 minutes or the end of the hour
whichever is earlier and leave. What is the probability that the two will not
meet?
(b) Give a regular expression for the set of binary strings where 0 every is
immediately followed by exactly k 1’s and preceded by at least k 1’s (k is a
fixed integer)
5. (a) The implication gate, shown below has two inputs (x and y); the output is 1
except when x = 1 and y = 0, realize f = xy + xy using only four implication
gates.
(b) show that the implication gate is functionally complete.
Print the students that frequent at least one parlor that serves some ice-
cream that they like.
(b) In a computer system where the ‘best-fit’ algorithm is used for allocating
‘jobs’ to ‘memory partitions’, the following situation was encountered:
SECTION – B
This section consists of TWENTY questions numbered 8 to 27 of FIVE marks each.
Attempt ANY TEN questions. Answers must be given in the answer book provided.
Answer for each question must start on a fresh page and must appear at one place only.
(Answers to all parts of a question must appear together).
8. (a) Find the points of local maxima and minima, if any, of the following function
defined in 0≤x≤6.
x 3 − 6 x 2 + 9 x + 15
(b) Integrate
π
∫ π x cos xdx
−
9. Derive the expression for the number of operations required to solve a system of
linear equations in n unknowns using the Gaussian Elimination Method. Assume
that one operation refers to a multiplication followed by an addition.
10. (a) Prove by induction that the expression for the number of diagonals in a
n ( n − 3)
polygon of n sides is
2
(b) Let R be a binary relation on A = {a, b, c, d, e, f, g, h} represented by the
following two component digraph. Find the smallest integers m and n such
that m < n and Rm = Rn.
e
b
d
f
c h g
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
GATE CS - 1998 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
12. Let (A, *) be a semigroup, Furthermore, for every a and b in A, if a ≠ b, then a*b,
b ≠ b*a.
(a) Show that for every a in A
a*a =a
(b) Show that for every a, b in A
a*b*a =a
(c) Show that for every a, b, c in A
a*b*c = a*c
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
GATE CS - 1998 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
S1 a, S1 b S1 a B b
S1 a A b B Bb
AaA Bb
Aa
What is L(G1)?
(b) Use the grammar in Part (a) to give a CFG
for (
L2 = ai bi ak b1 i, j, k.1 ≥ 1, i = j or k = 1 by ) adding not more than 5
production rules.
(c) Is L2 inherently ambiguous?
15. (a) Draw the schematic of 8085 based system that can be used to measure the
width of a pulse. Assume that the pulse is given as a TTL compatible signal
by the source, which generates it.
(b) Write the 8085 Assembly Language program to measure the width of the
pulse. State all your assumptions clearly.
17. Calculate the total time required to read 35 sectors on a 2-sided floppy disk.
Assume that each track has 8 sectors and the track-to-track step time is 8
milliseconds. The first sector to be read is sector 3 on track 10. Assume that the
diskette is soft sectored and the controller has a 1-sector buffer. The diskette
spins at 300 RPM and initially; the head is on track 10.
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
GATE CS - 1998 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
19. (a) Let p be a pointer as shown in the figure in a single linked list.
…………. ………….
p cell i cell(i+1) cell(i+2) cell(i+3)
20. Draw the binary tree with node labels a, b, c, d, e, f and g for which the inorder
and postorder traversals result in the following sequences.
Inorder afbcdge
Postorder afcgedb
21. (a) Derive a recurrence relation for the size of the smallest AVL tree with height
h.
(b) What is the size of the smallest AVL tree with height 8?
(c)
23. Let the attribute ‘val’ give the value of a binary number generated by S in the
following grammar:
S L.L | L
L LB | B
B0|1
For example, an input 101.101 give S.val = 5.625
Construct a syntax directed translation scheme using only synthesized attributes,
to determine S.val.
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
GATE CS - 1998 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
24. (a) Four jobs are waiting to be run. Their expected run times are 6, 3, 5 and x.
in what order should they be run to minimize the average response time?
(b) Write a concurrent program using par begin-par end to represent the
procedure graph shown below.
S1
S2 S3
S4
S5
25. (a) Free disk space can be kept track of using a free list or a bit map. Disk
addresses require d bits. For a disk with B blocks, F of which are free, state
the condition under which the free list uses less space than the bit map.
(b) Consider a disk with C cylinders, t tracks per cylinder, s sectors per track and
a sector length sl. A logical file dl with fixed record length rl is stored
continuously on this disk starting at location (cL,tL,sL), when CL, tL and SL are
the cylinder, track and sector numbers, respectively. Derive the formula to
calculate the disk address (i.e. cylinder, track and sector) of a logical record
n assuming that rl = sl.