Wednesday, 3 June 2020

UGC NET Computer Science December 2019 | Question 113

Question 113
Let Wij, represents weight between node i at layer k and node j at layer (k-1) of a given multilayer perceptron. The weight updation using gradient descent method is given by

Where α and E represents learning rate and Error in the output respectively.
  1. 1. Wij(t+1)=Wij(t)+α ∂E/∂Wij , 0<=α<=1
  2. 2. Wij(t+1)=Wij(t)-α ∂E/∂Wij , 0<=α<=1
  3. 3. Wij(t+1)=α ∂E/∂Wij , 0<=α<=1
  4. 4. Wij(t+1)= - α ∂E/∂Wij , 0<=α<=1
Answer : 2. Wij(t+1)=Wij(t)-α ∂E/∂Wij , 0<=α<=1

Explanation Question 113

Option 2 is correct answer

PreviousNext
UGC NET CS December 2019 - Question 112UGC NET CS December 2019 - Question 114

UGC NET Computer Science December 2019 | Question 65

Question 65
Let A be the base class in C++ and B be the derived class from A with protected inheritance. Which of the following statement is false for class B?
  1. 1. Member function of class B can access protected data of class A
  2. 2. Member function of Class B can access public data of class A
  3. 3. Member function of class B cannot access private data of class A
  4. 4. Object of derived class B can access public base class data
Explanation
If protected access specifier is used while deriving class then the public and protected data members of the base class becomes the protected member of the derived class and private member of the base class are inaccessible.

In this case, the members of the base class can be used only within the derived class as protected members except for the private members.

TRUE: Member function of class B can access protected data of class A
TRUE: Member function of Class B can access public data of class A
TRUE: Member function of class B cannot access private data of class A
FALSE: Object of derived class B can access public base class data

Private and protected member variables of a derived class are not accessed by using direct member access operator

Given option 4 statement is false.

So, option 4 is correct answer

Reference with example: C++ Access Specifiers - Protected Access Specifier


PreviousNext
UGC NET CS December 2019 - Question 64UGC NET CS December 2019 - Question 66

UGC NET Computer Science December 2019 | Question 66

Question 66
Which tag is used to enclose any number of javascript statements in HTML document?
  1. 1. <code>
  2. 2. <script>
  3. 3. <title>
  4. 4. <body>
Explanation
The < script > tag is used to define a client-side script (JavaScript).

The < script > element either contains scripting statements, or it points to an external script file through the src attribute.

Common uses for JavaScript are image manipulation, form validation, and dynamic changes of content.

Rest options are part of a normal HTML document.

So, option 2 is correct answer

Look at below example java script function for more detail: this function changes the html element text, style text color and fontSize. This function encloses 3 statements.

<!DOCTYPE html>
<html>
<head>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Hello World!";
document.getElementById("demo").style.color = "blue";
document.getElementById("demo").style.fontSize = "35px";
}
</script>

</head>
<body>
<p>When you click "Try it", a function will be called.</p>
<p>The function will display a message.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
</body>
</html>


Reference : JavaScript Introduction

PreviousNext
UGC NET CS December 2019 - Question 65UGC NET CS December 2019 - Question 67

UGC NET Computer Science December 2019 | Question 67

Question 67
A rectangle is bound by the lines x=0; y=0; x=5 and y=3. The line segment joining (-1, 0) and (4, 5). if clipped against this window will connect the points ______
  1. 1. (0, 1) and (3, 3)
  2. 2. (0, 1) and (2, 3)
  3. 3. (0, 1) and (4, 5)
  4. 4. (0.1) and (3, 5)
Explanation
This is simple 2-D geometry question based on equation of line (although clipping window is given and it seems to be based on Cohen Sutherland line clipping algorithm)

We have to find the two points which are the endpoint of the line segment clipped by given rectangle window. Refer the final diagram for more understanding,

Given line segment joining (−1,0) and (4,5) and lets say new endpoints of line segment after clipping are (x,y) and (x1,y1). As all these 4 points are on the same line. So, slope of the line joining any two points is same.

So, by using equation of slope of a the line,
Slope of line = (y2 – y1) / (x2 - x1)

Lets consider point (x,y).

slope of line joining (x,y) & (-1,0) = slope of line joining (4,5) & (-1,0)
∴ (y − 0) / (x − (−1)) = (5 − 0) / (4 − (−1))
∴ y = x + 1

Now only choice A (0,1) and (2,3) satisfy above equation.

So, It conclude that, points (0, 1) and (2, 3) connect line which clipped against given rectangle window.

Hence Option 2 is the right answer.


PreviousNext
UGC NET CS December 2019 - Question 66UGC NET CS December 2019 - Question 68

UGC NET Computer Science December 2019 | Question 72

Question 72
Given two tables
EMPLOYEE (EID, ENAME, DEPTNO)
DEPARTMENT (DEPTNO, DEPTNAME)

Find the most appropriate statement of the given query :
Select count (*) 'total' from EMPLOYEE
where DEPTNO IN (D1, D2)
group by DEPTNO having count (*) > 5
  1. 1. Total number of employees in each department D1 and D2
  2. 2. Total number of emplovees of department D1 and D2 if their total is > 5
  3. 3. Display total number of employees in both departments D1 and D2
  4. 4. The output of the query must have atleast two rows
Answer : 2. Total number of emplovees of department D1 and D2 if their total is > 5

Explanation
Given query group by distinct DEPTNO on the EMPLOYEE relation having rows with same DEPTNO are greater than 5 (i.e. no. of employees for those dept. are greater than 5) and it also further filters only department D1 and D2 using IN(list...) query.

So, option 2 is correct answer.

Reference : SQL HAVING Clause Example

PreviousNext
UGC NET CS December 2019 - Question 71UGC NET CS December 2019 - Question 73

UGC NET Computer Science December 2019 | Question 74

Question 74
A counting semaphore is initialized to 8. 3 wait() operations and 4 signal() operations are applied. Find the current value of semaphore variable.
  1. 1. 9
  2. 2. 4
  3. 3. 1
  4. 4. 4
Answer : 1. 9

Explanation
In counting semaphore, Wait operations will decrease the value and signal operations will increase the value.
Initially counting semaphore value is 8.
3 Wait operations= - 3
4 Signal operation= + 4
= 8 - 3 + 4
= 5 + 4
= 9

So, option 1 is correct answer 

Counting semaphore can take non-negative integer values.
Two standard operations, wait and signal are defined on the semaphore. Entry to the critical section is controlled by the wait operation and exit from a critical region is taken care by signal operation. The wait, signal operations are also called P and V operations. The manipulation of semaphore (S) takes place as following:
  1. The wait command P(S) decrements the semaphore value by 1. If the resulting value becomes negative then P command is delayed until the condition is satisfied.
  2. The V(S) i.e. signals operation increments the semaphore value by 1

    Reference : OS Semaphores

PreviousNext
UGC NET CS December 2019 - Question 73UGC NET CS December 2019 - Question 75

UGC NET Computer Science December 2019 | Question 78

Question 78
Suppose a system has 12 magnetic tape drives and at time t0. three processes are allotted tape drives out of their need as given below:

ProcessMaximum
Needs
Current
Needs
P0105
P142
P292

At time t0, the system is in safe state. Which of the following is safe sequence so that deadlock is avoided?
  1. 1. ( P0, P1, P2 )
  2. 2. ( P1, P0, P2 )
  3. 3. ( P2, P1, P0 )
  4. 4. ( P0, P2, P1 )
Answer : 2. (P1, P0, P2 )

Explanation
Out of Total 12 magnetic tape drives, 9 magnetic tape drives are allocated. So There are 3 remaining magnetic tape drives.

ProcessMaximum
Needs
Allocated
resources
Remaining
Needs
P01055
P1422
P2927

With available 3 magnetic tape drives, process P1 requirements of 2 magnetic tape drives can be fulfilled. So, after completion of process P1, it releases total 4 magnetic tape drives.

Now, with available tap drives are 4 + 1 = 5,
Process P0 requirements of 5 magnetic tape drives can only be fulfilled. So, after completion of process P0, it releases total 10 magnetic tape drives.

Now, available tap drives are 10,
Process P2 requirements of 9 magnetic tape drives can be fulfilled.
Process P2 will completed wihtout deadlock.

The only safe sequence that avoide deadlock is (P1, P0, P2). So, that system is in safe state for given process needs.

So, option 2 is correct answer

PreviousNext
UGC NET CS December 2019 - Question 77UGC NET CS December 2019 - Question 79

UGC NET Computer Science December 2019 | Question 79

Question 79
Which of the following interprocess communication model is used to exchange messages among co-operative processes?
  1. 1. Shared memory model
  2. 2. Message passing model
  3. 3. Shared memory and message passing model
  4. 4. Queues
Answer : 3. Shared memory and message passing model

Explanation
A process can be of two types:
  1. Independent process: It is not affected by the execution of other processes
  2. Co-operating process: It can be affected by other executing processes.
Interprocess communication (IPC) method which will allow them to exchange data along with various information among co-operative processes.
There are two primary models used for interprocess communication (communication among the processes) :
  1. Shared Memory Model
  2. Message Passing Model for sender and receiver process
So, option 3 is correct answer

PreviousNext
UGC NET CS December 2019 - Question 78UGC NET CS December 2019 - Question 80

UGC NET Computer Science December 2019 | Question 87

Question 87
What is the worst case running time of Insert and Extract-min, in an implementation of a priority queue using an unsorted array? Assume that all insertions can be accomodated.
  1. 1. θ(1), θ(n)
  2. 2. θ(n), θ(1)
  3. 3. θ(1), θ(1)
  4. 4. θ(n), θ(n)
Answer : 1. θ(1), θ(n)

Explanation
In the question, given that implementation of priority queue is using an unsorted array

Worst case running time of Insert operation :
Insertion will remain the same for best,average and worst case time complexities. It will take a constant amount of time only.
In the worst case time of insert, we can simply append an element at the end of the unsorted array.
∴ Worst case complexity is θ(1).

Worst case running time of extract min operation :
The Extract-min operation will take θ(n) time for above conditions. The array is unsorted there is naturally no better algorithm than just linear search on the unsorted array. Worst case performance for linear search is θ(n)
∴ Worst case performance will be θ(n)

So, option 1 is correct answer

Reference : Worst-case running time of Insert and Extract-Min

PreviousNext
UGC NET CS December 2019 - Question 86UGC NET CS December 2019 - Question 88

UGC NET Computer Science December 2019 | Question 93

Question 93
Consider the following grammars :
G1:S → aSb|bSa|aa
G2:S → aSb|bSa|SS|λ
G3:S → aSb|bSa|SS|a
G4:S → aSb|bSa|SS|SSS|λ
Which of the following is correct w.r.t. the above grammars?
  1. (1) G1 and G2 are equivalent
  2. (2) G2 and G3 are equivalent
  3. (3) G2 and G4 are equivalent
  4. (4) G3 and G4 are equivalent
Answer : (3) G2 and G4 are equivalent

Explanation
We can differentiate the given grammers by count of a's and b's in strings generated by grammer. Lets evaluate each expression to basic level:

G1:
S → aSb → abSab → abaaab
So, Given grammer generates strings where count of a's = ((count of b's) + 2 )
It generates strings like aa, aaab, baaa, abaaab, aaaabb, bbaaaa,..........

G2:
S → aSb → abSab → abSSab → abλλab (abab)
So, Given grammer generates strings where number of a's is equel to number of b's It generates strings like λ, ab, ba, aabb, bbaa, abab, baba, aaabbb.......

G3:
S → aSb → abSab → abSSab → abaaab
So, Given grammer generates strings where number of a's is greater than number of b's. As we can only replace S by a in last production while deriving a string from given production rules of grammer.It can also generate strings which only contains "a" that is a+ strings like a, aa, aaa, aaa, .......
It generates all strings like aa, aaa, baa, aab, aaaa, aaab, baaa, aaaaa, abaaaab, baaaaba, aabbaa.......

G4:

S → aSb → abSab → abSSab → abλλab (abab)
So, Given grammer generates strings where number of a's is equel to number of b's It generates strings like λ, ab, ba, aabb, bbaa, abab, baba, aaabbb.......

So, from above we list property of all 4 grammers then:
Grammar G1 generates strings where count of a's = ((count of b's) + 2 )
Grammar G2 generates strings where number of a's is equel to number of b's
Grammar G3 generates strings where number of a's is greater than number of b's
Grammar G4 generates strings where number of a's is equel to number of b's

Lets cosider the equivalence between these grammers:
G1 and G2 are not equivalent
G1 and G3 are not equivalent
G1 and G4 are not equivalent
G2 and G3 are not equivalent
G3 and G4 are not equivalent

G2 and G4 are equivalent

From above list we can conclude that only Grammer G2 and G4 can produces strings where number of a's is equel to number of b's.

So, option 3 is correct answer

PreviousNext
UGC NET CS December 2019 - Question 92UGC NET CS December 2019 - Question 94

UGC NET Computer Science December 2019 | Question 16

Question 16 In a certain coding language. 'AEIOU' is written as 'TNHDZ'. Using the same coding language. 'BFJPV' wil...

Popular Posts