## GATE-CS-2001

Question 1 |

S1: The sum of two singular n × n matrices may be non-singular S2: The sum of two n × n non-singular matrices may be singular.Which of the following statements is correct?

S1 and S2 are both true | |

S1 is true, S2 is false | |

S1 is false, S2 is true | |

S1 and S2 are both false |

**Linear Algebra**

**GATE-CS-2001**

**Discuss it**

**S1 is True: The sum of two singular n × n matrices may be non-singular**It can be seen be taking following example. The following two matrices are singular, but their sum is non-singular.

M1 and M2 are singular M1 = 1 1 1 1 M2 = 1 -1 -1 1 But M1+M2 is non-singular M1+M2 = 2 0 0 2

**S2 is True: The sum of two n × n non-singular matrices may be singular**

M1 and M2 are non-singular M1 = 1 0 0 1 M2 = -1 0 0 -1 But M1+M2 is singular M1+M2 = 0 0 0 0

Question 2 |

R1(a,b) iff (a+b) is even over the set of integers R2(a,b) iff (a+b) is odd over the set of integers R3(a,b) iff a.b > 0 over the set of non-zero rational numbers R4(a,b) iff |a - b| <= 2 over the set of natural numbersWhich of the following statements is correct?

R1 and R2 are equivalence relations, R3 and R4 are not | |

R1 and R3 are equivalence relations, R2 and R4 are not | |

R1 and R4 are equivalence relations, R2 and R3 are not | |

R1, R2, R3 and R4 are all equivalence relations |

**Set Theory & Algebra**

**GATE-CS-2001**

**Discuss it**

- R1(a,b)
- Reflexive : Yes, because (a+a) is even.
- Symmetrix : Yes, (a+b) is even ⟹ (b+a) is even.
- Transitive : Yes, because (a+b) is even and (b+c) is even ⟹ (a+c) is even.

- R2(a,b)
- Reflexive : No, because (a+a) is even.

- R3(a,b)
- Reflexive : Yes, because a.a > 0.
- Symmetrix : Yes, a.b > 0 ⟹ b.a > 0.
- Transitive : Yes, because a.b > 0 and b.c > 0 ⟹ a.c > 0.

- R4(a,b)
- Reflexive : Yes, because |a-a| ≤ 2.
- Symmetrix : Yes, |a-b| ≤ 2 ⟹ |b-a| ≤ 2.
- Transitive : No, because |a-b| ≤ 2 and |b-c| ≤ 2 ⇏ (a-c) is even.

**(b)**is correct.. Source: http://www.cse.iitd.ac.in/~mittal/gate/gate_math_2001.html

Question 3 |

F1 is satisfiable, F2 is valid | |

F1 unsatisfiable, F2 is satisfiable | |

F1 is unsatisfiable, F2 is valid | |

F1 and F2 are both satisfiable |

**Propositional and First Order Logic.**

**GATE-CS-2001**

**Discuss it**

**Anil Saikrishna Devarasetty**.

Question 4 |

Only S1 is correct | |

Only S2 is correct | |

Both S1 and S2 are correct | |

None of S1 and S2 is correct |

**Regular languages and finite automata**

**GATE-CS-2001**

**Discuss it**

Question 5 |

If a language is context free it can always be accepted by a deterministic push-down automaton | |

The union of two context free languages is context free | |

The intersection of two context free languages is context free | |

The complement of a context free language is context free |

**Context free languages and Push-down automata**

**GATE-CS-2001**

**Discuss it**

Question 6 |

N ^{2} | |

2 ^{N} | |

2N | |

N! |

**Regular languages and finite automata**

**GATE-CS-2001**

**Discuss it**

Question 7 |

exploit the temporal locality of reference in a program | |

exploit the spatial locality of reference in a program | |

reduce the miss penalty | |

none of the above |

**Computer Organization and Architecture**

**GATE-CS-2001**

**Discuss it**

Question 8 |

Virtual memory implements the translation of a program‘s address space into physical memory address space | |

Virtual memory allows each program to exceed the size of the primary memory | |

Virtual memory increases the degree of multiprogramming | |

Virtual memory reduces the context switching overhead |

**Memory Management**

**GATE-CS-2001**

**Discuss it**

Question 9 |

INTER | |

RESET IN | |

HOLD | |

READY |

**Microprocessor**

**GATE-CS-2001**

**Discuss it**

Question 10 |

It cannot have subroutine call instruction | |

It can have subroutine call instruction, but no nested subroutine calls | |

Nested subroutine calls are possible, but interrupts are not | |

All sequences of subroutine calls and also interrupts are possible |

**Microprocessor**

**GATE-CS-2001**

**Discuss it**

Question 11 |

xy + y'z | |

wx'y' + xy + xz | |

w'x + y'z + xy | |

xz + y |

**Digital Logic & Number representation**

**GATE-CS-2001**

**Discuss it**

Question 12 |

test the interrupt system of the processor | |

implement co-routines | |

obtain system services which need execution of privileged instructions | |

return from subroutine |

**Microprocessor**

**GATE-CS-2001**

**Discuss it**

*interrupt handler*(or an interrupt service routine, ISR) to deal with the event. This interruption is temporary, and, after the interrupt handler finishes, the processor resumes normal activities. So (C) is correct option

Question 13 |

a hardware interrupt is needed | |

a software interrupt is needed | |

a privileged instruction (which does not generate an interrupt) is needed | |

a non-privileged instruction (which does not generate an interrupt is needed |

**Microprocessor**

**GATE-CS-2001**

**Discuss it**

Please comment below if you find anything wrong in the above post.

Question 14 |

O(n) | |

O(n Log n) | |

O(n ^{2}) | |

O(n!) |

**Analysis of Algorithms**

**Sorting**

**GATE-CS-2001**

**QuickSort**

**Discuss it**

Question 15 |

i - 1 | |

floor(i/2) | |

ceiling(i/2) | |

(i+1)/2 |

**Heap**

**GATE-CS-2001**

**Discuss it**

**Saksham Seth.**

Question 16 |

^{2}Logn and g(n) = n (logn)

^{10}be two positive functions of n. Which of the following statements is correct?

f(n) = O(g(n)) and g(n) != O(f(n)) | |

f(n) != O(g(n)) and g(n) = O(f(n)) | |

f(n) = O(g(n)) but g(n) = O(f(n)) | |

f(n) != O(g(n)) but g(n) != O(f(n)) |

**GATE-CS-2001**

**Discuss it**

**Proof:**Given f(n) =n

^{2}Logn and g(n) = n (logn)

^{10}In these type of questions, we suggest you to first cancel out the common factor in both the function. After removing these, we are left with f(n) = n and g(n) = (logn)

^{9}. Removing a factor of nlogn from both functions. Now n is very very large asymptotically as compared to any constant integral power of (logn) which we can verify by substituting very large value say 2100. f(2100) = 2

^{100}= 1030 and g(2100) = 100

^{9}= 1018. Always remember to substitute very large values of n in order to compare both these functions. Otherwise you will arrive at wrong conclusions because if f(n) is asymptotically larger than g(n) that means after a particular value of n, f(n) will always be greater that g(n). This solution is contributed by

**Pranjul Ahuja**.

Question 17 |

Assembly | |

Parsing | |

Relocation | |

Symbol resolution |

**Memory Management**

**GATE-CS-2001**

**Discuss it**

Relocation of code is the process done by the linker-loader when a program is copied from external storage into main memory.

A linker relocates the code by searching files and libraries to replace symbolic references of libraries with actual usable addresses in memory before running a program.

Thus, option (C) is the answer.

Please comment below if you find anything wrong in the above post.

Question 18 |

An unambiguous grammar has same leftmost and rightmost derivation | |

An LL(1) parser is a top-down parser | |

LALR is more powerful than SLR | |

An ambiguous grammar can never be LR(k) for any k |

**Parsing and Syntax directed translation**

**GATE-CS-2001**

**Discuss it**

**1.**A grammar is ambiguous if there exists a string s such that the grammar has more than one leftmost derivations for s. We could also come up with more than one rightmost derivations for a string to prove the above proposition, but not both of right and leftmost. An unambiguous grammar can have different rightmost and leftmost derivations.

**2.**LL parser is top-down by nature. Leftmost derivation is, intuitively, expanding or top-down in fashion, hence such convention. Rightmost derivation, on the other hand, seems like a compressing or bottom-up thing.

**3.**LALR is more powerful than SLR, even when both have the same LR(0) states, due to the fact that SLR checks for lookaheads by looking at FIRST and FOLLOW from the grammar after constructing its parse table and on the other hand, LALR computes lookaheads from the LR(0) states while constructing the parse table, which is a better method.

**4.**An ambiguous grammar can never be LR(k) for any k, because LR(k) algorithm aren’t designed to handle ambiguous grammars. It would get stuck into undecidability problem, if employed upon an ambiguous grammar, no matter how large the constant k is. Reference: http://stackoverflow.com/questions/2676144/what-is-the-difference-between-lr-slr-and-lalr-parsers/16575211#16575211 See question 3 of http://www.geeksforgeeks.org/compilers-set-1/ This solution is contributed by

**Vineet Purswani.**

Question 19 |

Round-Robin | |

Shortest-Job-First | |

Highest-Response-Ratio-Next | |

First-Come-First-Served |

**GATE-CS-2001**

**CPU Scheduling**

**Discuss it**

Throughput means total number of tasks executed per unit time i.e. sum of waiting time and burst time.

Shortest job first scheduling is a scheduling policy that selects the waiting process with the smallest execution time to execute next.

Thus, in shortest job first scheduling, shortest jobs are executed first. This means CPU utilization is maximum. So, maximum number of tasks are completed.

Thus, option (B) is correct.

Please comment below if you find anything wrong in the above post.

Question 20 |

RAM | |

Disk | |

ROM | |

On-chip cache |

**Memory Management**

**GATE-CS-2001**

**Discuss it**

Question 21 |

always decrease the number of page faults | |

always increase the number of page faults | |

sometimes increase the number of page faults | |

never affect the number of page faults |

**Memory Management**

**GATE-CS-2001**

**Discuss it**

Question 22 |

Register | |

Cache | |

Main memory | |

Disk |

**Input Output Systems**

**GATE-CS-2001**

**Discuss it**

A disk driver is software which enables communication between internal hard disk (or drive) and computer.

It allows a specific disk drive to interact with the remainder of the computer.

Thus, option (D) is the answer.

Please comment below if you find anything wrong in the above post.

Question 23 |

dependency preserving and lossless join | |

lossless join but not dependency preserving | |

dependency preserving but not lossless join | |

not dependency preserving and not lossless join |

**Database Design(Normal Forms)**

**GATE-CS-2001**

**Discuss it**

**Dependency Preserving Decomposition:**

Decomposition of R into R1 and R2 is a dependency preserving decomposition if closure of functional dependencies after decomposition is same as closure of of FDs before decomposition.

A simple way is to just check whether we can derive all the original FDs from the FDs present after decomposition.

In the above question R(A, B, C, D) is decomposed into R1 (A, B) and R2(C, D) and there are only two FDs A -> B and C -> D. So, the decomposition is dependency preserving

**Lossless-Join Decomposition:**

Decomposition of R into R1 and R2 is a lossless-join decomposition if at least one of the following functional dependencies are in F+ (Closure of functional dependencies)

R1 ∩ R2 → R1 OR R1 ∩ R2 → R2

In the above question R(A, B, C, D) is decomposed into R1 (A, B) and R2(C, D), and R1 ∩ R2 is empty. So, the decomposition is not lossless.

Question 24 |

List of all vertices adjacent to a given vertex | |

List all vertices which have self loops | |

List all vertices which belong to cycles of less than three vertices | |

List all vertices reachable from a given vertex |

**Database Design(Normal Forms)**

**GATE-CS-2001**

**Discuss it**

Question 25 |

A | |

B | |

C | |

D |

**Database Design(Normal Forms)**

**GATE-CS-2001**

**Discuss it**

**Option A :**is only displaying attributes of table r on the select condition

**Option B :**is only displaying attributes of table r

**Option C:**evaluates A = a by joining tables r and s efficiently , thus correct Therefore,

**Answer C**

Question 26 |

2240 | |

2296 | |

2620 | |

4536 |

**Combinatorics**

**GATE-CS-2001**

**Discuss it**

**vineet purswani**

Question 27 |

S1: There exists infinite sets A, B, C such that A ∩ (B ∪ C) is finite. S2: There exists two irrational numbers x and y such that (x+y) is rational.Which of the following is true about S1 and S2?

Only S1 is correct | |

Only S2 is correct | |

Both S1 and S2 are correct | |

None of S1 and S2 is correct |

**Set Theory & Algebra**

**GATE-CS-2001**

**Discuss it**

**Anil Saikrishna Devarasetty**.

Question 28 |

S1: f (E ∪ F) = f (E) ∪ f (F) S1: f (E ∩ F) = f (E) ∩ f (F)Which of the following is true about S1 and S2?

Only S1 is correct | |

Only S1 is correct | |

Both S1 and S2 are correct | |

None of S1 and S2 is correct |

**GATE-CS-2001**

**Discuss it**

Question 29 |

1/7 ^{7} | |

1/7 ^{6} | |

1/2 ^{7} | |

7/2 ^{7} |

**Probability**

**GATE-CS-2001**

**Discuss it**

^{7}. Similarly for other 6 days. So total probability = 7 * 1/7

^{7}= 1/7

^{6}. So option (B) is correct. Source: http://www.cse.iitd.ac.in/~mittal/gate/gate_math_2001.html

Question 30 |

8 | |

14 | |

15 | |

48 |

**Regular languages and finite automata**

**GATE-CS-2001**

**Discuss it**

We construct a DFA for strings divisible by 6. It requires minimum 6 states as length of string mod 6 = 0, 1, 2, 3, 4, 5

We construct a DFA for strings divisible by 8. It requires minimum 8 states as length of string mod 8 = 0, 1, 2, 3, 4, 5, 6, 7

If first DFA is minimum and second DFA is also minimum then after merging both DFAs resultant DFA will also be minimum. Such DFA is called as compound automata.

So, minimum states in the resultant DFA = 6 * 8 = 48

Thus, option (D) is the answer.

Please comment below if you find anything wrong in the above post.

Question 31 |

Only L1 and L2 | |

Only L2, L3 and L4 | |

Only L3 and L4 | |

Only L3 |

**Regular languages and finite automata**

**GATE-CS-2001**

**Discuss it**

**According to pumping lemma,**“Suppose L is a regular language, then there exists a l ≥ 1 such that for all string s ∈ L, where |s| ≥ l, we can always split s (there exists at least one such splitting) in such a way that s can be written as xyz with |xy| ≤ l and y ≠ ε and for all i ≥ 0 , xy

^{i}z ∈ L”. l is known as pumping length. Let’s rephrase the given Lemma for non regular languages. Suppose L is a language, if for all l ≥ 1 there exist a string s ∈ L with |s| ≥ l such that for all splitting (there doesn’t exists a single splitting which doesn’t follow this rule) of s in form of xyz such that |xy| ≥ l and y ≠ ε , there exists an i≥ 0 such that xy

^{i}z ∉ L, then L is not regular. Notice that here we stress on finding such s if we want to prove that a language is not regular.

**Choice of the Questions:**(a)

**In choice 1**, Lets first consider w being of length n and containing only a. In this case the language represents a

^{n}a

^{n}. The length of the string represented by language should be Even. Consider l = n, then xyz = a

^{n}a

^{n}with xy = a

^{n}. lets assume y = a, then consider the membership of xy

^{i}z with i = 0. This will simply be of odd length which doesn’t belongs to L. So L is not regular. To discuss it in more detail, let’s consider another example. Suppose w = a

^{p}b, then string formed by L will be a

^{p}ba

^{p}b which is of length 2p + 2. Assume l = p, then xy = a

^{p}. suppose y = a, then consider the membership of xy

^{i}z with i = 0. This certainly doesn’t belongs to L. So L is not regular. (b)

**In choice 2**, The first example will work as above. In the second example, the string will be a

^{p}bba

^{p}, and there will be no changes in process for proving it to be non regular. (c)

**In choice 3**, Assuming that we are considering integer from 0 and 0

^{2∗n}results in empty string, Which is also accepted, We can simply construct a DFA as given below. It simply accepts a string if it is either empty or contain even number of zeros. So the language is regular. (d)

**In choice 4**, We can simply assume that the pumping length l =i

^{2}/2. Now consider the xy = 0

^{l}with y = 0, Now if we check the membership of xy

^{2}z, we can find that this will represent 0

^{i^2}+1, and corresponding to which there exists no j such that j

^{2}= i

^{2}+ 1 where i and j are integer except j = 1 and i = 0. But since i can’t be zero. In Short, using pumping lemma, we can generate 0

^{i^2}+1 as well as 0

^{i^2}-1, which won’t be available in L. So L is not regular. This explanation has been contributed by

**Durgesh Pandey.**

Question 32 |

Given a Turing machine M over the input alphabet Σ, any state q of M And a word w∈Σ*, does the computation of M on w visit the state q?Which of the following statements about X is correct?

X is decidable | |

X is undecidable but partially decidable | |

X is undecidable and not even partially decidable | |

X is not a decision problem |

**Undecidability**

**GATE-CS-2001**

**Discuss it**

This problem is a State Entry Problem. State entry problem can be reduced to halting problem.

We construct a turing machine M with final state ‘q’. We run a turing machine R (for state entry problem) with inputs : M, q, w .

We give ‘w’ as input to M.

If M halts in the final state ‘q’ then R accepts the input. So, the given problem is partially decidable. If M goes in an infinite loop then M can not output anything. So, R rejects the input. So, the given problem becomes undecidable.

Thus, option (B) is the answer.

Please comment below if you find anything wrong in the above post.

Question 33 |

a | |

b | |

c | |

d |

**Digital Logic & Number representation**

**GATE-CS-2001**

**Discuss it**

Q

_{0}= 0 (given) Therefore, Q

_{0}' = 1

During the first clock cycle nothing will change since input doesn't come before rising edge of the clock cycle Q

_{0}' becomes ’0’ on rising edge of next clock cycle. Therefore, for only one clock cycle D1 will be ‘1’.

Thus, option (C) is the answer.

Please comment below if you find anything wrong in the above post.

Question 34 |

X. Indirect Addressing I. Array implementation Y. Indexed Addressing II. Writing re-locatable code Z. Base Register Addressing III. Passing array as parameter

(X, III) (Y, I) (Z, II) | |

(X, II) (Y, III) (Z, I) | |

(X, III) (Y, II) (Z, I) | |

(X, I) (Y, III) (Z, II) |

**Microprocessor**

**GATE-CS-2001**

**Discuss it**

Question 35 |

_{10}in hexadecimal is

ABE | |

DBC | |

DE5 | |

9E7 |

**Number Representation**

**GATE-CS-2001**

**Discuss it**

_{10}= 1 010 0001 1011

_{2 }( Leftmost 1 denotes negative ) One's complement = 1 101 1110 0100 Two's complement = 1 101 1110 0101 Converting this two's complement to hexadecimal form, we get DE5. Thus, C is the correct choice. Please comment below if you find anything wrong in the above post.

Question 36 |

Which of the following is true?

f = x1'+ x1x | |

f = x1'x2 + x1x2' | |

f = x1x2 + x1'x2' | |

f = x1 + x2' |

**GATE-CS-2001**

**Discuss it**

g = (a and x1') or (b and x1) g = (1 and x1’) or (0 and x1) g = x1’

f = ac’ + bc f = (a and x2') or (b and x2) f = (g and x2') or (x1 and x2) f = x1’x2’ + x1x2

Thus, option (C) is the answer.

Please comment below if you find anything wrong in the above post.

Question 37 |

_{2}+ 2Q

_{1}+ Q

_{0}

Which one of the following is the correct state sequence of the circuit?

1,3,4,6,7,5,2 | |

1,2,5,3,7,6,4 | |

1,2,7,3,5,6,4 | |

1,6,5,7,2,3,4 |

**Digital Logic & Number representation**

**GATE-CS-2001**

**Discuss it**

Initial value | Q0 | Q1 | Q2 | 2Q1+4Q2+Q0 |

clk | 1 | 0 | 0 | 1 |

1 | 0 | 1 | 0 | 2 |

2 | 1 | 0 | 1 | 5 |

3 | 1 | 1 | 0 | 3 |

4 | 1 | 1 | 1 | 7 |

5 | 0 | 1 | 1 | 6 |

6 | 0 | 0 | 1 | 4 |

Question 38 |

The CPU instruction “push r”, where = A or B, has the specification

M [SP]How many CPU clock cycles are needed to execute the “push r” instruction?

1 | |

3 | |

4 | |

5 |

**Computer Organization and Architecture**

**GATE-CS-2001**

**Discuss it**

**So total cycles=3**

**So (B) is correct option**

Question 39 |

d(r, u) < d(r, v) | |

d(r,u) > d(r,v) | |

d(r,u) <= (r,v) | |

None of the above |

**Graph Minimum Spanning Tree**

**GATE-CS-2001**

**Discuss it**

Question 40 |

n(n-1)/2 | |

2 ^{n} | |

n! | |

2 ^{n(n-1)/2} |

**Graph**

**GATE-CS-2001**

**Discuss it**

^{n(n-1)/2}.

Question 41 |

One | |

Two | |

Three | |

Four |

**GATE-CS-2001**

**Discuss it**

**Method 1 (By making enQueue operation costly)**

This method makes sure that newly entered element is always at the top of stack 1, so that deQueue operation just pops from stack1. To put the element at top of stack1, stack2 is used.

enQueue(q, x) 1) While stack1 is not empty, push everything from satck1 to stack2. 2) Push x to stack1 (assuming size of stacks is unlimited). 3) Push everything back to stack1. dnQueue(q) 1) If stack1 is empty then error 2) Pop an item from stack1 and return it

**Method 2 (By making deQueue operation costly)**

In this method, in en-queue operation, the new element is entered at the top of stack1. In de-queue operation, if stack2 is empty then all the elements are moved to stack2 and finally top of stack2 is returned.

enQueue(q, x) 1) Push x to stack1 (assuming size of stacks is unlimited). deQueue(q) 1) If both stacks are empty then error. 2) If stack2 is empty While stack1 is not empty, push everything from satck1 to stack2. 3) Pop the element from stack2 and return it.Source: http://www.geeksforgeeks.org/queue-using-stacks/

Question 42 |

Program P1() { x = 10; y = 3; func1(y,x,x); print x; print y; } func1(x,y,z) { y = y+4; z = x+y+z; }

10, 3 | |

31, 3 | |

27, 7 | |

None of the above |

**Principles of Programming Languages**

**GATE-CS-2001**

**Discuss it**

Question 43 |

[PI] int * g (void) { int x= 10; return (&x); } [P2] int * g (void) { int * px; *px= 10; return px; } [P3] int *g (void) { int *px; px = (int *) malloc (sizeof(int)); *px= 10; return px; }Which of the above three functions are likely to cause problems with pointers? (GATE 2001) (A) (B) (C) (D)

Only P3 | |

Only P1 and P3 | |

Only P1 and P2
| |

P1, P2 and P3 |

**GATE-CS-2001**

**Discuss it**

Question 44 |

Program P2 var n: int: procedure W(var x: int) begin x=x+1; print x; end procedure D begin var n: int; n=3; W(n); end begin //beginP2 n=10; D; endIf the language has dynamic scoping and parameters are passed by reference, what will be printed by the program?

10 | |

11 | |

3 | |

None of the above |

**Principles of Programming Languages**

**GATE-CS-2001**

**Discuss it**

**Parul Sharma.**

Question 45 |

A device | |

Timer | |

Scheduler process | |

Power failure |

**Process Management**

**GATE-CS-2001**

**Discuss it**

*Long-term scheduler*(or job scheduler) –selects which processes should be brought into the ready queue

*Short-term scheduler*(or CPU scheduler) –selects which process should be executed next and allocates CPU.

*Mid-term Scheduler*(Swapper)- present in all systems with virtual memory, temporarily removes processes from main memory and places them on secondary memory (such as a disk drive) or vice versa. The mid-term scheduler may decide to swap out a process which has not been active for some time, or a process which has a low priority, or a process which is page faulting frequently, or a process which is taking up a large amount of memory in order to free up main memory for other processes, swapping the process back in later when more memory is available, or when the process has been unblocked and is no longer waiting for a resource. Source: http://www.geeksforgeeks.org/operating-systems-set-3/

Question 46 |

16 MB | |

8 MB | |

2 MB | |

24 MB |

**Memory Management**

**GATE-CS-2001**

**Discuss it**

Question 47 |

repeat flag [i] = true; turn = j; while ( P ) do no-op; Enter critical section, perform actions, then exit critical section flag [ i ] = false; Perform other non-critical section actions. until false;For the program to guarantee mutual exclusion, the predicate P in the while loop should be.

flag[j] = true and turn = i | |

flag[j] = true and turn = j | |

flag[i] = true and turn = j | |

flag[i] = true and turn = i |

**GATE-CS-2001**

**Discuss it**

Question 48 |

A->B, B->CD | |

A->B, B->C, C->D | |

AB->C, C->AD | |

A ->BCD |

**Database Design(Normal Forms)**

**GATE-CS-2001**

**Discuss it**

**Background :**

**Lossless-Join Decomposition:**

Decomposition of R into R1 and R2 is a lossless-join decomposition if at least one of the following functional dependencies are in F+ (Closure of functional dependencies)R1 ∩ R2 → R1 OR R1 ∩ R2 → R2

**dependency preserving**:

Decomposition of R into R1 and R2 is a dependency preserving decomposition if closure of functional dependencies after decomposition is same as closure of of FDs before decomposition.

A simple way is to just check whether we can derive all the original FDs from the FDs present after decomposition.

**Question :**We know that for lossless decomposition common attribute should be candidate key in one of the relation.

**A) A->B, B->CD**R1(AB) and R2(BCD) B is the key of second and hence

**decomposition is lossless.**

**B) A->B, B->C, C->D**R1(AB) , R2(BC), R3(CD) B is the key of second and C is the key of third,

**hence lossless.**

**C) AB->C, C->AD**R1(ABC), R2(CD) C is key of second, but C->A violates BCNF condition in ABC as C is not a key. We cannot decompose ABC further as AB->C

**dependency would be lost.**

**D) A ->BCD**Already in BCNF.

**Therefore, Option C AB->C, C->AD is the answer.**

Question 49 |

A | |

B | |

C | |

D |

**Database Design(Normal Forms)**

**GATE-CS-2001**

**Discuss it**

**generate an infinite relation**. It may also contain values that do not even appear in the database. Such expressions are said to be

**unsafe.**A

**safe**tuple relational calculus expression is the one which surely generates

**finite results**. To pose a restriction over the unsafety of expressions in tuple relational calculus there is a concept of

**domain**of a tuple relational formula denoted by dom (P) is the set of values referenced by P i.e. values there in P or values in tuple of a relation mentioned in P. Eg: The expression {t | ¬ (t € R)} is not safe because there are infinitely many tuples that do not occur in R relation . In the above question Options (A), (B) and option (D) produce finite set of tuples as each gives out tuples restricted from a particular relation and hence are safe. Option (C) produces infinite number of tuples as it generates all the tuples not in R1 i.e. it can have tuples from any other relation other than R1.Hence it is not safe. codex.cs.yale.edu/avi/db-book/db6/slide-dir/PPT-dir/ch6.ppt This solution is contributed by

**Yashika Arora**.

Question 50 |

create table geq ( ib integer not null ub integer not null primary key 1b foreign key (ub) references geq on delete cascade )Which of the following is possible if a tuple (x,y) is deleted?

A tuple (z,w) with z > y is deleted | |

A tuple (z,w) with z > x is deleted | |

A tuple (z,w) with w < x is deleted | |

The deletion of (x,y) is prohibited |

**Database Design(Normal Forms)**

**GATE-CS-2001**

**Discuss it**

Suppose the instance in the given relation is the following: x y ----- 5 6 4 5 3 4 6 6Now if we delete tuple (5,6) then tuple ( 4,5 ) should also be deleted ( as 5 in the tuple (4, 5) was referencing to 5 in the tuple(5,6) which no longer exist, hence the referencing tuple should also be deleted), and as (4,5) got deleted hence tuple (3,4) should also be deleted for the same reason. Therefore in total 3 rows have to be deleted if tuple ( 5,6 ) is deleted. Now from the above instance we can say that if (x,y), i.e. ( 5,6 ) gets deleted then a tuple ( z, w) i.e, ( 3, 4) is also deleted. And we can see here that w < x. Hence option C.