Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

Unique Paper Code : 32341303

Name of the Course : B.Sc. (H) Computer Science


Name of the Paper : Computer Networks
Semester : III
Duration : 3 Hours
Maximum Marks : 75
Year of Admission : 2019

Instructions for Candidates:

Attempt any Four out of Six questions.


All Questions carry equal marks.

Q1 What are the three flow control/Error recovery protocols used for noisy channel?
Compare and contrast the Go-Back-N ARQ with Selective Repeat ARQ. Consider that
a 1Mbps satellite link connects two ground stations. The altitude of the satellite is
36,504 km and speed of the signal is 3 × 108 m/s. Assume that the acknowledgment
packets are negligible in size and that there are no errors during communication. What
should be the packet size for a channel utilization of 25% for the satellite link using go-
back-127 sliding window protocol? Further consider that a message M = 1010001101
needs to be transmitted over this link. Cyclic redundancy check (CRC) with divisor
polynomial x5 + x4 + x2 + 1 is used for error detection. What will be the final message
transmitted over the link?

Q2 Explain the circuit switching and packet switching techniques. How is virtual circuit
approach different from datagram approach? A message of size 500 bytes has to be sent
in a network having bandwidth 10Mbps. Assume that each packet contains a header of
100 bytes and packet switching technique is used. If the message is divided into 5
packets, what would be the transmission delay?

Q3 What characteristics of the carrier signal are changed to represent the digital signal in
each of the following modulation techniques: - ASK, FSK, PSK and QAM?
Which of the four digital to analog modulation techniques (ASK, FSK, PSK, QAM) is
most susceptible to noise? Defend your answer.
In a QAM modulation scheme, there are 4 amplitude levels and 16 phase levels and bit
rate is 72 Kbps. Calculate the baud rate.
Q4 The following character encoding is used in a data link protocol:

A: 11010101; B: 10101001; FLAG: 01111110; ESC: 10100011.

Show the bit sequence transmitted (in binary) for the five character frame. A ESC B
ESC FLAG when each of the following framing methods are used:

i. Character count
ii. Flag bytes with byte stuffing.
iii. Starting and ending flag bytes, with bit stuffing

Also find the original data for the given output obtained after applying byte-stuffing
technique:

FLAG A B ESC ESC C ESC ESC ESC FLAG ESC FLAG D E FLAG.

Q5 What is Count to infinity problem? Explain it in brief with suitable example.


Consider a network with 6 routers R1 to R6 connected with links having weights as
shown in the following diagram.

All the routers use the distance vector routing algorithm to update their routing tables.
Each router starts with its routing table initialized to contain an entry for each neighbor
with the weight of the respective connecting link. After all the routing tables stabilize,
how many links in the network will never be used for carrying any data? Also show the
distance vector maintained at each router.

Q6 The network 200.1.2.30 has been subdivided into 4 subnets.

(i) Which class the given IP address belongs to?


(ii) Give the subnet mask for the given IP address.
(iii) Give the IP addresses of these 4 subnets.
(iv) How many hosts can be on each subnet?
(v) Determine the starting IP address and the last IP address of each subnet.
(vi) Determine which network the IP address 200.1.2.130 belongs to.
(vii) Determine the limited broadcast address for each subnet.
Unique Paper Code : 32341303-OC
Name of the Course : B.Sc. (H) Computer Science
Name of the Paper : Computer Networks
Semester : III
Duration : 3 Hours
Maximum Marks : 75
Year of Admission : 2015, 2016, 2017, 2018

Instructions for Candidates:

Attempt any Four out of Six questions.


All Questions carry equal marks.

Q1 The network 200.1.2.30 has been subdivided into 4 subnets.

(i) Which class the given IP address belongs to?


(ii) Give the subnet mask for the given IP address.
(iii) Give the IP addresses of these 4 subnets.
(iv) How many hosts can be on each subnet?
(v) Determine the starting IP address and the last IP address of each subnet.
(vi) Determine which network the IP address 200.1.2.130 belongs to.
(vii) Determine the limited broadcast address for each subnet.

Q2 What characteristics of the carrier signal are changed to represent the digital signal in
each of the following modulation techniques: - ASK, FSK, PSK and QAM?
Which of the four digital to analog modulation techniques (ASK, FSK, PSK, QAM) is
most susceptible to noise? Defend your answer.
In a QAM modulation scheme, there are 4 amplitude levels and 16 phase levels and bit
rate is 72 Kbps. Calculate the baud rate.

Q3 The following character encoding is used in a data link protocol:


A: 11010101; B: 10101001; FLAG: 01111110; ESC: 10100011.
Show the bit sequence transmitted (in binary) for the five character frame. A ESC B
ESC FLAG when each of the following framing methods are used:
i. Character count
ii. Flag bytes with byte stuffing.
iii. Starting and ending flag bytes, with bit stuffing

Also find the original data for the given output obtained after applying byte-stuffing
technique:

FLAG A B ESC ESC C ESC ESC ESC FLAG ESC FLAG D E FLAG.
Q4 Draw the pulse diagram for the bit stream 0011001100110011 and also calculate the
average signal rate for the following line coding schemes:
i. Manchester
ii. Differential Manchester
iii. Polar Return to Zero
iv. Polar Non Return to Zero - Level
v. Polar Non Return to Zero – Inversion
Explain the problems associated with Polar NRZ techniques.

Q5 What is the maximum window size for data transmission in Selective Repeat and Go
Back N protocol if n bit frame sequence numbers are used? Consider a scenario for
Selective Repeat protocol where frames with sequence numbers from 0 to 4 have been
transmitted by the sender. Now assume that the following sequence of event occurs:

(i) frame 0 does time-out


(ii) A new frame with sequence number 5 is transmitted.
(iii) frame 1 and frame 2 time-out
(iv) A new frame with sequence number 6 is transmitted.

At every stage show the status of the sender’s window i.e. the outstanding frames in the
sender’s window.
Consider another scenario for Go Back N sliding window protocol with window size
3 where sender X needs to send a message consisting of 9 packets to receiver Y. If
every 5th packet that sender X transmits gets lost (but no ACKs from receiver Y ever
get lost), then how many packets sender X will transmit for sending the message to
receiver Y?

Q6 How long will it take a station to realize that there has been a collision in CSMA/CD
protocol? Show the working of Back-off algorithm for the following scenario:
Assume X and Y are the only two stations on the Ethernet. Each of them has a long
queue of frames to be transmitted. Both X and Y attempts to transmit a frame at the
same time and the frames collide. Assume that X wins the first Back-off race. At the
end of this successful transmission by X, both X and Y attempt to transmit again and
collide. Show all the possible cases and find the probability of station X wins over
station Y.
Unique Paper Code: 32341301
Name of the Course: B.Sc. (H) Computer Science
Name of the paper: Data Structures
Semester: III
Year of admission: 2019

Duration: 3 Hours Maximum Marks: 75

Instructions for Candidate


Attempt any four questions. All questions carry equal marks.

1 a) Consider a playing machine which emits a random numbered play-card each time it is
pressed. The player has to keep the cards coming out of the machine in his hand in
such a manner that they are always in order. Suggest a scheme that player should
follow to keep the cards always arranged. Depict your scheme pictorially on 7 cards
emitted by playing machine in order <12,10,15,18,1,46,33>. Analyze the
total number of comparisons player has to do.

b) A sorted array A containing n unique elements is rotated k times (k is not known) i.e.
<1, 5, 10, 12, 16, 19, 30> becomes <16, 19, 30, 1, 5, 10,
12>.Write a function that finds minimum element from the rotated array A. Your
function should take logarithmic time. Justify the running time of your function.

2 a) 64 random integers in the range [1, 1000] are arranged to form a square matrix.
These integers are divided into two sets such that integers belonging to lower
triangular part of the matrix are stored in matrix ‘A’ and rest all are stored in matrix
‘B’ without disturbing their arrangement. How many integers will be there in matrix
‘A’ and matrix ‘B’ respectively? All the non-zero integers of matrix ‘A’ and matrix
‘B’ are now to be arranged in linear order with all the integers of matrix ‘A’ followed
by integers of matrix ‘B’. What will be the size of resulting array? The integers,
while being arranged in the linear array are picked in column wise manner. What will
be the location of integer at 3rd row, 4th column in the linear array, considering the
location of the first element to be 200? Derive a conversion formula and justify your
answer.

b) A magician showed a trick to store some 30 numbers in the range [1000, 9999]
in a crate of size 20, with the possibility of more than one number to be placed at
same position. The 20 positions in crate are numbered from 0 to 19. The magician
decides where to put the number based on the middle two digits of the number. When
asked to pick up any number, he goes directly to that position. Devise the trick used
by magician and find out where the following numbers would have been stored
1206, 7822, 6467, 8990, 1211, 4444, 6701, 5468, 7345 and
8210.
3 a) Two printers are attached to a print server. Following strategies are used by the print
server to handle incoming printing requests:
 The server allocates a new printing request to the printer having less number of
pending printing jobs.
 As the time taken by different jobs is different, from time to time, server re-
evaluates the pending jobs of both the printers. In order to balance the load and
increase the efficiency in job completion, the server can remove some of the
jobs (one by one) from the end of one printer and allocates them to the other
printer.

There is no limitation on the number of printing requests that can be allocated to any
printer at any given time. Which data-structure would be most suitable to manage
printing jobs at each printer in this scenario? Write complete class definition for this
data structure with data members, necessary constructors and complete function
definitions for adding and removing printing requests at a printer.

b) A Robot is to be created such that when it is shown some data arranged in a Binary
tree form, can judge whether the shown tree is Binary Search Tree or not. Write this
function for this Robot.

4 Consider a calculating device that does not recognize parenthesis in expressions. The
device can evaluate only those expressions in which an operator appears after its
operands. To correctly evaluate the following expression using this device, suggest a data
structure to convert it into a parenthesis free suitable notation. Depict steps of conversion
for the following expression: ((3*(2+9/2-3^2))/3)-7.

Show the evaluation result of the generated expression applying one operator at a time.

Give complete class definition of this data structure.

5. Following numbers <1, 2, 3, 6, 9, 12, 15, 17> are to be stored in a Binary


Search Tree in sequence one by one. Show the BST after each insertion and calculate the
number of comparisons to search the value ‘17’.

Now construct a BST again for the same values in a manner such that the number of
comparisons for searching any key is not more than 3 at any given time. Show the tree
after each insertion. Delete following values <6,3,2,1> one by one from the generated
tree such that the height of the resultant tree does not increase. Show the tree after each
deletion.

6. a) A memory block can store maximum 4 values and minimum 2 values in ascending
order and give way to 5 more such blocks for creating hierarchical data storage.
However, the top block of this hierarchical data storage is allowed to have minimum 1
value. Considering these restrictions, store the following elements in a way such that
the search time is logarithmic. Show the data structure after each insertion.
<50,17,76,9,23,54,14,19,72,12,67,100,11,25,7,8,52,53,51>

Then, delete values “8” and “23” one by one. Show the data structure after each
deletion.

b) Trace the output of following function ‘func1’ on the given linked list, when the
function is invoked as ’func1 (head->next)’; such that head is pointing to 2.

Linked List - 2->4->6->8->5->1->12->11

void func1(class Node* p, bool a=true)


{
if (p == NULL)
return;
if (a == true)
cout << p->data << " ";
func1(p->next, !a);
}
Unique Paper Code : 32341301-OC
Name of the Paper : Data Structures
Name of the Course : B.Sc. (H) Computer Science
Semester : Third (III)
Duration of Examination : Three Hours
Maximum Marks : 75 marks

Instructions for candidates:


Attempt any 4 questions out of 6 questions.

Q1 Write a recursive function ‘reverse()’ to input a line and print in


reverse order. State whether the function is using Tail recursion or non-tail
recursion? Show the status of run time stack when ‘abcd\n’ is given as
input in the reverse() function. Convert the reverse() function
into non-recursive function using Stack. State whether Stack is a LIFO or
a FIFO structure.
Following definition of a recursive function is given:

h(n) = 0 if n=0;
= n if n > 4
= h(2+h(2n)) if n <=4

What is the value of h(n) if n = 1?

Q2 The following list of numbers is given

3, 28, 45, 23, 12, 26, 90, 56, 76

To search a given number in the above list, which of the searching


technique (linear/binary) is best suited. What is the time complexity of the
suggested technique? Does hashing the above numbers improve the search
efficiency. Draw a hash table with open addressing and a size of 11. Use
the hash function “k%11” and linear probing for collision resolution.
Insert the above keys into your table (in that order). Show the status of
table after each insertion.
Sort the above numbers using a divide and conquer algorithm. Specify the
algorithm and show each step of the algorithm.

Q3 If a triangular matrix of n x n dimension is stored as a 1D array, how


many elements will be there in 1D array? Suppose the following
triangular matrix is given:
2 0 0 0
3 8 0 0
4 0 6 0
0 5 2 0
Show the elements of the 1D array if the matrix is stored by
i) rows ii) columns iii) diagonals (lowest diagonal first) iv) diagonals
(highest diagonal first). Write the code of get(int i, int j)
function which returns the element stored at ith row and jth column
of the given matrix. Give the necessary class definitions. If the matrix is
sparse, is it a better idea to use linked lists? Justify.

Q4 Draw a binary search tree for the following sequence:

55, 45, 89, 35, 99, 23, 78, 12, 0, 25, 69, 49

Show each step separately. Is it a complete binary tree? Justify. Next,


delete the node having value 55. Use delete by merging method. What is
the effect on the height of the resulting tree? Write a function to perform
the following operations on a binary search tree
i) Count the number of leaves
ii) Calculate the height of the tree
Give the necessary class definitions.

Q5 Draw the binary search tree corresponding to the following traversals

Preorder traversal: JCAEGFMR


Inorder traversal: ACEFGJMR

Give the post order traversal of the constructed tree. What are the
advantages of B-tree over binary search tree? Construct a B tree of order
5 by inserting the following keys:

9,14,3,16,4,1,17,6,5,28

Show the B tree diagrammatically after each key insertion

Q6. Write a template function to insert a new node p into a single linked list
before the node q where p and q are the node pointers. The function takes
p and q as input. Give the necessary class definitions. Describe the
situation in which double linked list has an advantage over single linked
list. Does self-organising the list helps in searching? What are the different
ways of self-organizing lists? For a given linked list having A, B, C, D as
nodes, show the list after each step using Move to Front method. Steps
are:
i) search D, ii) search D iii) search B iv) search A v) search B vi) search D
vii) search A viii) search B
Name of Course : Generic Elective
Unique Paper Code : 32355301
Name of Paper : GE-3 Differential Equations
Semester : III
Duration : 3 hours
Maximum Marks : 75 Marks

Attempt any four questions. All questions carry equal marks.

1. Determine the constant 𝐴 such that the differential equation

(𝐴𝑥 𝑦 + 2𝑦 )𝑑𝑥 + (𝑥 + 4𝑥𝑦)𝑑𝑦 = 0


is exact and solve the resulting exact equation.
Solve the following initial value problems:

i) + 𝑦 = 𝑥 𝑦 , 𝑦(2) = −1, 𝑥 > 0.


ii) (3𝑥𝑦 + 𝑦 )𝑑𝑥 + (𝑥 + 𝑥𝑦)d𝑦 = 0, 𝑦(1) = −1 .

2. Find the orthogonal trajectory of the family 𝑦 = 𝑐 sin 𝑥 that passes through the point (2𝜋, 2). Also
find the family of oblique trajectory that intersects the family of circles 𝑥 + 𝑦 = 𝑐 at an angle .
Show that the family of confocal conics + = 1, where 𝑎 and 𝑏 are fixed constants and 𝜆 is
the parameter, is self orthogonal.

3. Show that the set {1, 𝑥, 𝑥 } of functions forms a basis for the solution set of a differential equation.
Also, find such a differential equation.

Find the general solution of the second order equation 𝑡 𝑦 + 2𝑡𝑦′ − 2𝑦 = 0 given that 𝑦 (𝑡) = 𝑡 is
a solution. Also solve the initial value problem
1
𝑦 + 3𝑦 − 4𝑦 = 0, 𝑦(0) = 1, 𝑦 (0) = 0, 𝑦 (0) = .
2

4. Find the general solution of the following differential equations:


i) −3 + 2𝑦 = 2𝑥 + 3𝑒 .
ii) −2 + 𝑦 = 𝑒 log 𝑥.
iii) 𝑥 −𝑥 − 3𝑦 = 𝑥 log 𝑥.
5. Find the partial differential equation arising from the equation 𝑎𝑥 + 𝑏𝑦 + 𝑧 = 1, where
𝑧 = 𝑧 (𝑥, 𝑦).
Find the general solution of the linear partial differential equation
(𝑦 + 𝑥𝑢)𝑝 − (𝑥 + 𝑦𝑢)𝑞 = 𝑥 – 𝑦 .

Using 𝑣 = ln 𝑢 and 𝑣 = 𝑓(𝑥) + 𝑔(𝑦), solve the equation

𝑦 𝑢 + 𝑥 𝑢 = (𝑥𝑦𝑢) , 𝑢(𝑥, 0) = 𝑒 .

6. Reduce the following equations to canonical form and hence find their solutions
i) 𝑢 – 𝑦𝑢 = 1 + 𝑢.
ii) 𝑦 𝑢 + (𝑥 + 𝑦)𝑢 + 𝑥 𝑢 = 0, 𝑦 ≠ 𝑥.
iii) 𝑢 – 4𝑢 + 4𝑢 = 0.
Course : B.Sc.(H) Computer Science

Semester : III

Paper Title : Operating Systems

Unique Paper Code : 32341302

Admission Year : 2019

Max. Marks : 75

Time : 3 hrs

Instructions for students:


 Attempt any 4 questions. All questions carry equal marks.

Q1 For memory protection, each process has a base and a limit register. A process is not allowed
to access memory outside the range of its base and limit registers. Can a user change its base
register or limit register value, justify your answer? How does operating system ensures
protection of system data?
Although the system data is not directly accessible to the user but they are able to access the
hardware resources, so how are user processes able to access these resources, explain?

RAM is volatile in nature but when a computer is switched on , operating system is up and
running. How is the operating system code brought in the main memory, explain?

A company wants to launch a mobile phone (handheld device). Suggest the features to be
included in the operating system comparing them with features of operating system of laptop/
desktop.

Q2 Find the number of unique threads created at statements 1 to 4 each, as specified in the code
given below, additionally in each case mention the process which is creating the thread.
Justify your answer.

int main( )
{
int x;
thread_create(...); // (1)
x= fork();
thread_create(...); // (2)
if (x==0)
{
thread_create(...); // (3)
fork();
}
thread_create(...); // (4)
return 0;
}
In a system having multiple processes contending for resources simultaneously deadlock can
occur. Consider a system with 4 processes(P1, P2, P3, P4) and 3 non shareable resources (R1,
R2, R3) having single instance for R1 and R2 each and two instances for R3, with resource
allocation state as given below:
 P1 is holding R2 and waiting for R1.
 P3 is waiting for R2 and holding R3
 P2 is using R3
 P4 is using R1 and waiting for R3
Draw the resource allocation graph. Does any deadlock occur in the system, justify your
answer? Explain how four conditions necessary for deadlock apply in context of given
scenario.

Q3
P1 P2
Use A; Use A;
Use B; Use B
Consider a system having two processes P1 and P2 as shown above, needing to use two non
shareable resources A and B in the following sequence.

P2 --> A ...............(1)
P1 --> A ..............(2)
P1 --> B ..............(3)
P2 --> B .............(4)

How many semaphores will ensure the above sequence of resource usage, show the working?

Multiple processes may be ready to execute at the same time but in single processor systems
CPU can be allocated to one at a time. Consider the following set of processes with the length
of CPU burst given in milliseconds

Process Arrival Time Burst Time Priority


P1 0 5 4
P2 2 6 1
P3 3 4 5
P4 5 8 3
P5 6 3 3

Assuming that low value indicate high priority, draw Gantt chart for SRTF( shortest remaining
time first) and non pre-emptive priority based CPU scheduling algorithms. Calculate average
turnaround time and average waiting time for each algorithm.

Q4 Consider a process of size 435 bytes stored in a 2 KB physical memory divided into fixed size
frames of 32 bytes each. How many pages will be there in this process? How much and what
type of wastage of space is in this allocation, if any? Calculate the number of bits required to
represent the page number, frame number and complete logical and physical addresses. How
many more pages this process can have without increasing the number of bits for the page
number and why?

Assume a process with 8 pages of size, each of size 1 KB stored in main memory of 16
frames as per the details given in the page table below:

Frame no.
0 2
1 14
2 0
3 5
4 A
5 7
6 3
7 1

Assume any value for A (from 0-15 and not already in use) and mention in your answer.
What will be the frame number and offset (in decimal) for the logical addresses given below.
Additionally calculate the physical address for each.
a) 6748
b) 2874
c) 1387
d) 5235

Q5 Consider the following sequence of logical memory address references (in decimal) for a
process divided into pages (page size is 100 bytes).

28, 251, 75, 145, 568, 40, 392, 199, 485, 278, 653, 745

Give the memory reference string for the process. Find the number of page faults for the
reference string using LRU and FIFO page replacement algorithm, if 3 frames are allocated to
the process. Give one advantage of each.

Extending the philosophy of demand paging and considering the fact that many child
processes execute exec() system call after their creation, is it necessary to create a copy of
parent’s address space for the child immediately after its creation? Which technique is used to
handle this issue? How?

Q6 The two simplest disk-scheduling algorithms are FCFS (First come first serve) and SSTF
(shortest seek time first) algorithms. Using these algorithms, find the total head movements,
for the following sequence of disk track requests for a disk having 300 cylinders numbered
from 0 to 299.

27, 129, 110, 186, 147, 41, 10, 64, X.

Where X can be any number in the range 100 to 200. Mention the value of X in your answer.
Assume that the disk head is initially positioned over track 120.
Find out which algorithm has more head movement and by how much.

There is a disk which can store 2048 bytes per sector and has 100 sectors per track, 120 tracks
per surface and has 4 usable surfaces. If we want to store 30,000 logical records which are of
512 bytes each, how much disk space is needed? Calculate in terms of sectors and tracks.
Ignore any file header(s) or indices. Assume that records cannot span two sectors.
This Question Paper contains 3 page(s)

Unique Paper Code : 32341302


Name of the Course : B.Sc. (H) Computer Science CBCS
Name of the Paper : Operating System
Semester : III
Duration : 3 hours
Maximum Marks : 75
Year of Admission : 2015-2018

Attempt any four questions. All Questions carry equal marks.


Q 1. Given memory partitions of 110 KB, 450 KB, 290 KB, 350 KB and 700 KB (in
order), how would each of the first-fit, best-fit and worst-fit algorithms place
processes of 200 KB, 410 KB, 110 KB and 420 KB (in that order) ? Which algorithm
makes the most efficient use of memory?

Consider a paging system with the page table stored in memory. If a memory
reference takes 100 nanoseconds how long does a paged memory reference take? If
we add a TLB and 70 % of all page-table references are TLB hits, what is the
effective memory reference time? (Assume that finding a page-table entry in the TLB
takes 10 nanoseconds, if the entry is there.)

Assuming a 2-KB page size, what are the page numbers and offsets for the following
address references (provided as decimal numbers): 5378, 15300, and 20500. Show
calculation at each step.

Q 2. Consider a system consisting of four resources of the same type that are shared by
three processes, each of which needs at most two resources. Show that the system is
deadlock free using resource allocation graph. What is the effect of multithreading on
deadlock?

At a particular time of computation the value of a counting semaphore is 10. Then 8


wait ( ) operations and 5 signal ( ) operations were completed on this semaphore.
Determine the resulting value of the semaphore? Show the execution at each step.

A program has just read the fifth record. It next wants to read the eleventh record.
How many records must the program read to input the eleventh record using Direct
Access and Sequential Access methods? Explain your answer.

Q 3. Consider the following page-reference string: 3,1,2,4,2,3,1,5,6,2,1,2,3,7,6,3,2,1,2,3


How many page faults would occur for Optimal and Least recently used replacement
algorithms, assuming three and four frames? Note that all frames are initially empty,
and first unique pages will all cost one fault each.

Assume we have a demand-paged memory. The page table is held in registers. It


takes 10 milliseconds to service a page fault if an empty page is available or the
replaced page is not modified and 30 milliseconds if the replaced page is modified.
Memory access time is 100 nanoseconds. Assume that the page to be replaced is
modified 80 percent of the time. What is the maximum acceptable page-fault rate for
an effective access time of no more than 100 nanoseconds?

If the total number of frames in main memory is 120 and there are 4 processes in the
system with the demand as 40, 10, 90 and 60 frames, respectively. What will be the
number of frames allocated using the equal and proportional allocation strategies?

Q 4. Consider the following set of processes, with the length of the CPU burst times given
in milliseconds:
Processes Burst Time Priority Arrival Time
P1 12 3 0
P2 10 4 1
P3 2 2 2
P4 3 1 3
P5 5 2 4

Draw four Gantt charts illustrating the execution of these processes using FCFS, pre-
emptive SJF (equal burst length processes are scheduled in FCFS), a pre-emptive
priority (small priority number means high priority, equal priority processes are
scheduled in FCFS), and a RR (quantum=3) scheduling.
And calculate average waiting and turnaround time for all above mentioned
scheduling algorithms.

Which of the following scheduling algorithms could result in starvation: Shortest-job


first, Round robin and Priority. Justify your answer.

Q 5. Suppose that a disk drive has 3000 cylinders, numbered 0 to 2999. The drive is
currently serving a request at cylinder 140, and the previous request was at cylinder
120. The queue of pending requests, in FIFO order, is

500, 1400, 910, 1700, 940, 1509, 1022, 170, 1300

Starting from the current head position, what is the total distance (in cylinders) that
the disk arm moves to satisfy all the pending requests, using SSTF, C-LOOK and
SCAN disk scheduling algorithms?

What will happen if a user program to get stuck in an infinite loop and never return
control to the operating system. Explain how operating system deals with such
problem?

Q 6. Consider the following code fragment executed by a process. What will be the output
of this code? Justify your answer.
#include < unistd.h >
int main ()
{
int i ;
for (i=0; i<8; i++)
if (i%2 == 0) fork ( ) ;
return 0 ;
}

List three major activities of an operating system with regard to File Management
and Memory Management. Give justification for your answer.
Explain what may happen if setting the values of Base and Limit registers are not
privileged instructions? Also why is it easy to add a new service in microkernel
approach?
Unique Paper Code : 32343307
Name of Paper : Programming in Python
Name of Course : B.Sc. (H) Computer Science (CBCS)
Semester : III

Duration : 2 Hours Max Marks : 25

Attempt any three questions.

All Questions carry equal marks.

Q1. Write a function avgMarks() which accepts two parameters:


(i) a list marksList having marks of a student in three subjects.
(ii) an integer passMarks denoting minimum marks required to pass a subject.
If the marks obtained in any subject are less than passMarks, then raise an exception displaying
'Essential Repeat', otherwise the function avgMarks() returns the average percentage
obtained by the student. For example, if marksList = [80, 82, 78] and passMarks =
50 then avgMarks()should return 80. If marksList = [80, 82, 38] and
passMarks = 50 then avgMarks()should raise exception displaying 'Essential
Repeat'.
Write a Python program that does the following:
• Reads marks of a student in three subjects. While inputting the marks of a student use
an assert statement to check that the marks are between 1 and 100 for each subject.
• Reads passMarks. While inputting the passMarks use an assert statement to
check that the passMarks are between 1 and 100.
• If the reading is successful, make use of the function avgMarks() to return the
percentage obtained by the student.

Q2. Consider a tuple T1 = (1, 2, 5, 7, 9, 3, 4, 6, 8, 10). Write a function primes()


that accepts tuple T1 as argument and creates a list T2 having values that are prime numbers in the
tuple T1. The function should return a dictionary primeCubes where keys are items of the list
T2 and the values are cubes of the keys. For example, when T1 as passed as an argument, T2 will
be [2, 5, 7, 3] and primeCubes will be {2:8,5:125,7:343,3:27}.
Q3. Define a class Salesman that stores information about employees in a company. The class
should contain the following data members:
• name –Name of the Salesman
• region – Region assigned to the Salesman ('Delhi' or 'Mumbai')
• basicPay, HRA – Salary Components, where HRA is 4000 if the location assigned is
'Delhi' otherwise HRA is 8000 if the location assigned is 'Mumbai'
• salary – Gross Salary of the salesman. This should be computed using a function
grossSalary() for determining the gross salary as basicPay + HRA.

The class should support the following methods:


• _init_() for initializing data members.
• display() which displays the information about the salesman.
If the salesman 'Raman' from 'Delhi' region has basic as Rupees 20000, then his gross
salary will be Rupees 24000. If the salesman 'Aman' from 'Mumbai' region has basic as
Rupees 20000, then his gross salary will be Rupees 28000.
Q4. Write a function readData() that accepts three arguments, namely, name of an input text file,
name of output file, and a character. It should read the text file and write alternate lines of this file
to the output file. The function should also return the number of occurrences of the character
(specified as argument) in the input file.
Name of Course : CBCS B.Sc. (H) Mathematics
Unique Paper Code : 32355301_OC
Name of Paper : GE-3 Differential Equations
Semester : III
Duration : 3 hours
Maximum Marks : 75 Marks

Attempt any four questions. All questions carry equal marks.

1. Solve the following problems as indicated:


i. Find the orthogonal trajectories of the family of curves: 𝑥 2 − 𝑦 2 + 2𝜌𝑥𝑦 = 1, where 𝜌 is a
parameter.
ii. Find an integrating factor and solve: (1 − 𝑥 2 )𝑦𝑑𝑦 + 2(𝑦 2 + 4)𝑑𝑥 = 0, 𝑦(3) = 0.

2. Solve the following problems as specified:


i. Reduce the equation to homogeneous form using the substitution 𝑦 = 𝑧 2 and hence solve it:
𝑑2 𝑦 𝑑𝑦 2 𝑑𝑦
2𝑥 2 𝑦 + 4𝑦 2 = 𝑥 2 ( ) + 2𝑥𝑦 .
𝑑𝑥 2 𝑑𝑥 𝑑𝑥
ii. Find the complimentary functions for the differential equations:
𝑑2 𝑦 𝑑𝑦 𝑑2 𝑦 𝑑𝑦 𝑑2 𝑦 𝑑𝑦
𝑑𝑥 2
+ 𝑑𝑥 + 𝑦 = 𝑥 2 , 2 𝑑𝑥 2 − 10 𝑑𝑥 + 12𝑦 = 𝑒 𝑥 , 16 𝑑𝑥 2 − 24 𝑑𝑥 + 9𝑦 = sin 𝑥 .
iii. Find a second order homogeneous linear ordinary differential equation having 𝑥 −3 and 𝑥 −5 as
its solutions. Also use Wronskian to show linear independence or dependence of these
solutions.

3. Using method of undetermined coefficients, solve the differential equations:


𝑑2 𝑦 𝑑𝑦
i. 𝑑𝑥 2
+ 3 𝑑𝑥 + 2𝑦 = cos 𝑥.
𝑑2 𝑦 𝑑𝑦
ii. +5 + 6𝑦 = 𝑥 2 .
𝑑𝑥 2 𝑑𝑥

4. Find the series solution of the differential equations:


𝑑2 𝑦
i. 𝑑𝑥 2
+ 2𝑥𝑦 = 0.
𝑑2 𝑦 𝑑𝑦
ii. (1 − 𝑥 2 ) − 𝑥 𝑑𝑥 + 4𝑦 = 0.
𝑑𝑥 2

5. Form the partial differential equations by eliminating the arbitrary constants or arbitrary functions
from the following surfaces:
i. 2z = mx 2 + ny 2 + mn , m and n are arbitrary constants.
ii. 2 z = a + ( x + by ) 2 , a and b are arbitrary constants.
iii. z = x + y + f1 (cx + y ) + f 2 (cx − y ), c( 0) is a fixed constant, f1 and f2 are arbitrary functions.

6. Identify the equation which is parabolic by nature. Reduce that equation to canonical form and
hence solve that equation.
i. 𝑥 2 𝑢𝑥𝑥 − 𝑦 2 𝑢𝑦𝑦 − 2𝑦𝑢𝑦 + sin 𝑥 𝑢𝜘 = 0, 𝑥 ≠ 0, 𝑦 ≠ 0 .
ii. 4𝑦 2 𝑢𝑥𝑥 − 3𝑥𝑦𝑢𝑥𝑦 + 𝑥 2 𝑢𝑦𝑦 + 𝑥𝑢𝑥 + 𝑦𝑢𝑦 = 0, 𝑥 ≠ 0, 𝑦 ≠ 0 .
𝑦2 𝑥2
iii. 𝑦 2 𝑢𝑥𝑥 − 2𝑥𝑦𝑢𝑥𝑦 + 𝑥 2 𝑢𝑦𝑦 − 𝑢 − 𝑢 = 0, 𝑥 ≠ 0, 𝑦 ≠ 0 .
𝑥 𝑥 𝑦 𝑦

You might also like