Monday, 10 November 2014

Dependency Preservation Decomposition

December 2010 - Question No 17

The dependency preservation decomposition is a property to decompose database schema D, in which each functional dependency X → Y specified in F,

(A) appeared directly in one of the relation schemas Ri in the decomposed D.
(B) could be inferred from dependencies that appear in some Ri.
(C) both (A) and (B)
(D) None of these

Explanation:- The question itself requires a bit of explanation. It is not enough if you just know what is the right answer but you must also know why it is the right answer. The explanation would be a bit lengthy. Let us first dissect the question and explain some terms in terms of DBMS.

Decomposition - This means replacing a relation with a collection of smaller relations.

Relation - Relation is known as Table.

Relation Schema - This is known as Table definition. Relation Schema for a "student" relation can be shown in the following way:
Student(FirstName,LastName,DOB,Gender,Course,Regno,Address)

Definition of Dependency preservation decomposition:-
Each FD specified in F either appears directly in one of the relations in the decomposition, or be inferred from FDs that appear in some relation.

Let us consider an example for Dependency preservation

Let R be a relation R(A B C D)
Let there be 3 functional dependencies.
FD1: A->B
FD2: B->C
FD3: C->D
Let the relation R be decomposed into two more relations.
R1(A B C)  :  R2(C D)
Let us first consider the relation R1(A B C). Here between A and B the functional dependency FD1 is preserved. Between B and C, FD2 is preserved.
Let us now consider the second relation R2(C D). Between C and D the FD, FD3 is preserved. So in the two relations R1 and R2, all the 3 functional dependencies are preserved.

Let us consider an example for Non-dependency preservation

Let R be a relation R(A B C D) Let there be again 3 functional dependencies.
FD1:A->B
FD2:B->C
FD3:C->D
Let the relation be decomposed into two more relations>
R1(A C D) R2(B C)
Let us first consider the relation R1(A C D). There is no FD between A and C. There is a FD3 between C and D.
Now let us consider the second relation R2(B C). There is FD2 between B and C.
So, the two relations only support only FD's FD2 and FD3. FD1 is not supported. So these relations does not preserve dependency.
Generally there are three desirable properties of a decomposition.

  1. Lossless
  2. Dependency preservation
  3. Minimal redundancy
The above question was based on dependency preservation decomposition. This example has been taken from the dependency preservation presentation by Jason Allen. The explanation is quite good there.

SUMMARY:-

The dependency preservation decomposition is a property to be considered for decomposing a relation into two or more smaller relations. The functional dependency X->Y specified in F can appear directly in one of the relation schemas Ri in the decomposed D or it could be inferred from dependencies that appear in some Ri. So the answer for this question is C.

Ans:-C

Thursday, 6 November 2014

TOP PAID IPHONE APPS

As of 30th october 2014, the following are the top paid and free iphone apps. I have always been interested in what kind of apps are generously downloaded by users. Given below is a overview of the top apps along with what the app does.

1. Five night at Freddy's

This is a game developed by Scott Cawthon. It is a point-and-click horror game. The goal is for a player to survive the night at Freddy Faber's pizza where you are appointed as a night guard. The main attraction of the shop is Freddy Faber and two of his friends who are animatronic robots. They are programmed to please the crowds but in the night their behaviour becomes somewhat unpredictable. Seated in a room with a security camera, you are supposed to safeguard yourself from the robots.

2. Minecraft

It is a video game originally developed by Swedish programmer Markus "Notch" Persson and later developed and published by the Swedish company Mojang. You can use blocks to build something very imaginative in this game.

3. Heads Up!

It is the game that Ellen DeGeneres plays on her show. You have to guess the word on the card that is on your head from your friend's clues before the timer runs out. You hold the phone in such a way that your friends are able to see the word but you are not able to. You will have to guess the word based on your friends clues. There are different decks of cards including celebrities, movies, animals, characters etc.

4. Plague Inc

This is an iOS and Android strategy video game, developed by one-man developer Ndemic Creations. The players has to create and evolve a pathogen in an effort to destroy the world with a deadly plague. The game uses a model to simulate and spread the severity of the plague.

Afterlight

It is called UFO:Afterlight. This is a strategy computer game. It is the third in altar's UFO series. It is played in two parts. The first part is to claim territory,build structures, etc. The second part is , up to seven soldiers may be equipped and deployed to accomplish a goal in mission.

6. Swype-Keyboard

This is the first non-game app in the list. It is virtual keyboard for touch screen smartphones and tablets originally developed by Swype Inc. It is claimed to be the fastest and most intuitive keyboard on the planet. It offers predictive text keyboard with continuous gesture typing, personal dictionary, backup and sync.

7. SB for Vine

It is a app which is the first soundboard made of famous vine quotes. vine quotes are quotes made by famous personalities. Soundboard would actually play the quote. You can add your own quotes also there.

8. Geometry Dash

It is a fast-paced game full of fun and unpredictability.

9. Sleep cycle alarm clock

It is an intelligent alarm clock(unlike the usual ones), and wakes you in the lightest sleep phase, the natural way to wake up feeling rested and relaxed. It helps millions of people to wake up rested.

10. Buddyman

It is a game and can be a best stress reliever too. You can hit buddy man with bats and axes, shoot him with pistols and rifles, explode grenades and even drop a nuclear bomb.

Of all the top 10 paid apps, 8 are games. The only two non-game apps are the Swype and Sleep cycle alarm clock. For all budding app developers out there, take a cue from the top app performers. Later on the top free iphone apps.

Friday, 30 May 2014

JUNE 2009 - PAPER II



2. In order that a code is  error correcting, the minimum Hamming distance should be :
(A) t
(B) 2t - 1
(C) 2t
(D) 2t + 1
Ans:-D
Explanation:- The error-detecting and error-correcting properties of a block ode depend on its hamming distance. 
To reliably DETECT ’t’ errors, you need a distance t+1 code.

To CORRECT t errors, you need a distance 2t+1 code.

9. With four programs in memory and with 80% average I/O wait, the CPU utilisation is?
(A) 60%
(B) 70%
(C) 90%
(D) 100%
Ans:-A
Explanation:-CPU utilisation is given by the formula
= 1 - P pow n
CPU utilisation is calculated from a probabilistic viewpoint. P stands for the fraction of time waiting for I/O to complete. 
Number of processes in memory = n
The probability that all n processes are waiting for I/O is p pow n.
P=80%=80/100=0.8
n=4
CPU Utilization = 1 - p pow n
= 1 - (0.8) pow 4
= 1 - 0.4096
= 60%

28.A binary tree is said to have heap property if the elements along any path:
(A) from leaf to root are non-increasing
(B) from leaf to root are non-decreasing
(C) from root to leaf are non-decreasing
(D) from root to leaf are non-increasing
Ans:- D
Explanation:-Answer is in Schaum’s series book on Data structures with C++.
A binary tree is said to have the heap property if the elements along any path from root to leaf are non increasing. A heap is a complete binary tree that has the heap property. So the correct option is D.

33.  In which addressing mode the operand is given explicitly in the instruction itself?
(A) Absolute mode
(B) Immediate mode
(C) Indirect mode
(D) Index mode
Ans:- B
Explanation:- In immediate addressing mode, the operand is given in the instruction itself. 
Eg:- MOV AL,64H Move 64H to Al register
     MOV Bx,0493H Move 0493H to Bx register.

42. Which of the following is used for test data generation?
(A) White box
(B) Black box
(C) Boundary-value analysis
(D) All of the above
Ans:-C
Explanation:- Boundary value analysis is a technique for test data selection.A test engineer chooses values that lie along data extremes.


For downloading the complete solution click on the following link



Tuesday, 27 May 2014

JUNE 2012 - PAPER III SOLVED


Hi readers,

I have uploaded the solutions for June 2012 - Paper III. This was particularly difficult because the questions were a bit vague and it was a challenge to solve it. I have solved upto 30 questions in this file. I will be follow it up with the rest of the questions soon . I have tried explaining the solution to each and every question as much as I can. Since the explanations are quite lengthy for most of the questions, reading through this itself will be too exhaustive and time consuming. I suggest you go through the explanation multiple times so that they can be applied in some other situation as well. Once again happy learning....

Download June 2012 - Paper III solved....

Sunday, 25 May 2014

WORKED OUT QP....


Hi friends,

Instead of going through each and every post of mine for getting the solutions for all the questions in a particular paper, I have created the following link for downloading the solution file straightaway. I will keep updating you with more solution files in the coming days. Till then, happy downloading and happy learning.

Please find the downloadable files for the solution of previous year UGC Net papers along with elaborate  explanation wherever required.

I will be adding new files for download often. So please keep checking this page....


1.  June 2012 - Paper II solved

2.  December 2010-Paper II solved

3.  December 2011-Paper II solved

4. December 2009 - Paper II solved

5. December 2008 - Paper II solved

6. June 2012 - Paper III solved (partially)

7. June 2009 - PAPER II solved

Look forward to more download links....



Thursday, 13 June 2013

FINITE AUTOTMATA QUESTIONS

This post gives the question and answer for the subject FINITE AUTOMATA from all the previous year question papers of UGC NET.
First the year in which the question appears would be mentioned followed by the question and its answer.

DECEMBER 2004

1. The context-free languages are closed for :
(i) Intersection    (ii) Union
(iii) Complementation   (iv) Kleene Star
then
(A) (i) and (iv)    (B) (i) and (iii)
(C ) (ii) and (iv)    (D) (ii) and (iii)

Ans:-C

Explanation:- Context-free languages are closed under union,intersection and star-closure. Context-free languages are not closed under intersection and complementation.


June - 2005

2. Which of the following is not true ?
(A) Power of deterministic automata is equivalent to power of non-deterministic automata.
(B) Power of deterministic pushdown automata is equivalent to power of non-deterministic pushdown automata.
(C) Power of deterministic turing machine is equivalent to power of non-deterministic
turing machine. (D) All the above

Ans:-B

Explanation:- Deterministic and nondeterministic finite automata have equivalent computational capabilities.
Deterministic and nondeterministic Turing machines have the same computational capabilities.
However, the computational capabilities of deterministic push-down automata are less than those of nondeterministic push-down automata. So, the answer is B.


3. Identify the language which is not context - free.
(A) L={wwR|w is a member of {0,1}*}
(B) L={anbn|n>=0}
(C )L={ww|w is a member of {0,1}*}
(D) L={anbmcmdn|n,m>=0}

Ans:-B


December 2005

4. Which sentence can be generated by S → d/bA, A → d/ccA :
(A) bccddd
(B) aabccd
(C) ababccd
(D) abbbd

Ans:-A

Explanation:- The most closest answer seems to be A only. The terminals in the grammar are d,b and c. There is no terminal 'a' at all. So the options B,C and D are ruled out. option A can also be derived at something like this.
S->bA
->bccA
->bccccA
->bccccd
So the sentence generated should be bccccd. If there are any other explanations for the same please post them.


5. Regular expression a+b denotes the set :
(A) {a}
(B) {Epsilon, a, b}
(C) {a, b}
(D) None of these

Ans:-C


June 2006

6. Which of the following strings is in the language defined by grammar
S → OA, A → 1A/0A/1
(A) 01100
(B) 00101
(C ) 10011
(D) 11111

Ans:-B

Explanation:- Non terminals in the above grammar are S, and A. Terminals are 0 and 1. The start symbol of the grammar is S. S->0A. So rule out strings beginning with 1. so that leaves us with two options A and B. S->0A
->00A
->001A
->0010A
->00101
So the option B is correct. If you try to derive the string for option A you would not be able to get it. So, the correct answer is option A.


7. The logic of pumping lemma is a good example of :
(A) pigeon hole principle
(B) recursion
(C) divide and conquer technique
(D) iteration

Ans:-A


December - 2006

8. Which of the regular expressions corresponds to this grammar ? S → AB/AS, A → a/aA, B → b
(A) aa*b+
(B) aa*b
(C ) (ab)*
(D) a(ab)*

Ans:-B


JUNE 2007

9. The regular expression given below describes :
r=(1+01)*(0+λ)
(A) Set of all string not containing '11'
(B) Set of all string not containing '00'
(C) Set of all string containing '01'
(D) Set of all string ending in '0'

Ans:-B

Explanation:-
The meaning of (1+01)* means that the set of strings of 1 and 01 of any length including the NULL string. (0+λ) means either 0 or λ. So the full regular expression stands for the set of strings of 1's and 01's of any length ending with 0 or λ. So we cannot say the string will only end in '0'. It could end in λ also. The string can begin with 1 or 01 and multiple times it can get repeated.But the string '11' cannot be together. So the option could be B.


Wednesday, 15 May 2013

JUNE 2012 - PAPER III

21. A* algorithm uses f' = g + h' to estimate the cost of getting from the initial state to the goal state, where g is a measure of the cost of getting from initial state to the current node and the function h' is an estimate of the cost of getting from the current node to the goal state. To find a path involving the fewest number of steps, we should set
(A) g=1
(B) g=0
(C) h'=0
(D) h'=1

Ans:-A


22. The transform which possesses the highest ‘energy compaction’ property is
(A) Slant transform
(B) Cosine transform
(C) Fourier transform
(D) Karhunen-Loeve transform

Ans:-D


23. Which one of the following prolog programs correctly implement “if G succeeds then execute goal P else execute goal θ ?”
(A) if-else (G, P, θ) :- !, call(G), call(P). if-else (G, P, θ) :- call(θ).
(B) if-else (G, P, θ) :- call(G), !, call(P). if-else (G, P, θ) :- call(θ).
(C) if-else (G, P, θ) :- call(G), call(P), !. if-else (G, P, θ) :- call(θ).
(D) All of the above

Ans:-B

Explanation:- The syntax of If--then---else in prolog goes the following way…
(A->B;C) :-
    call(A),
    !,
    call(B)
(A->B;C) :-
    call(C )
So according to the above syntax option B is correct.


24. The _______ memory allocation function modifies the previous allocated space.
(A) calloc( )
(B) free()
(C) malloc( )
(D) realloc()

Ans:-D


25. Which is not the correct statement(s) ?
(i) Every context sensitive language is recursive.
(ii) There is a recursive language that is not context sensitive.
(A) (i) is true, (ii) is false.
(B) (i) is true and (ii) is true.
(C) (i) is false, (ii) is false.
(D) (i) is false and (ii) is true.

Ans:-B


26. The mechanism that binds code and data together and keeps them secure from outside world is known as
(A) Abstraction
(B) Inheritance
(C) Encapsulation
(D) Polymorphism

Ans:-C


27. Identify the addressing modes of below instructions and match them :
(a) ADI (1) Immediate addressing
(b) STA (2) Direct addressing
(C )CMA (3) Implied addressing
(d) SUB (4) Register addressing
(A) a-1,b-2,c-3,d-4
(B) a-2,b-1,c-4,d-3
(C ) a-3,b-2,c-1,d-4
(D) a-4,b-3,c-2,d-1

Ans:- A

Explanation:- The instruction ADI adds some content to the accumulator. It is an immediate addressing mode instruction.
The instruction STA stores the contents of the accumulator in the particular memory location specified as operand.
CMA instruction takes complement of the contents of the accumulator.
SUB instruction subtracts the contents of the register to the contents of the accumulator.
. So the option is A.


28. Which one of the following is not a Greibach Normal form grammar ?
(i) S → a | bA | aA | bB
A→a B→b
(ii) S→a|aA|AB
A→a
B→b
(iii) S→a|A|aA
A→a
(A) (i) and (ii)
(B) (i) and (iii)
(C) (ii) and (iii)
(D) (i), (ii) and (iii)

Ans:-C

Explanation:- Restriction for GNF:-
The first symbol on the right hand side of the production must be a terminal. It can be followed by zero or more variables. In grammar (ii) of the question, S->AB is a production. AB are two non-terminals and it can be in GNF. In grammar (iii) S->A is given and it is a unit production and that is not allowed in GNF. So the grammar which is not in GNF is (ii) and (iii). So the option is C.


29. Which of the following IP address class is a multicast address ?
(A) Class A
(B) Class B
(C) Class C
(D) Class D

Ans:-D


30. While unit testing a module, it is found that for a set of test data, maximum 90% of the code alone were tested with a probability of success 0.9. The reliability of the module is
(A) atleast greater than 0.9
(B) equal to 0.9
(C) atmost 0.81
(D) atleast 1/0.81

Ans:-C