U.G.C. NET Exam. 4 December, 2019 Paper II (COMPUTER SCIENCE & APPLICATIONS)

Total Questions: 100

21. Given two tables R1 (x, y) and R2 (y, z) with 50 and 30 number of tuples respectively. Find maximum number of tuples in the output of natural join between tables R1 and R2 i.e. R1 * R2 ? (* - Natural Join)

Correct Answer: (d) 1500
Solution:

"A natural Join is based on common attributes or common columns to join two tables or relations
Consider an example, suppose there are two table Employee (Eid, Ename) consists of 5 tuples and department (Eid, Did) consists of 3 tuples only
Natural Join of employee and department (Employee Department) gives : 5 × 3 = 15
So, maximum number of tuples in natural join are from the relation having minimum tuples. So, in given question, R2 contains 30 tuples, So, maximum number of tuples in the output of natural Join between tables R1 and R2 i.e. R1 * R2 = 50 × 30 = 1500.

22. Answer the following question

Correct Answer: (b) Total number of employees of department D1 and D2 if their total is > 5
Solution:

23. Find minimum number of tables required for converting the following entity relationship diagram into relational database?

Correct Answer: (c) 3
Solution:

Rules for finding minimum number of tables required for an ER diagram :
1. A strong entity with single or composite attributes require one table.
2. A strong entity with multivalued attribute requires two tables.
3. In case of many to many relations between two entities, 3 tables are required
There is one to many relationships between R1 and R2. So, two tables are required for two entities. But, entity R2 contains multivalued attribute B, due to which one table for this is also needed. So, minimum number of tables required for the given ER diagram are 3.

24. A counting semaphore is initialized to 8.3 wait ( ) operations and 4 signal ( ) operations are applied. Find the current value of semaphore variable.

Correct Answer: (a) 9
Solution:

V(S) : Signal operation will increment the semaphore variable, that is, S + +.
P(S) : Wait operation will decrement the semaphore variable that is, S – – .
Data : Initial counting semaphore = I = 8
wait operation = 3 P
signal operation = 4 V
Final (current) counting semaphore = F ⇒
Formula : F = I + 4V + 3P
Calculation : F = 8 + 4(+1) +3 (–1)
∴ F = 9
the resulting value of the semaphore is 2.

25. Which of the following is noted by an encryption algorithm used in cryptography?

Correct Answer: (e) (c and d)
Solution:

To encrypt any message, any encryption algorithms necessarily require –
1. Plain text (message)
2. Key (private or public)
Encryption algorithm doesn't require cipher text, it produces cipher text. To decrypt any message, any decryption algorithms necessarily require
1. Cipher text
2. key (private or public)
No encryption or decryption algorithm requires user details.

26. Which of the following CPU scheduling algorithms is/are supported by LINUX operating system?

Correct Answer: (b) Preemptive priority scheduling and time sharing CPU scheduling
Solution:

Linux operation system supports both preemptive priority scheduling and time sharing CPU scheduling. Linux scheduler is a priority preemptive scheduler with two priority ranges-Real time from o to 99 and a nice range from 100 to 140.
Preemptive priority scheduling : It maintains two array : active array and expired array. Schedule the processes baseel on their static and dynamic priorities.
1. It finds the highest priority queue with a runnable process and find the first Process on that queue. Calculate its time quantum, it put that process on expire array list and repeat the process again.
2. When priority level of active queue is empty, it looks for next highest queue, after running all active queues, it swaps active and expire queues.
Diagram :

27. Consider a paging system where translation look aside buffer (TLB) a special type of associative memory is used with hit ratio of 80%.

Assume that memory reference takes 80 nanoseconds and reference time to TLB is 20 nanoseconds. What will be the effective memory access time given 80% hit ratio?

Correct Answer: (b) 116 nanoseconds
Solution:

TLB hit ratio = 0.8
TLB miss ration = 0.2
TLB reference time = 20ns
Main Memory reference time = 80ns
Formula : Effective memory access time (EMAT) = TLB hit (TLB time + Main memory time) + TLB miss (TLB time + 2 × Main memory time)
Calculation :
EMAT = 0.8 (20 + 80) + 0.2 (20 + 80 + 80 )
= 80 + 36
∴ EMAT = 116ns.

28. Answer the following question

Correct Answer: (b)
Solution:

29. Which of the following interprocess communication model is used to exchange messages among co-operative processes ?

Correct Answer: (c) Shared memory and message passing model
Solution:

Inter process communication (IPC) is a mechanism which allows processes to communicate with each other and synchronize their actions. By maintaining this type of communication, processes are said to so - operate with each other. Processes can communicate with each other using these two ways :
– Shared memory
– Message passing

30. Given CPU time slice of 2ms and following list of processer.


Find average turnaround time and average waiting time using round robin CPU scheduling?

Correct Answer: (b) 5.66, 1.66
Solution: