GATE 1997

Question 1

The probability that it will rain today is 0.5. The probability that it will rain tomorrow is 0.6. The probability that it will rain either today or tomorrow is 0.7. What is the probability that it will rain today and tomorrow?

A
0.3
B
0.25
C
0.35
D
0.4
       Engineering-Mathematics       Probability
Question 1 Explanation: 
P(Today) = 0.5
P(Tomorrow) = 0.6
P(T∪To) = 0.7
P(T∩To) = P(T) + P(To) - P(T∪To)
= 0.5 + 0.6 - 0.07
= 1.1 - 0.7
= 0.4
Question 2

The Newton-Raphson method is used to find the root of the equation x2 - 2 = 0. If the iterations are started from -1, the iterations will

A
converge to -1
B
converge to √2
C
converge to - √2
D
not converge
       Engineering-Mathematics       Newton-Raphson-Method
Question 2 Explanation: 
Question 3

The determinant of the matrix is is:

A
11
B
-48
C
0
D
-24
       Engineering-Mathematics       Linear-Algebra
Question 3 Explanation: 
Determinant of given matrix = 6 × 2 × 4 × (-1) = -48
Question 4

The concatenation of two lists is to be performed in O(1) time. Which of the following implementations of a list should be used?

A
Singly linked list
B
Doubly linked list
C
Circular doubly linked list
D
Array implementation of list
       Data-Structures       Linked-List
Question 4 Explanation: 
In circular doubly linked list concatenation of two lists is to be performed on O(1) time.
Question 5

The correct matching for the following pairs is

(A) All pairs shortest path          (1) Greedy
(B) Quick Sort                       (2) Depth-First search
(C) Minimum weight spanning tree     (3) Dynamic Programming
(D) Connected Components             (4) Divide and and Conquer 
A
A – 2 B – 4 C – 1 D – 3
B
A – 3 B – 4 C – 1 D – 2
C
A – 3 B – 4 C – 2 D – 1
D
A – 4 B – 1 C – 2 D – 3
       Algorithms        Match-the-Following
Question 5 Explanation: 
All pairs shortest path - Dynamic Programming
Quick sort - Divide and Conquer
Minimum weight Spanning tree - Greedy
Connected components - Depth-First search
Question 6

In the following grammar

         X ::= X ⊕ Y/Y
         Y ::= Z * Y/Z
         Z ::= id  

Which of the following is true?

A
‘⊕’ is left associative while ‘*’ is right associative
B
Both ‘⊕’ and ‘*’ is left associative
C
‘⊕’ is right associative while ‘*’ is left associative
D
None of the above
       Compiler-Design       Grammar
Question 6 Explanation: 

⊕ is left associative.
* is right associative.
Question 7

Which of the following is essential for converting an infix expression to the postfix from efficiently?

A
An operator stack
B
An operand stack
C
An operand stack and an operator stack
D
A parse tree
       Data-Structures       Stacks
Question 7 Explanation: 
An operator stack ⇒ Infix to (Postfix or Prefix)
An operand stack ⇒ Postfix to Prefix
Operator & operand stack ⇒ We don't use two stacks
Parse tree ⇒ No use
Question 8

A language L allows declaration of arrays whose sizes are not known during compilation. It is required to make efficient use of memory. Which of the following is true?

A
A compiler using static memory allocation can be written for L
B
A compiler cannot be written for L; an interpreter must be used
C
A compiler using dynamic memory allocation can be written for L
D
None of the above
       Compiler-Design       Run-Time-Environments
Question 8 Explanation: 
Compiler is use dynamic memory allocation then the memory will be allocated to an array at runtime.
Question 9

The conditional expansion facility of macro processor is provided to

A
test a condition during the execution of the expanded program
B
to expand certain model statements depending upon the value of a condition during the execution of the expanded program
C
to implement recursion
D
to expand certain model statements depending upon the value of a condition during the process of macro expansion
       Compiler-Design       Macros
Question 9 Explanation: 
Macro is expanded during the process of Macro expansion.
Question 10

Heap allocation is required for languages

A
that support recursion
B
that support dynamic data structures
C
that use dynamic scope rules
D
None of the above
       Compiler-Design       Run-Time-Environments
Question 10 Explanation: 
Heap allocation is required for languages that support dynamic data structures.
Question 11

Let * be defined as x * y = x' + y. Let z = x * y. Value of z * x is

A
x'+y
B
x
C
0
D
1
       Digital-Logic-Design       Boolean-Expressions
Question 11 Explanation: 
Question 12

RST 7.5 interrupt in 8085 microprocessor executes the interrupt service routine from interrupt vector location

A
0000H
B
0075H
C
003CH
D
0034H
       Computer-Organization       Microprocessor
Question 12 Explanation: 
RST7.5 then location is = 7.5*8 = 60 (8085 is 8 bit processor)
→ 60 in hexa decimal is 003CH.
Question 13

Purpose of a start bit in RS 232 serial communication protocol is

A
to synchronize receiver for receiving every byte
B
to synchronize receiver for receiving a sequence of bytes
C
a parity bit
D
to synchronize receiver for receiving the last byte
       Computer-Organization       Serial-Communication
Question 13 Explanation: 
RS-232 needs a start before each byte transmission for synchronization.
Question 14

The correct matching for the following pairs is

(A) DMA I/O                    (1) High speed RAM
(B) Cache                      (2) Disk
(C) Interrupt I/O              (3) Printer
(D) Condition Code Register    (4) ALU 
A
A – 4 B – 3 C – 1 D – 2
B
A – 2 B – 1 C – 3 D – 4
C
A – 4 B – 3 C – 2 D – 1
D
A – 2 B – 3 C – 4 D – 1
       Computer-Organization       Match-the-Following
Question 14 Explanation: 
DMA I/O → Disk
Cache → High speed RAM
Interrupt I/O → Printer
Condition code register → ALU
Question 15

An N-bit carry look ahead adder, where N is a multiple of 4, employs ICs 74181 (4 bit ALU) and 74182 (4 bit carry look ahead generator).

The minimum addition time using the best architecture for this adder is

A
proportional to N
B
proportional to log N
C
a constant
D
None of the above
       Digital-Logic-Design       Adder
Question 16

Let (Z,*) be an algebraic structure, where Z is the set of integers and the operation * is defined by n*m = maximum (n,m). which of the following statements is true for (Z,*)?

A
(Z,*) is a monoid
B
(Z,*) is an Abelian group
C
(Z,*) is a group
D
None of the above
       Engineering-Mathematics       Sets-And-Relation
Question 16 Explanation: 
Semigroup - Closed and associative
Monoid - Closed, Associative and has an identity
Group - Monoid with inverse
Abelian group - Group with commutative property
Go through with given:
Closure: Yes.
(m*n = max(m,n)) output is either m or n whichever is maximum since m,n belongs z. The result of the binary operation also belongs to z. So given is satisfying closure property.
Associative: Yes.
The output is max among the elements and it is associative.
Identity: No.
We don't have single unique element for all the elements which is less than all the elements.
Given one is semigroup only.
Question 17

Which of the following propositions is a tautology?

A
(p ∨ q) → p
B
p ∨ (q → p)
C
p ∨ (p → q)
D
p → (p → q)
       Engineering-Mathematics       Propositional-Logic
Question 17 Explanation: 
Question 18

In a lattice defined by the Hasse diagram given in following figure, how many complements does the element 'e' have?

A
2
B
3
C
0
D
1
       Engineering-Mathematics       Sets-And-Relation
Question 18 Explanation: 
g, c, d are the complements of e.
No. of complements = 3
e∨g = a and e∧g = f
e∨c = a and e∧c = f
e∨d = a and e∧d = f
Question 19

Given Σ = {a,b}, which one of the following sets is not countable?

A
Set of all strings over Σ
B
Set of all languages over Σ
C
Set of all regular languages over Σ
D
Set of all languages over Σ accepted by Turing machines
       Theory-of-Computation       Countability
Question 19 Explanation: 
Uncountable: Set of all languages over Σ is uncountable.
Question 20

Locality of reference implies that the page reference being made by a process

A
will always be to the page used in the previous page reference
B
is likely to be to one of the pages used in the last few page references
C
will always be to one of the pages existing in memory
D
will always lead to a page fault
       Operating-Systems       Locality-of-Reference
Question 20 Explanation: 
Locality of reference is also called as principle of locality. There are three different principle of locality:
(1) Temporal locality
(2) Spatial locality
(3) Sequential locality
→ In programs related data are stored in consecutive locations and loops in same locations are used repeatedly.
Question 21

The correct matching for the following pairs is

(A) Disk Scheduling        (1) Round robin
(B) Batch Processing       (2) SCAN
(C) Time sharing           (3) LIFO
(D) Interrupt processing   (4) FIFO  
A
A – 3 B – 4 C – 2 D – 1
B
A – 4 B – 3 C – 2 D – 1
C
A – 2 B – 4 C – 1 D – 3
D
A – 3 B – 4 C – 3 D – 2
       Operating-Systems       Match-the-Following
Question 21 Explanation: 
Disk scheduling - SCAN
Batch processing - FIFO
Time sharing - Round Robin
Interrupt processing - LIFO
Question 22

I/O redirection

A
implies changing the name of a file
B
can be employed to use an existing file as input file for a program
C
implies connection 2 programs through a pipe
D
None of the above
       Operating-Systems       File-System
Question 22 Explanation: 
Redirection is known as capturing output from a file, command, program (or) even code block within a script and sending it as input to another file, command, program (or) script.
Question 23

When an interrupt occurs, an operating system

A
ignores the interrupt
B
always changes state of interrupted process after processing the interrupt
C
always resumes execution of interrupted process after processing the interrupt
D
may change state of interrupted process to 'blocked’ and schedule another process
       Computer-Organization       Interrupt
Question 23 Explanation: 
Option A: Based on the priority.
Option B: Not always.
Option C: Not always. If some high priority interrupt comes during execution of current interrupt then it fails.
Option D: It is True always.
Question 24

Thrashing

A
reduces page I/O
B
decreases the degree of multiprogramming
C
implies excessive page I/O
D
improve the system performance
       Operating-Systems       Thrashing
Question 24 Explanation: 
Thrashing implies excessive page I/O.
Question 25

Dirty bit for a page in a page table

A
helps avoid unnecessary writes on a paging device
B
helps maintain LRU information
C
allows only read on a page
D
None of the above
       Operating-Systems       Virtual memory
Question 25 Explanation: 
The dirty bit allows for a performance optimization i.e., Dirty bit for a page in a page table helps to avoid unnecessary writes on a paging device.
Question 26

What is the maximum value of the function f(x) = 2x2 - 2x + 6 in the interval [0,2]?

A
6
B
10
C
12
D
5.5
       Engineering-Mathematics       Calculus
Question 26 Explanation: 
For f(x) to be maximum
f'(x) = 4x - 2 = 0
⇒ x = 1/2
So at x = 1/2, f(x) is an extremum (either maximum or minimum).
f(2) = 2(2)2 - 2(2) + 6 = 10
f(1/2) = 2 × (1/2)2 - 2 × 1/2 + 6 = 5.5
f(0) = 6
So, the maximum value is at x=2 which is 10 as there are no other extremum for the given function.
Question 27

Let A = (aij) be an n-rowed square matrix and I12 be the matrix obtained by interchanging the first and second rows of the n-rowed Identify matrix. Then AI12 is such that its first

A
row is the same as its second row
B
row is the same as the second row of A
C
column is the same as the second column of A
D
row is all zero
       Engineering-Mathematics       Linear-Algebra
Question 27 Explanation: 
Let A be 3×3 matrix and I12 be matrix obtained by interchanging the first and second rows of the 3-rowed Identity matrix.

So, we can see that column 1 and 2 got interchanged.
Question 28

Using a forward Euler method to solve y′′(t) = f(t), y(0), y′′(0) = 0 with a step size of h, we obtain the following values of y in the first four iterations:

A
0, hf(0), h(f(0) + f(h)) and h(f(0) + f(h) = f(2h))
B
0, 0 h2f(0) and 2h2f(0) + f(h)
C
0, 0, h2f(0) 3h2f(0)
D
0, 0, hf(0) + h2f(0) and hf(0) + h2f(0) + hf(h)
       Engineering-Mathematics       Numerical-Methods
Question 28 Explanation: 
Note: Out of syllabus.
Question 29

A polynomial p(x) is such that p(0) = 5, p(1) = 4, p(2) = 9 and p(3) = 20. The minimum degree it can have is

A
1
B
2
C
3
D
4
       Engineering-Mathematics       Polynomials
Question 29 Explanation: 
Lets take p(x) = ax + b
p(0) = 5 ⇒ b = 5
p(1) = 4 ⇒ a+b = 4 ⇒ a = -1
p(2) = 9 ⇒ 40+b = 9 ⇒ -4+5 = 9, which is false.
So degree 1 is not possible.
Lets take p(x) = ax2 + bx +c
p(0) = 5 ⇒ c = 5
p(1) = 4 ⇒ a+b+c = 4 ⇒ a+b = -1 -----(1)
p(2) = 9 ⇒ 4a+2b+c = 9 ⇒ 2a+b = 2 -----(2)
(2) - (1)
⇒ a = 3, b = -1-1 = -4
p(3) = 20 ⇒ 9a+3b+c = 20
⇒ 27-12+5 = 20
⇒ 20 = 20, True
Hence, minimum degree it can have.
Question 30

A binary search tree contains the value 1, 2, 3, 4, 5, 6, 7, 8. The tree is traversed in pre-order and the values are printed out. Which of the following sequences is a valid output?

A
5 3 1 2 4 7 8 6
B
5 3 1 2 6 4 8 7
C
5 3 2 4 1 6 7 8
D
5 3 1 2 4 7 6 8
       Data-Structures       Binary-Trees
Question 30 Explanation: 
Preorder traversal means (Root, left, right)
Option D:
Let draw binary search tree for the given sequence,

After traversing through this tree we will get same sequence.
Question 31

Let T(n) be the function defined by T(1)= 1, T(n)= 2T(⌊n/2⌋) + √n for n≥2. Which of the following statement(s) is true?

A
T(n) = O(√n)
B
T(n) = O(n)
C
T(n) = O(log n)
D
None of the above
       Algorithms        Time Complexity
Question 31 Explanation: 
Apply Master's theorem.
Question 32

A priority queue Q is used to implement a stack that stores characters. PUSH (C) is implemented INSERT (Q, C, K) where K is an appropriate integer key chosen by the implementation. POP is implemented as DELETEMIN(Q). For a sequence of operations, the keys chosen are in

A
non-increasing order
B
non-decreasing order
C
strictly increasing order
D
strictly decreasing order
       Data-Structures       Stack-and-Queue
Question 32 Explanation: 
In stack last element pushed should be popped first. And in priority queue Q, minimum element is given the highest priority. So whenever we will call DELETEMIN(Q), it will pop the element with min value. So we can conclude that the minimum element should be inserted last or the insertion should be in decreasing order. And also it should be in strictly decreasing order, because for two elements with equal value the priority queue will pick any of one randomly which should not be the case in the stack.
Question 33

Given the following Pascal-like program segment

Procedure A;
  x,y: integer;
   Procedure B;
    x,z: real
    S1
   end B;
   Procedure C;
      i: integer;
       S2
   end C;
end A; 

The variables accessible in S1 and S2 are

A
x or A, y, x of B and z in S1 and
x of B, y and i in S2
B
x or B, y and z in S1 and
x of B, i and z in S2
C
x or B, z and y in S1 and
x of A, i and y in S2
D
None of the above
       Programming       PASCAL-Programming
Question 33 Explanation: 
Note: Out of syllabus.
Question 34

The expression (a*b)* c op....
where 'op' is one of '+', '*' and '↑' (exponentiation) can be evaluated on a CPU with a single register without storing the value of (a * b) if

A
‘op’ is ’+’ or ‘*’
B
‘op’ is ’↑’ or ‘*’
C
‘op’ is ’↑’ or ‘+’
D
not possible to evaluate without storing
       Computer-Organization       Register-Allocation
Question 34 Explanation: 
Lets say, the expression is one of the below:
(a*b)*c + d
(a*b)*c * d
(a*b)*c ∧ d
In any case, brackets has the highest priority always. So I have to compute brackets first. Now, for + and *, I can do the rest of the operation and save results in the same register. But for exponentiation, I have to store the result of a*b, then do the computation of c∧d, then multiply these two results.
Hence, (A) is correct.
Question 35

The trapezoidal method to numerically obtain has an error E bounded by

 ((b-a)/12)h2 max f''(x), x∈[a,b] 

where h is the width of the trapezoids. The minimum number of trapezoids guaranteed to ensure E ≤ 10-4 in computing ln 7 using f = 1/x is

A
60
B
100
C
600
D
10000
       Engineering-Mathematics       Trapezoidal Method
Question 35 Explanation: 
Note: Out of syllabus.
Question 36

Let f(x, y, z) = x' + y'x + xz be a switching function. Which one of the following is valid?

A
B
xz is a minterm of f
C
xz is an implicant of f
D
y is a prime implicant of f
       Digital-Logic-Design       K-Map
Question 36 Explanation: 
In sum of terms,any term is an implicant because it implies the function. So xz is an implicant and hence 'C' is the answer.
Question 37

Contents of A register after the execution of the following 8085 microprocessor program is

MVI  A, 55 H
MVI  C, 25 H
ADD  C
DAA 
A
7AH
B
80H
C
50H
D
22H
       Computer-Organization       Microprocessor
Question 37 Explanation: 
Note: Out of syllabus.
Question 38

A micro instruction into be designed to specify

    (a) none or one of the three micro operations of one kind and
    (b) none or upto six micro operations of another kind

The minimum number of bits in the micro-instruction is

A
9
B
5
C
8
D
None of the above
       Computer-Organization       Micro-Instructions
Question 38 Explanation: 
(a) This is a vertical microprogramming because at any given time atmost one micro-operations will be activated.
So, no. of bits required
⌈log2 (3)⌉ = 2
(b) This is a horizontal micro-programming because at any given time atmost six micro-operations will be activated.
So, no. of bits required = 6
So, total minimum no. of bits required = 6+2 = 8
Question 39

Given √224)r = 13)r.
The value of the radix r is:

A
10
B
8
C
5
D
6
       Digital-Logic-Design       Number-Systems
Question 39 Explanation: 
(√224)r = (13)r
Convert r base to decimal.
√2r2 + 25 + 4 = r + 3
Take square both sides,
2r2 + 2r + 4 = r2 + 6r + 9
r2 - 4r - 5 = 0
r2 - 5r + r - 5 = 0
r(r - 5) + (r - 5) = 0
r = -1, 5
r cannot be -1,
So r = 5 is correct answer.
Question 40

Consider a logic circuit shown in figure below. The functions f1, f2 and f (in canonical sum of products form in decimal notation) are:

f1(w,x,y,z) = ∑8,9,10
f2(w,x,y,z) = ∑7,8,12,13,14,15
f(w,x,y,z) = ∑8,9 

The function f3 is

A
Σ9,10
B
Σ9
C
Σ1,8,9
D
Σ8,10,15
       Digital-Logic-Design       Logic-Circuit
Question 40 Explanation: 
f = f1⋅f2 + f3
Since, f1 and f2 are in canonical sum of products form, f1⋅f2 will only contain their common terms that is f1⋅f2 = Σ8.
Now,
Σ8 + f3 = Σ8,9
So, f3= Σ9
Question 41

A partial order ≤ is defined on the set S= {x, a1, a2,.....an, y} as x < ai for all i and ai ≤ y for all i, where n≥1. The number of total orders on the set S which contain the partial order ≤ is

A
n!
B
n+2
C
n
D
1
       Engineering-Mathematics       Sets-And-Relation
Question 41 Explanation: 
To make this partial order a total order, we need the relation to hold for every two element of the partial order. Currently between any ai and aj, there is no relation.
So for every ai, aj we have to add either (ai, aj) or (aj, ai in total order. So, this translates to giving an ordering for n elements between x and y, which can be done in n! ways. So answer is (A).
Question 42

Let G be a graph with 100 vertices numbered 1 to 100. Two vertices i and j are adjacent if |i - j| = 8 or |i - j| = 12. The number of connected components in G is

A
8
B
4
C
12
D
25
       Engineering-Mathematics       Graph-Theory
Question 42 Explanation: 
From the description, it is clear that vertices are connected as follows:
1 — 9 — 17 — ......... — 97
2 — 10 — 18 — ......... — 98
3 — 11 — 19 — ......... — 99
4 — 12 — 20 — ......... — 100
5 — 13 — 21 — ......... — 93
6 — 14 — 22 — ......... — 94
7 — 15 — 23 — ......... — 95
8 — 16 — 24 — ......... — 96
We have covered all vertices using 8 vertex sets considering only |i - j| = 8. Using |i - j| = 12 we can see the vertex 1 is connected to 13, 2 to 14, 3 to 15 and 4 to 16. So the top 4 vertex sets are infact connected to the bottom 4 sets, thus reducing the connected components to 4.
Question 43

The number of equivalence relations of the set {1,2,3,4} is

A
15
B
16
C
24
D
4
       Engineering-Mathematics       Sets-And-Relation
Question 43 Explanation: 
The no. of equivalence relation with 4 elements is 15.
Question 44

Which one of the following regular expressions over {0,1} denotes the set of all strings not containing 100 as a substring?

A
0*(1+0)*
B
0*1010*
C
0*1*01
D
0(10+1)*
       Theory-of-Computation       Regular-Expressions
Question 44 Explanation: 
(A) generates 100.
(B) generates 100 as substring.
(C) doesn't generate 1.
(D) answer.
Question 45

Which one of the following is not decidable?

A
Given a Turing machine M, a stings s and an integer k, M accepts s within k steps
B
Equivalence of two given Turing machines
C
Language accepted by a given finite state machine is not empty
D
Language generated by a context free grammar is non empty
       Theory-of-Computation       Decidability-and-Undecidability
Question 45 Explanation: 
(A) It is not halting problem. In halting problem number of steps can go upto infinity and that is the only reason why it becomes undecidable.
In (A) the number of steps is restricted to a finite number 'k' and simulating a TM for 'k' steps is trivially decidable because we just go to step k and output the answer.
(B) Equivalence of two TM's is undecidable.
For options (C) and (D) we do have well defined algorithms making them decidable.
Question 46

Which of the following languages over {a,b,c} is accepted by a deterministic pushdown automata?

 Note: wR  is the string obtained by reversing 'w'. 
A
{w⊂wR|w ∈ {a,b}*}
B
{wwR|w ∈ {a,b,c}*}
C
{anbncn|n ≥ 0}
D
{w|w is a palindrome over {a,b,c}}
       Theory-of-Computation       Push-Down-Automata
Question 46 Explanation: 
(A) w⊂wR, can be realized using DPDA because we know the center of the string that is c here.
(B) wwR, is realized by NPDA because we can't find deterministically the center of palindrome string.
(C) {anbncn | n ≥ 0} is CSL.
(D) {w | w is palindrome over {a,b,c}},
is realized by NPDA because we can't find deterministically the center of palindrome string.
Question 47

An operating system contains 3 user processes each requiring 2 units of resource R. The minimum number of units of r such that no deadlocks will ever arise is

A
3
B
5
C
4
D
6
       Operating-Systems       Deadlock
Question 47 Explanation: 
For the system to cause deadlock give each process 1 resource less than they require. Since in this case they require 2 resource each, so just give them 1 resource each. So if at max if 3 resource will be available then there can be deadlock. So by adding one more resource deadlock will never occur. So in total minimum 4 resources are required so that deadlock will never occur.
Question 48

Each Process Pi, i = 1.......9 is coded as follows

    repeat 
           P(mutex)
           {Critical section}
           V(mutex)
    forever   

The code for P10 is identical except it uses V(mutex) in place of P(mutex). What is the largest number of processes that can be inside the critical section at any moment?

A
1
B
2
C
3
D
None of the above
       Operating-Systems       Process-Synchronization
Question 48 Explanation: 
Since the both code (i.e., P1 to P9 and P10) can be executed any number of times and code for P10 is
repeat
{
V(mutex)
C.S.
V(mutex)
}
forever
Now, let me say P1 is in CS then P1 is in CS
then P10 comes and executes CS (upon mutex).
Now, P2 comes (down on mutex).
Now P10 moves out of CS (again binary semaphore will be 1).
Now P3 comes (down on mutex).
Now P10 comes (upon mutex).
Now P4 comes (down mutex).

So, if we take P10 'in' and 'out' of CS recursively, all 10 processes can be in CS at same time using binary semaphore only.
Question 49

For a database relation R(a,b,c,d), where the domains a, b, c, d include only atomic values, only the following functional dependencies and those that can be inferred from them hold:

   a → c 
   b → d  

This relation is

A
in first normal form but not in second normal form
B
in second normal form but not in third normal form
C
in third normal form
D
None of the above
       Database-Management-System       Normalization
Question 49 Explanation: 
Candidate key is ab.
Since all a, b, c, d are atomic. So the relation is in 1NF.
Checking the FD's
a → c
b → d
We can see that there is partial dependencies. So it is not 2NF.
So answer is option (A).
Question 50

Let R(a,b,c) and S(d,e,f) be two relations in which d is the foreign key of S that refers to the primary key of R. Consider the following four operations R and S

   (a) Insert into R            (b) Insert into S 
   (c) Delete from R            (d) Delete from S    

Which of the following can cause violation of the referential integrity constraint above?

A
None of (a), (b), (c) or (d) can cause its violation
B
All of (a), (b), (c) and (d) can cause its violation
C
Both (a) and (d) can cause its violation
D
Both (b) and (c) can cause its violation
       Database-Management-System       Referential-Integrity
Question 50 Explanation: 
Let take example:

Here 'd' is the foreign key of S and let 'a' is the primary key of R.
(A) Insertion into R: will cause no violation.
(B) Insertion into S: may cause violation because there may not be entry of the tuple in relation R. Example entry of 〈S4, __, __〉 is not allowed.
(C) Delete from R: may cause violation. For example, deletion of tuple 〈S2, __, __〉 will cause violation as there is entry of S2 in the foreign key table.
(D) Delete from S: will cause no violation as it does not result inconsistency.
Question 51

A D flip-flop is to be connected to an 8085 microprocessor chip as a 1-bit output port with a port address of FF hex. Data bit D3 should be involved in the data transfer from CPU to the flip-flop. The flip-flop should be cleared on power ON.
(a) Using only one NAND gate (fan in of 10), one NOT gate and one D flip-flop. Draw the required interface logic circuit (only the relevant signals should be shown).
(b) Write a program to generate a square wave on the output of the flip-flop. ON and OFF periods of the square wave should be 7 bus cycles each.

A
Theory Explanation.
Question 52

Let L = {a1, a2, ......, an} n ≥ 0 be a list whose Pascal representation is

                  type list = record
                     next: ↑ list; val: integer end  

The following function returns a list in which a2i and a2i-1, 1 ≤ i ≤ [n/2] are interchanged. Complete the function by filling the boxes. Write the line number and the content of the box in your answer sheet.

1. function change (p: ↑ list): ↑ list;
2. var q.t: ↑ list;
3. begin 
4. if p = nil then change := p
5. else if p ↑ next = nil then change : ▭
6. else begin
7. q : p ↑ next;
8. ▭ := q;
9. t : q ↑ next;
10. ▭ := p;
11. ▭ := change(t)
12. end
13. end 
A
Theory Explanation.
Question 53

Consider a graph whose vertices are points in the plane with integer co-ordinates (x,y) such that 1≤x≤n and 1≤y≤n, where n≥2 is an integer. Two vertices (x1,y1) and (x2,y2) are adjacent iff ∣x1−x2∣ ≤ 1 and ∣y1–y2∣ ≤1. The weight of an edge {(x1,y1),(x2,y2)} is √(x1–x2)2 + (y1–y2)2
(a) What is the weight of a minimum weight-spanning tree in this graph? Write only the answer without any explanations.
(b) What is the weight of a maximum weight-spanning tree in this graph? Write only the answer without any explanations.

A
Theory Explanation.
Question 54

Consider the following program in Pseudo-Pascal syntax.

program what:
      var z: integer
       procedure recur(x):
       begin if x <= 40 then
                  begin x:x+z
                     recur(x);
                     z:=x+10
                  end
       end(*recur*)
   begin(*what*)
       z=10;
       recur(z);
       writeln(z)
   end 

(a) Suppose the parameter to the procedure ‘recur’ is passed by value.
i. What value is printed by program?
ii. How many times is ‘recur’ called?
(b) What value is printed by the program if the parameter is passed by reference?

A
Theory Explanation.
Question 55

Consider the grammar

   S → bSe
   S → PQR
   P → bPc
   P → ε
   Q → cQd
   Q → ε
   R → dRe
   R → ε  

where S,P,Q,R are non-terminal symbols with S being the start symbol; b,c,d,e are terminal symbols and ‘ε’ is the empty string. This grammar generates strings of the form bi, cj, dk, em for some i,j,k,m ≥ 0.
(a) What is the condition on the values of i,j,k,m?
(b) Find the smallest string that has two parse trees.

A
Theory Explanation.
Question 56

Consider a hash table with n buckets, where external (overflow) chaining is used to resolve collisions. The hash function is such that the probability that a key value is hashed to a particular bucket is 1/n. The hash table is initially empty and K distinct values are inserted in the table.

(a) What is the probability that bucket number 1 is empty after the Kth insertion?
(b) What is the probability that no collision has occurred in any of the K insertions?
(c) What is the probability that the first collision occurs at the Kth insertions?

A
Theory Explanation.
Question 57

Let F be the set of one-to-one functions from the set {1,2,…,n} to the set {1,2,…,m}, where m≥n≥1.
(a) How many functions are members of F?
(b) How many functions f in F satisfy the property f(i) = 1 for some i, 1≤i≤n?
(c) How many functions f in F satisfy the property f(i) < f(j) for all 1≤i≤j≤n?

A
Theory Explanation.
Question 58

Let R be a reflexive and transitive relation on a set A. Define a new relation E on A as

 E = {(a,b) ∣ (a,b)∈R and (b,a)∈R} 

(a) Prove that E is an equivalence relation on A.
(b) Define a reason ≤ on the equivalence classes of E as E1 ≤ E2 if ∃a,b such that a∈E1, b∈E2 and (a,b)∈R. Prove that ≤ is a partial order.

A
Theory Explanation.
Question 59

Consider the following function.

Function F (n, m: integer): integer;
begin
       If (n <= 0) or (m <= 0) then F:=1
       else
            F:= F(n-1, m) + F(n, m-1);
       end;

Use the recurrence relation to answer the following question. Assume that n, m are positive integers. Write only the answers without any explanation.
(a) What is the value of F(n,2)?
(b) What is the value of (n,m)?
(c) How many recursive calls are made to the function F, including the original call, when evaluating F(n,m).

A
Theory Explanation.
Question 60

A size-balanced binary tree is a binary tree in which for every node, the difference between the number of nodes in the left and right subtree is at most 1. The distance of a node from the root is the length of the path from the root to the node. The height of a binary tree is the maximum distance of a leaf node from the root.
(a) Prove, by using induction on h, that a size-balance binary tree of height h contains at least 2h nodes.
(b) In a size-balanced binary tree of height h≤1, how many nodes are at distance h−1 from the root? Write only the answer without any explanations.

A
Theory Explanation.
Question 61

An array A contains n≥1 positive integers in the locations A[1], A[2],... A[n]. The following program fragment prints the length of a shortest sequence of consecutive elements of A, A[i], A[i+1],...A[j] such that the sum of their values is ≥M, a given positive number. It prints ‘n+1’ if no such sequence exists. Complete the program by filling in the boxes. In each case use the simplest possible expression. Write only the line number and the contents of the box.

1. begin
2. i: +1; j:=1;
3. Sum := ▭;
4. min: n; finish:=false;
5. While not finish do
6. If ▭ then
7. if j=n then finish:=true.
8.     else
9. begin
10.    j:=j+1;
11.    sum:=▭
12.        end
13. else
14. begin
15.        If(j-1) < min then min:=j-1;
16.        sum:=sum - A[i];
17.        i:=i+1;
18. end
19. writeln (min+1);
20. end.   
A
Theory Explanation.
Question 62

Consider the following piece of 'C' code fragment that removes duplicates from an ordered list of integers.

Node  *remove-duplicates(Node *head, int *j)
{
    Node *t1, *t2;
    *j=0;
    t1 = head;
    if (t1! = NULL) t2 = t1 →next;
    else return head;
    *j = 1;
    if(t2 == NULL) return head;
    while t2 != NULL)
    {
        if (t1.val != t2.val) --------------------------→ (S1)
        {
            (*j)++; t1 → next = t2; t1 = t2: ----------→ (S2)
        }
        t2 = t2 → next;
    }
    t1 → next = NULL;
    return head;
} 

Assume the list contains n elements (n≥2) in the following questions.
(a) How many times is the comparison in statement S1 made?
(b) What is the minimum and the maximum number of times statements marked S2 get executed?
(c) What is the significance of the value in the integer pointed to by j when the function completes?

A
Theory Explanation.
Question 63

A B+ - tree of order d is a tree in which each internal node has between d and 2d key values. An internal node with M key values has M+1 children. The root (if it is an internal node) has between 1 and 2d key values. The distance of a node from the root is the length of the path from the root to the node. All leaves are at the same distance from the root. The height of the tree is the distance of a leaf from the root.
(a) What is the total number of key values in the internal nodes of a B+ - tree with l leaves (l≥2)?
(b) What is the maximum number of internal nodes in a B+ - tree of order 4 with 52 leaves?
(c) What is the minimum number of leaves in a B+ - tree of order d and height h(h≥1)?

A
Theory Explanation.
Question 64

Construct a finite state machine with minimum number of states, accepting all strings over {a,b} such that the number of a's is divisible by two and the number of b's is divisible by three.

A
Theory Explanation.
Question 65

Given that L is a language accepted by a finite state machine, show that LP and LR are also accepted by some finite state machines, where
LP = {s|ss' ∈ L, for some string s'}
LR = {s|s obtainable by reversing some string in L}

A
Theory Explanation.
Question 66

A language L is a subset of Pascal with the following constructs:

    (a) Expressions involving the operators '+' and '<' only
    (b) Assignment statements
    (c) 'while' statements and
    (d) Compound statements with the syntax 'begin...end'
    Give an unambiguous grammar for L.
A
Theory Explanation.
Question 67

The language L, defined by the following grammar allows use of real or integer data in expressions and assignment statements.

    (assign-stmt):: = (LHS):= (E)
             (E) :: = (E) + (T)|(T)
             (T) :: = (T) * (V)|(V)
             (V) :: = id|((E))
           (LHS) :: = id 

It is required to convert expression and assignment strings of L into postfix strings that use the type-specific operators (+, i), (+, r), (*, i), (*, r), (:=, i) and (:=,r).
Write a syntax directed translation scheme to convert expression and assignment strings into the post-fix form. You may assume that the name and type of a variable can be obtained by making the function calls 'give-type (id)' and 'give-name (id)' respectively.

A
Theory Explanation.
Question 68

Consider the following program fragment in Pascal:

   Program Main;
      var X : integer;
      procedure A:
         var Y : integer;
         procedure B:
            var Z : integer;
            procedure C:
               var Z : integer;
               begin(* Procedure C *)
               :
               end(* Procedure C *)
 begin(*Procedure B*)
    :
  C; (* call to C *)
  A; (* call to A *)
    :
 end(*Procedure B*)
     begin(* Procedure A *)
        :
        B; (* call to B *)
        :
     end(* Procedure A *)
  begin (* Main *)
        :
        A; (* call to A *)
        :
  end(* Main *) 

Assume that there are no calls to any procedures other than the ones indicated above. It is known that at some point of time during the execution of this program five activation records exist on the run-time stack. Describe the run-time stack at this point of time by clearly indicating the following: the top of the stack, the contents of the static link and dynamic link, and allocation of the local variables in each record.

A
Theory Explanation.
Question 69

Following is a state table for some finite state machine.

(a) Find the equivalence partition on the states of the machine.
(b) Give the state table for the minimal machine. (Use appropriate names for the equivalent states. For example if states X and Y are equivalent then use XY as the name for the equivalent state in the minimal machine.)

A
Theory Explanation.
Question 70

Let f = (w'+y)(x'+y)(w+x'+z)(w'+z)(x'+z)
(a) Express f as the minimal sum of products. Write only the answer.
(b) If the output line is stuck at 0, for how many input combinations will the value of f be incorrect?

A
Theory Explanation.
Question 71

Following floating point number format is given
f is a fraction represented by a 6-bit mantissa (includes sign bit) in sign magnitude form e is a 4-bit exponent (includes sign hit) in sign magnitude form n = (f,e) = f, 2e is a floating point number.
Let A = 54.75 in decimal and
B = 9.75 in decimal.

(a) Represent A and B as floating point numbers in the above format.
(b) Show the steps involved in floating point addition of A and B.
(c) What is the percentage error (upto one position beyond decimal point) in the addition operation in (b)?

A
Theory Explanation.
Question 72

A concurrent system consists of 3 processes using a shared resource R in a non-preemptible and mutually exclusive manner. The processes have unique priorities in the range 1.....3, 3 being the highest priority. It is required to synchronize the processes such that the resource is always allocated to the highest priority requester. The pseudo code for the system is as follows.

Shared Data 
mutex:semaphore = 1:/* initialized to 1*/
process[3]:semaphore = 0; /*all initialized to 0 */
R_requested [3]:boolean = false; /*all initialized to false */
busy: boolean = false; /*initialized to false */
Code for processes
begin process
my-priority:integer;
my-priority:=____; /*in the range 1...3*/
repeat
    request_R(my-priority);
    P (proceed [my-priority]);
    {use shared resource R}
    release_R (my-priority);
forever
end process;
Procedures
procedure request_R(priority);
P(mutex);
if busy = true then
    R_requested [priority]:=true;
else
 begin
    V(proceed [priority]);
    busy:=true;
 end
V(mutex); 

Give the pseudo code for the procedure release_R.

A
Theory Explanation.
Question 73

A program P reads and processes 1000 consecutive records from a sequential file F stored on device D without using any file system facilities. Given the following

   Size of each record = 3200 bytes
   Access time of D = 10 msecs
   Data transfer rate of D = 800 × 103 bytes/second
   CPU time to process each record = 3 msecs 

What is the elapsed time of P if
(a) F contains unblocked records and P does not use buffering?
(b) F contains unblocked records and P uses one buffer (i.e., it always reads ahead into the buffer)?
(c) records of F are organized using a blocking factor of 2 (i.e., each block on D contains two records of F) and P uses one buffer?

You may assume that the CPU time needed to transfer a record from a buffer to a local variable of P is negligible.

A
Theory Explanation.
Question 74

An operating system handles requests to resources as follows.

A process (which asks for some resources, uses them for some time and then exits the system) is assigned a unique timestamp are when it starts. The timestamps are monotonically increasing with time. Let us denote the timestamp of a process P by TS(P).

When a process P requests for a resource the OS does the following:
(i) If no other process is currently holding the resource, the OS awards the resource to P.
(ii) If some process Q with TS(Q) < TS(P) is holding the resource, the OS makes P wait for the resources.
(iii) If some process Q with TS(Q) > TS(P) is holding the resource, the OS restarts Q and awards the resources to P.
(Restarting means taking back the resources held by a process, killing it and starting it again with the same timestamp)

When a process releases a resource, the process with the smallest timestamp (if any) amongst those waiting for the resource is awarded the resource.
(a) Can a deadlock ever arise? If yes, show how. If not, prove it.
(b) Can a process P ever starve? If yes, show how. If not, prove it.

A
Theory Explanation.
Question 75

Consider the following relational database schema:

     EMP (eno name, age)
     PROJ (pno name)
     INVOLVED (eno, pno) 

EMP contains information about employees. PROJ about projects and INVOLVED about which employees involved in which projects. The underlined attributes are the primary keys for the respective relations.

(a) What is the relational algebra expression containing one or more of {σ,π,x,u,−} which is equivalent to SQL query.

select eno
from EMP, INVOLVED 
where EMP.eno=INVOLVED.eno  
and INVOLVED.pno=3 

(b) State in English (in not more than 15 words).

What the following relational algebra expressions are designed to determine
(i) πeno(INVOLVED) − πeno((πeno(INVOLVED) X πpno(PROJ))−INVOLVED)
(ii) πage(EMP) − πEageE(EMP) x EMP))

(Note: ρE(EMP) conceptually makes a copy of EMP and names it K (ρ is called the rename operator))

A
Theory Explanation.
There are 75 questions to complete.