B.sc. (CBCS) Semester III 2021

You might also like

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

Unique Paper Code : 32341303

Name of Course : B.Sc. (H) Computer Science (CBCS-LOCF)


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

Instructions for Candidates


Attempt any four questions
All Questions carry equal Marks

Q1. a) A message M(x) 1101101101 is transmitted using the CRC method. The generator
polynomial is x3 +1. Compute the bit stream transmitted which includes the message and
CRC. Suppose that the fifth bit from the left is inverted during transmission. Show that this
error is detected at the receiver’s end. Elaborate the steps involved.

b) How can the receiver correct a single bit error occurred during the transmission? Name the
method used for this purpose. Compute the bit stream transmitted using this method for the
message M = 1101101. Show the steps to detect and correct the error at receiver’s end if
the fifth bit from the left is inverted during transmission.

Q 2. Briefly state the functionality of the following devices/protocols. Also mention the
layer(s) on which each of these operate.
(i) TCP (ii) IP (iii) UDP (iv) ICMP
(v) DNS (vi) SMTP (vii) Switch (viii) Router
(ix) HTTP (x) ARP (xi) Hub (xii) RARP
Q3. a) What is the bandwidth of an analog signal that can be decomposed into five sine waves with
frequencies at 10, 210, 100, 130 and 150 Hz? How long will it take to send a frame of
100,000 bits if the bandwidth of the digital channel is 10 kbps? What is the maximum data
rate supported by this line, if the signal-to-noise ratio is 1023 with bandwidth of 10 kbps?

b) What is the bit pattern of the preamble used in Ethernet frame? What is the purpose of
using preamble? Ethernet requires valid frames to have at least 46 bytes data. Give reasons
for choosing the minimum data size of 46 bytes. How the data of size less than 46 bytes is
handled by Ethernet?

c) Why do we require guard bands in frequency division multiplexing (FDM)? Assume that
a voice channel occupies a bandwidth of 4 KHz. We need to multiplex 10 voice channels
with guard bands of 500 Hz using FDM. Calculate the required bandwidth. Can we use
coaxial cable for transmitting this multiplexed data? Give reasons in support of your
answer.
Q4. a) An organization is granted a block of addresses beginning with 100.100.100.0/24. How
many addresses are possible in this block? How many hosts can we connect to each subnet
if the organization needs to have 8 subnets? Give first and last address in each of the 8
subnets.

b) Explain the difference between circuit switching and packet switching techniques. A
message of size 10000 bytes has to be sent in a network having bandwidth 10 kbps. Assume
that each packet size is 1000 bytes with header of 100 bytes. How many packets will be
formed to transmit this message? How much time will it take to transmit this message?

Q5. Explain UDP header with the help of diagram. What is the minimum and maximum size of
a UDP segment? List and explain the steps involved in message transfer from source to
destination using UDP? How do they differ from the steps used by TCP for message
transfer?

Q6. a) What is the importance of flow control in context of network communication? Which
layer(s) provide this service? List and compare the different flow control protocols.

b) What are the different types of transmission impairment? How are these type of
transmission impairment handled? Consider an extremely noisy channel in which the value
of the signal-to-noise ratio is 40 dB. Compute approximate bit rate if bandwidth of the
channel is 1 kHz.
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.‌‌
   ‌
 ‌
 ‌
Q‌‌1 ‌ ‌ Write‌‌a‌‌program‌‌to‌‌implement‌‌a‌‌ticket‌‌reservation‌‌system‌‌for‌‌a‌‌particular‌‌flight.‌‌ 
The‌‌program‌‌should‌‌display‌‌a‌‌menu‌‌with‌‌the‌‌following‌‌options:‌  ‌

1. reserve‌‌a‌‌ticket.‌  ‌
2. cancel‌‌a‌‌reservation.‌  ‌
3. check‌‌whether‌‌a‌‌ticket‌‌is‌‌reserved‌‌for‌‌a‌‌particular‌‌person.‌  ‌
4. display‌‌the‌‌passenger‌‌list.‌  ‌

 ‌
Use‌‌singly‌‌linked‌‌list‌‌for‌‌storing‌‌information.‌‌Information‌‌is‌‌maintained‌‌in‌‌
 
ascending‌‌order‌‌of‌‌names.‌‌    ‌
 ‌
Is‌‌there‌‌any‌‌disadvantage‌‌if‌‌information‌‌is‌‌not‌‌kept‌‌in‌‌a‌‌sorted‌‌way?‌‌
   ‌
 ‌

Q‌‌2 ‌ ‌ a) Consider‌‌ the‌‌ intermediate‌‌  configurations‌‌ of‌‌  an‌‌


 array‌‌ being‌‌ sorted.‌‌  Which‌‌ 
sorting‌‌algorithm‌‌is‌‌being‌‌used‌‌in‌‌each‌‌case?‌‌Justify‌‌your‌‌answer.‌  ‌
‌(i)‌ ‌(10,‌‌3,‌‌14,‌‌9,‌‌8)‌ ‌(3,‌‌10,‌‌14,‌‌9,‌‌8)‌ ‌(3,‌‌8,‌‌14,‌‌9,‌‌10)‌ ‌(3,‌‌8,‌‌9,‌‌14,‌   ‌ ‌
‌10),‌‌(3,‌‌8,‌‌9,‌‌10,‌‌14)‌  ‌
(ii)‌ ‌(50‌‌,‌‌3,‌‌20,‌‌40,‌‌10,‌‌)‌ ‌(3,‌‌20,‌‌40,‌‌10,‌‌50)‌ ‌(3,‌‌20,‌‌10,‌‌40,‌‌50)‌ ‌(3,‌‌10,‌ 
‌20,‌‌40,‌‌50),‌ ‌(3,‌‌10,‌‌20,‌‌40,‌‌50)‌  ‌
 ‌
 ‌
 ‌
 ‌
b) Consider‌‌an‌ ‌n‌‌X‌‌n‌‌matrix‌‌A‌‌where‌‌    ‌
 ‌
‌A[i,j]‌‌=‌‌0‌‌if‌ ‌(i+j-n)‌‌!=0,1,‌‌2‌ ‌1<=‌‌i,‌‌j‌‌<=n‌  ‌
 ‌
The‌  ‌non-zero‌  ‌elements‌  ‌of‌  ‌this‌  ‌matrix‌‌   ie.‌‌
  the‌‌
  element‌‌  A[i,j]‌‌
  where‌‌   i+j-n‌‌ 
>=0‌‌   and‌‌ i+j-n<=2‌‌ , ‌‌are‌‌
 stored‌‌
 in‌‌ a ‌‌single‌‌ dimensional‌‌  array.‌‌ What‌‌  will‌‌  be‌‌ 
the‌‌
  size‌‌
  of‌‌
 this‌‌
 1-dimensional‌‌ array‌‌  B?‌‌
 How‌‌ the‌‌  elements‌‌ of‌‌ A ‌‌are‌‌ stored‌‌ 
in‌‌B.‌‌Write‌‌the‌‌formula‌‌for‌‌accessing‌‌(i,j)‌‌th‌‌element‌‌of‌‌A?‌  ‌
 ‌
The‌‌   following‌‌   5X5‌‌
  matrix‌‌
  of‌‌
  the‌‌  above‌‌   type‌‌  is‌‌
  given.‌‌ Store‌‌ this‌‌
 a ‌‌single‌‌ 
dimensional‌  ‌array‌  ‌B‌  ‌using‌  ‌the‌  ‌above‌  ‌scheme.‌  ‌Calculate‌  ‌the‌  ‌address‌  ‌of‌ 
A[3,3]‌‌if‌‌the‌‌base‌‌address‌‌of‌‌array‌‌B‌‌is‌‌200.‌  ‌
 ‌
0‌  ‌ 0‌  ‌ 0‌  ‌ 10‌  ‌ 20‌  ‌

0‌  ‌ 0‌  ‌ 5‌  ‌ 6‌  ‌ 9‌  ‌

0‌  ‌ 11‌  ‌ 25‌  ‌ 29‌  ‌ 0‌  ‌

30‌  ‌ 90‌  ‌ 12‌  ‌ 0‌  ‌ 0‌  ‌

52‌  ‌ 19‌  ‌ 0‌  ‌ 0‌  ‌ 0‌  ‌


 ‌

Question‌‌3 ‌ ‌
a) Shyam‌  ‌wants‌  ‌to‌  ‌evaluate‌  ‌the‌  ‌following‌  ‌expression.‌  ‌He‌  ‌doesn't‌  ‌know‌‌ 
maths,‌‌
  so‌‌
  he‌‌
  seeks‌‌  help‌‌
  from‌‌  his‌‌
  friend‌‌
  Ram.‌‌ Ram‌‌ doesn’t‌‌  know‌‌
 how‌‌ to‌‌ 
evaluate‌  ‌infix‌  ‌expressions‌  ‌but‌  ‌he‌  ‌is‌  ‌an‌  ‌expert‌  ‌in‌  ‌solving‌  ‌postfix‌‌ 
expressions.‌  ‌Help‌  ‌Ram‌  ‌by‌  ‌converting‌  ‌the‌  ‌following‌‌   infix‌‌  expression‌‌
  to‌‌ 
postfix‌‌expression.‌  ‌

‌2‌‌+‌‌(‌‌(‌‌(‌‌30‌‌-‌‌10)*(‌‌10‌‌-5‌‌)‌‌+‌‌15‌‌)‌‌/‌‌5)‌‌*‌‌(‌‌10‌‌-‌‌5)‌ 

Show‌‌the‌‌status‌‌of‌‌the‌‌stack‌‌at‌‌each‌‌step.‌  ‌

Also‌‌  evaluate‌‌  the‌‌


  above‌‌
  postfix‌‌
  expression‌‌
  using‌‌
  stack.‌‌
  Show‌‌
  the‌‌
  status‌‌ 
of‌‌the‌‌stack‌‌at‌‌each‌‌step.‌  ‌
 ‌

 ‌

 ‌
b) What‌‌does‌‌the‌‌following‌‌function‌‌compute?‌  ‌

int‌‌function‌‌(int‌‌*array,‌‌int‌‌size)‌  ‌
‌{  ‌‌ ‌
‌int‌‌temp‌‌=‌‌0;‌  ‌
‌for‌‌(int‌‌i=0‌‌;‌‌i<size‌‌;‌‌i++)‌  ‌
‌temp‌‌+=‌‌array[i];‌  ‌
‌return‌‌temp;‌  ‌
‌} ‌ ‌

Write‌‌   a ‌‌recursive‌‌
  function‌‌
 that‌‌
 performs‌‌ the‌‌
 same‌‌ operation‌‌  as‌‌ performed‌‌  by‌‌
 
the‌  ‌function‌  ‌given‌  ‌above.Which‌  ‌data‌  ‌structure‌  ‌is‌  ‌used‌  ‌to‌  ‌implement‌‌ 
recursion?‌  ‌Explain‌  ‌how‌  ‌recursion‌  ‌works‌  ‌with‌  ‌the‌  ‌help‌  ‌of‌  ‌the‌  ‌recursive‌‌ 
function‌‌written‌‌above‌‌and‌‌an‌‌array‌‌containing‌‌the‌‌values‌‌2,‌‌6,‌‌3,‌‌4,‌‌5,‌‌9,‌‌1.‌  ‌

Question‌‌4 ‌ ‌ Suppose‌‌there‌‌is‌‌a‌‌circle.‌‌There‌‌are‌n‌ ‌‌petrol‌‌pumps‌‌on‌‌that‌‌circle.‌‌You‌‌are‌‌given‌‌ 


two‌‌sets‌‌of‌‌data.‌  ‌
1.‌ T‌ he‌‌amount‌‌of‌‌petrol‌‌that‌‌every‌‌petrol‌‌pump‌‌has.‌  ‌
2.‌ ‌Distance‌‌from‌‌that‌‌petrol‌‌pump‌‌to‌‌the‌‌next‌‌petrol‌‌pump.‌  ‌

Calculate‌‌the‌‌first‌‌point‌‌from‌‌where‌‌a‌‌truck‌‌will‌‌be‌‌able‌‌to‌‌complete‌‌the‌‌circle‌‌ 
(The‌‌truck‌‌will‌‌stop‌‌at‌‌each‌‌petrol‌‌pump‌‌and‌‌it‌‌has‌‌infinite‌‌capacity).‌‌Expected‌‌  
time‌‌complexity‌‌is‌‌O(n).‌‌Assume‌‌for‌‌1-litre‌‌petrol,‌‌the‌‌truck‌‌can‌‌go‌‌1‌‌unit‌‌of‌‌ 
distance.‌‌   ‌

Suggest‌‌the‌‌appropriate‌‌data‌‌structure‌‌and‌‌give‌‌the‌‌implementation‌‌of‌‌the‌‌above‌‌  
function‌‌to‌‌calculate‌‌the‌‌first‌‌point.‌‌Further,‌‌trace‌‌your‌‌function‌‌on‌‌the‌‌given‌‌ 
following‌‌data:‌  ‌

6‌‌petrol‌‌pumps‌‌with‌‌amount‌‌of‌‌petrol‌‌and‌‌distance‌‌to‌‌next‌‌petrol‌‌pump‌‌are‌  ‌
{3,5},‌‌{6,7},‌‌{4,1},‌‌{2,6},‌‌{8,3},‌‌{4,5}‌  ‌
 ‌

Question‌‌5 ‌ ‌ a) An‌‌operating‌‌system‌‌uses‌‌the‌‌Non-Preemptive‌‌Priority‌‌scheduling‌‌ 
(NPPS)‌‌algorithm‌‌to‌‌schedule‌‌processes,‌‌wherein,‌‌each‌‌process‌‌is‌‌  
assigned‌‌a‌‌priority.‌‌Process‌‌with‌‌the‌‌highest‌‌priority‌‌(priority‌‌1‌‌is‌‌highest‌‌ 
priority)‌‌is‌‌to‌‌be‌‌executed‌‌first‌‌and‌‌so‌‌on.‌‌Ties‌‌are‌‌broken‌‌arbitrarily.‌‌   ‌
 ‌
For‌‌the‌‌NPPS‌‌scheduling‌‌algorithm,‌‌which‌‌of‌‌the‌‌following‌‌data‌‌  
structures:-‌‌linked‌‌list,‌‌binary‌‌search‌‌tree,‌‌Binary-Heap;‌‌is/are‌‌suitable‌‌ 
to‌‌add‌‌a‌‌process‌‌in‌‌O(log‌‌n)‌‌time‌‌and‌‌schedule‌‌a‌‌process‌‌in‌‌O(log‌‌n)‌‌ 
time.‌‌Justify‌‌your‌‌answer.‌  ‌
 ‌
For‌ t‌ he‌‌chosen‌​d‌ ata‌‌structure‌‌​show‌‌its‌‌contents‌‌as‌‌processes‌‌are‌‌added‌‌ 
and‌‌scheduled‌‌as‌‌per‌‌the‌‌given‌‌sequence.‌‌(show‌‌results‌‌after‌‌each‌‌step)‌  ‌
 ‌
-Add‌‌process‌‌P​1​‌‌(Priority‌‌8)‌‌   ‌
-Add‌‌process‌‌P​2​‌‌(priority‌‌4)‌‌   ‌
-Add‌‌process‌‌P​3​‌‌(priority‌‌3)‌‌   ‌
-Add‌‌process‌‌P​4​‌‌(priority‌‌5)‌  ‌
‌-Add‌‌process‌‌P​5​‌ ‌(priority‌‌1)‌  ‌
‌-Add‌‌process‌‌P​6​‌‌(priority‌‌6)‌‌
   ‌
-Retrieve‌‌a‌‌process‌‌for‌‌scheduling‌  ‌
-Retrieve‌‌a‌‌process‌‌for‌‌scheduling‌   ‌
 ‌

b) In‌‌an‌‌empty‌‌B-tree‌‌of‌‌order‌‌3‌‌insert‌‌the‌‌following‌‌keys‌‌<10,‌‌20,‌‌30‌‌,40‌‌, ‌‌
50,‌‌5,‌‌15,‌‌25,‌‌1,‌‌2,‌‌7>.‌S
‌ how‌‌the‌‌B-tree‌‌diagrammatically‌‌after‌‌each‌‌key‌‌  
insertion.‌‌   ‌

Next‌‌delete‌‌the‌‌key‌‌40‌‌from‌‌the‌‌constructed‌‌B-Tree.‌  ‌

Question‌‌6 ‌ ‌ a) Reena‌‌wants‌‌to‌‌send‌‌a‌‌text‌‌file‌‌over‌‌the‌‌network.‌‌Before‌‌sending‌‌the‌‌file‌‌  
 ‌ she‌‌wants‌‌to‌‌encode‌‌it‌‌using‌‌some‌‌algorithm‌‌which‌‌needs‌‌the‌‌frequency‌‌ 
of‌‌all‌‌the‌‌letters‌‌in‌‌the‌‌file.‌‌Help‌‌Reena‌‌to‌‌find‌‌the‌‌frequency‌‌of‌‌each‌‌ 
letter‌‌using‌‌an‌‌AVL‌‌tree.‌‌    ‌
i)‌‌Give‌‌the‌‌structure‌‌of‌‌the‌‌node‌‌of‌‌the‌‌AVL‌‌tree.‌  ‌
ii)‌‌You‌‌are‌‌given‌‌the‌‌sample‌‌file,‌‌draw‌‌an‌‌AVL‌‌tree‌‌for‌‌the‌‌same‌‌and‌‌ 
print‌‌all‌‌the‌‌letters‌‌in‌‌alphabetical‌‌order‌‌along‌‌with‌‌their‌‌frequencies‌‌   ‌
 ‌
‌Sample‌‌File‌  ‌
‌so‌‌i‌‌said‌‌yes‌‌to‌‌thomas‌  ‌
   ‌
iii)‌‌Argue‌‌that‌‌the‌‌time‌‌complexity‌‌of‌‌finding‌‌the‌‌frequency‌‌of‌‌letters‌‌in‌‌ 
a‌‌text‌‌file‌‌is‌‌linear.(‌‌2‌‌+‌‌8‌‌+‌‌3)‌  ‌
 ‌
 ‌
 ‌
 ‌
b) Specify‌‌which‌‌searching‌‌technique‌‌out‌‌of‌‌linear‌‌search‌‌and‌‌binary‌‌search‌‌  
needs‌‌a‌‌sorted‌‌array‌‌as‌‌input?‌‌What‌‌is‌‌its‌‌running‌‌time?‌  ‌
 ‌
Does‌‌Hashing‌‌guarantee‌‌search‌‌in‌‌O(1)‌‌running‌‌time?‌  ‌
 ‌
For‌‌a‌‌Hash‌‌table‌‌of‌‌size‌‌11‌‌that‌‌uses‌‌open‌‌addressing‌‌for‌‌collision‌‌  
resolution,‌‌h(k)‌‌=‌‌k‌‌modulo‌‌11.‌‌Construct‌‌a‌‌sequence‌‌of‌‌10‌‌keys‌‌to‌‌be‌‌ 
inserted‌‌into‌‌an‌‌empty‌‌hash‌‌table‌‌one‌‌by‌‌one‌‌such‌‌that‌‌for‌‌each‌‌of‌‌the‌‌  
first‌‌5‌‌keys‌‌there‌‌is‌‌no‌‌collision‌‌and‌‌for‌‌each‌‌of‌‌the‌‌last‌‌5‌‌keys‌‌there‌‌is‌‌at‌‌
 
least‌‌one‌‌collision.‌  ‌
 ‌
Name of the Course : Generic Elective

Unique Paper Code : 32355301

Name of the Paper : GE-3 Differential Equations

Semester : III

Duration : 3 Hours

Maximum Marks : 75 Marks

Attempt any four questions. All questions carry equal marks.

1. (i) Solve
xdy  ydx  x 2  y 2 dx.
(ii) Solve the initial value problem
 
x 2  y 2  x dx  xy dy  0 , y(1)  1.
(iii) Solve the initial value problem
dy
x  y  y 2 log x , y (1)  1.
dx

2. (i) Find the orthogonal trajectories of the family of curves 3xy  x 3  a 3 , a being
parameter of the family.
(ii) Find a family of oblique trajectories that intersect the family of circles x 2  y 2  c 2
at angle 45  .
(iii) Solve
dy
 e x y  x 2 e x  y .
3

dx

3. (i) Solve by method of variation of parameters


y   y  cos ec x .
(ii) Solve by method of undetermined coefficients
y   1.44 y  24 cos1.2 x .
(iii) Solve
y   2 y   4 y   8 y  0 , y(0)  1, y (0)  30 , y (0)  28 .
 
4. (i) Show that e  x , e 3 x , e 4 x forms a basis of the solution set of the equation
d3y d2y dy
3
 6 2
 5  12 y  0 .
dx dx dx
(ii) Solve the initial value problem
x 2 y   2 x y   10 y  0 , y(1)  5 , y (1)  4 .
(iii) Solve the linear system
y1  2 y1  5 y 2
y 2  5 y1  12.5 y 2

5. (i) Find the partial differential equation arising from the surface

z  xy  f x 2  y 2 . 
(ii) Find the general solution of the partial differential equation
u x  2 xy 2 u y  0 .
(iii) Apply the method of separation of variables u( x, y)  f ( x) g ( y) to solve
y u x  x u y  0 on u (0, y )  y 2 .

6. Reduce each of the following equations into canonical form and find the general solution:
(i) u x  u y  u, u ( x , 0)  4 e 3x .
(ii) u xx  6u xy  9u yy  3 y u y  0 .
(iii) u xx  3u xy  2u yy  0 .
SET A
Unique Paper Code: 72032801
Name of the Paper: English A
Name of the Course: AECC
Semester: 1
Marks: 75
Time limit: 3 + 1 (One hour reserved for downloading of Question Paper, scanning and
uploading of Answer Sheets)

Instructions

Attempt any Four Questions.

All Questions carry equal marks.

Answers to be written in 400-600 words wherever applicable

Passage from Om Prakash Valmiki’s Joothan, an autobiographical account of his experience of


growing up in a village as a Dalit in the newly independent India of 1950s. Valmiki is an
engineer by profession. He started writing his memoir in 1974.

Frightened, I picked up the three-day-old-broom. Just like me, it was shedding its dried up
leaves. All that remained were the thin sticks. Tears were falling from my eyes. I started to
sweep the compound while my tears fell. From the doors and windows of the schoolrooms, the
eyes of the teachers and the boys saw this spectacle. Each pore of my body was submerged in an
abyss of anguish.

Just then my father passed by the school. He stopped abruptly when he saw me sweeping the
school compound. He called me, „Munshiji, what are you doing?‟ Munshiji was the pet name my
father had given me. When I saw him, I burst out sobbing. He entered the school compound and
came towards me. Seeing me crying, he asked, „Munshiji, why are you crying? Tell me, what has
happened?‟

I was hiccupping by now. In between my hiccups, I told the whole story to my father: that the
teacher had been making me sweep for the last three days: that they did not let me enter the
classroom at all.
Pitaji snatched the broom from my hand and threw it away. His eyes were blazing. Pitaji who
was always as taut as a bowstring in front of others was so angry that his dense moustache was
fluttering. He began to scream, „Who is that teacher who forces my son to sweep the school?‟

Pitaji‟s voice echoed through the whole school. All the teachers, including the headmaster came
out. Kaliram, the headmaster, threatened my father and called him names. But his threats had no
effect on Pitaji. I have never forgotten the courage and fortitude with which my father confronted
the headmaster that day. Pitaji had all sorts of weaknesses, but the decisive turn that he gave my
future that day has had a great impact on my personality.

Pitaji took my hand and started walking towards our home. As he walked away, he said, loudly
enough for the headmaster to hear, „You are a teacher…So I am leaving now. But remember this,
Master, this (Dalit boy) will study right here…In this school. And not just him, but there will be
more coming after him.‟

1. Read the passage above and answer the following questions:


a. Why is the narrator in tears? (2)
b. Why is the narrator‟s father angry (2)
c. What happens once the narrator‟s father screams? What does the reaction of school
authorities tell us? (3)
d. “This (Dalit boy) will study right here...in this school.” Do you think Pitaji was
successful in his promise? Which sentence in the passage reflects how the narrator
changed after that day? (3)
e. Paraphrase the above passage in your own words. (8.75)

2. Imagine that instead of insulting Pitaji, Kaliram the Headmaster had called Pitaji to his
room to talk to him about what had happened to his son. Write a dialogue between Pitaji
and Kaliram in which they talk about the rights of Dalit children to be educated.

3. Om Prakash Valmiki, the author of this autobiographical extract, goes on to complete his
education and become an engineer by profession. Write a public speech that he gives to a
gathering of school headmasters and teachers in which he talks about his experiences as a
young Dalit student, and stresses on the need for change in educators and social attitude.
4. You are a journalist and have been sent by your newspaper to do a sting operation on
rural schools, and you see a young student crying and sweeping the school. Write an
interview with the student for your newspaper.

5. Write a letter from Pitaji to Kaliram telling him why it is important for the future of the
country that his son should continue to study in this school, and many others like him
should also study there.

6. As part of an NGO you are conducting a survey of caste discrimination in schools today
as compared to the 1950s. Write a report of your findings and your proposals for action
to the Director of the NGO..
Course : B.Sc.(H) Computer Science
Semester : III
Paper Title : Operating Systems
Unique Paper Code : 32341302
Admission Year : 2019 onwards
Max. Marks : 75
Time : 3 hours

Instructions for students:

● Attempt any 4 questions.


● All questions carry equal marks.

Q1.
Suppose that a disk drive has 6,000 cylinders, numbered 0 to 5999. The drive is
currently serving a request at cylinder 2350, and the previous request was at cylinder 8
1800. The queue of pending requests, in FIFO order, is:

2069, 1212, 3296, 2800, 244, 1618, 3856, 1523, 965, 3681

Starting from the current head position, what is the total distance (in cylinders) that the
disk arm moves to satisfy all the pending requests for SCAN and C-SCAN disk-
scheduling algorithms? Show all the intermediate steps.

Consider a disk drive with 10,000 cylinders. Suppose that 50 percent of the disk
access requests are for a small set of cylinders between 100 and 800. Which of the
following algorithms will take greater advantage of the given situation? Justify your 6
answer.

a) Shortest Seek Time First (SSTF)


b) First Come First Serve (FCFS)

Which of the following instructions should be privileged? Give reasons.


4.75
a) Modify entries in the open-file table.
b) Read the clock.
c) Access I/O device.
Q2
A given operating system operates in the user and kernel mode of operation. What is
6
the mode of the system at the following points? Justify your answer.

a) Boot time
b) When the printer generates “Out of paper” error
c) When the operating system gains control

Consider a process (id= 2256) creates a child process (id = 2257) and child process
further creates a child process (id= 2258). What will be output at statement (1), (2) and 5
(3) along with the process generating this output, for the code given below:

int main()
{
int id1= fork();
cout<<id1; // (1)
if (id1==0)
{
int id2;
id2= fork();
cout<< id2; // (2)
}
cout<<id1; // (3)
}
A computer system with a 32-bit logical address and 4-KB page size supports up to 4
512 MB of physical memory. Consider a user process that accesses the entire physical
memory. How many entries will be there in a conventional single-level page table.
How many entries can exist in a two-level hierarchical page table? Justify your
answer.

A process P is allocated n frames in the memory (initially all empty). The process
page-reference string has length q; n distinct page numbers occur in it. What is the 3.75
lower bound on the number of page faults? What is an upper bound on the number of
page faults? Justify your answer.

Q3
As a process executes, it changes its state. The state of a process is defined in part by
4.75
the current activity of that process. Draw a process state diagram.

A process P changes its state as mentioned in the table below. Perform the following-

a) Identify each state of the process P (S. No. 1-5)


b) In the process diagram, mark each state of the Process P (S.No. 1-5).
S. No Current Activity

1 P arrives in main memory

2 P starts execution

3 Process Q preempts P

4 P resumes execution

5 P needs to accept some input from user

Consider the following code, for creating a child process using fork( ) system call.
Mention the value of ‘a’ printed by each process at statement (1), (2) and (3). Explain
your answer with the help of a parent-child tree diagram. 4

void main( )
{
int a = 7;
int pid1 = fork();
if ( pid1 == 0 )
{
a++;
cout<< “value of a is” <<a<<endl; // (1)
}
else
{
int pid2= fork();
if (pid2==0)
{
a--;
cout<<”value of a is”<<a<<endl; // (2)
exit(0);
}
}
cout<< “value of a is” <<a<<endl; // (3)
}
10
Consider the following set of processes with the burst time given in milliseconds.

Process Arrival Time Burst Time

P1 0 30

P2 5 22

P3 10 15

P4 15 5

a) Draw a Gantt chart for SRTF (shortest remaining time first and Round
Robin ( time quantum q= 10 ms ) based CPU scheduling algorithms.
b) Calculate average turnaround time and average waiting time for each
algorithm.

Q4
Find the number of unique threads created at statements (1), (2) and (3) each, as
4.75
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)
fork();
thread_create(...); // (3)
return 0;
}

State True or False: 2

a) The child process is known as a zombie process when its parent terminates
before it.

b) init() is the parent of those processes who do not have a parent.


Consider a printing resource having 5 non-shareable instances which may be required 6
by many processes simultaneously. Synchronize the usage of this resource with the
help of a semaphore S.

a) What type of semaphore will be required for this purpose?

b) How will the synchronization be achieved if six processes want to use this
resource simultaneously?

Consider a system with 4 types of resources R1 (2 units), R2 (2 units), R3 (2 units), 6


R4 (2 units). A non-preemptive resource allocation policy is used. Three processes P1,
P2, P3 request and hold the resources as follows:

Process Requesting Holding

P1 1 unit of R1 1 unit of R3, 1 unit of R4, 1 unit of R2

P2 1 unit of R2 1 Units of R1, 1 unit of R3

P3 1 unit of R3 1 unit of R1, 1 unit of R2, 1 unit of R4

Draw a resource allocation graph and identify the possibility of any deadlock in the
system. Give reasons.

5 9+1
Given memory partitions of 150 KB, 400 KB, 250KB, 300 KB and 650 KB (in order),
how would each of the first-fit, best-fit and worst-fit algorithms place processes of 224
KB, 405 KB, 98 KB and 500 KB (in that order)? Which algorithm results in least
external fragmentation?

Assuming a 2-KB page size, what are the page numbers and offsets for the following
address references (provided as decimal numbers) 5

a) 3089
b) 32095
c) 235201
Consider a paging system with the page table stored in memory. 3.75

a) If a memory reference takes 150 nanoseconds how long does a paged


memory reference take?
b) If we add a TLB and 77 percent 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 zero time, if the entry is there.)

6 5+5
Consider the following page-reference string:

1, 2, 3, 4, 5, 1, 5, 6, 7, 1, 2, 4, 7, 6, 3, 4, 1, 2, 3, 6
How many page faults would occur for the following replacement algorithms,
assuming three frames? Remember that all frames are initially empty, so your first
unique pages will all cost one fault each.

a) FIFO replacement.
b) Optimal replacement.

Consider the following segment table: 5

Segment Base Length

0 200 446

1 2122 15

2 88 222

Compute the physical addresses for the following logical addresses?

a) 0, 336
b) 1, 11
c) 2, 400

Consider a virtual address space of four pages with 1024 bytes each, mapped onto a 3.75
physical memory of 64 frames.

a) How many bits are used in the virtual address?


b) How many bits are used in the physical address?
Unique Paper Code : 32343307
Name of Course : B.Sc. (H) Computer Science (LOCF)
Name of Paper : Programming in Python (SEC)
Semester : III
Year of Admission : 2019

Duration: 3 Hours Max Marks : 75

Attempt any FOUR questions.


All questions carry equal marks.
You must document your code properly for full credit.

Q1. Write a Python function check_Eligibility(n) which accepts an argument n. It displays a


message ‘Proceed for Printing’ and returns ‘True’ in case n is a prime number less
than 29, otherwise it displays ‘Sorry’ and returns ‘False’.

Write another Python function displayPattern(n) which accepts an argument n. It calls


check_Eligibility(n). The function displayPattern(n) displays the following
pattern with n rows, only if the function check_Eligibility(n) returns ‘True’, otherwise
it displays ‘Pattern Not Possible’ and exits from the function. For n=5, the pattern will
generate 5 rows as given below.

A
B*B
C *** C
D ***** D
E ******* E

Q2. Consider the following strings:

str1 = “Ronald Brown”


str2 = “Richard Brown”
str3 = “Harry/* Potter% is ^a fictional !! character-&”

• Write a Python function append_Strings() to create a new string, str4 by appending


str1 and str2 without using in-built Python functions.
• Write Python code snippet to arrange the characters of str4 so that all lowercase letters should
come first. Also, find all the occurrences of substring “row” in str4 ignoring the case; without
using in-built Python functions.
• Using an in-built Python function, write a statement to remove all the special symbols from
str3.

Page 1 of 4
Consider two lists List1 and List2 as shown below.
List1= [5,10,15,20,25,30,35]
List2= [10,20,30,40,50,60,70]
• Write Python code snippet to add a new element 40 after 35 in List1. The modified List1
should be
List1 = [5,10,15,20,25,30,35,40]
• Write a Python function that appends the elements of List1 into List2 and returns the
appended list as
List2 = [10,20,30,40,50,60,70,5,10,15,20,25,30,35,40]
• Write a Python function to remove all the duplicate values from the list List2.

Q3. Consider dictionary Dict1 that represents vehicle models and its number available in a company.
For example, Dict1 is defined as follows:

Dict1 = {‘BMW’ :5, ‘Mercedes’: 10, ‘Volkswagen’: 10,


‘Jaguar’: 4, ‘Landrover’:15}

• Write a Python function Model() that accepts Dict1 along with a vehicle model. It returns
the number of vehicles available for that model. If the model does not exist in Dict1, then it
should return a value of -1.

• Write a Python function Change() to accept Dict1 along with a vehicle model ‘VM’. The
function should return the updated dictionary Dict1 as follows:

o Case 1: if VM exists in the dictionary and the number of models corresponding to VM


is less than 5, then VM should be removed from the dictionary.
o Case2: if VM exists in the dictionary and the number of models corresponding to VM
is greater than 5, then decrease the number of models by 2.

Consider the following tuples:


Tuple1 = (11,22,33)
Tuple2 = (99,88,77)

• Write a Python function to swap the values of Tuple1 and Tuple2. The expected output is
as follows:
Tuple1 = (99,88,77)
Tuple2 = (11,22,33)

• Write a Python function Div3and5() that takes a 10-element numeric tuple and returns the
following:

o sum of elements which are divisible by 3.


o sum of elements which are divisible by 5.
o sum of elements which are divisible by 3 and 5.

Page 2 of 4
Consider the following sets and give Python code snippets for each of the following:
set1 = {10, 20, 30, 40, 50}
set2 = {30, 40, 50, 60, 70}

• Display common elements in set1 and set2.


• Display a new set of elements such that the elements are present in either set1 or set2 but
not in both the sets.

Q4. Write a Python code snippet to read a text file, ‘file1.txt’, line by line. For each line read
from ‘file1.txt’, split the text into words and count the number of characters and vowels in
each word. Write each word along with its character count and vowel count separated by a question
mark(?) in file ‘file2.txt’; with each word and its corresponding character count and vowel
count in separate lines. Display the contents of ‘file2.txt’on the console.

Handle the exception if ‘file1.txt’does not exist.

For example, the contents of ‘file1.txt’are as shown below. Python code snippet should create
‘file2.txt’ having contents as shown below:
“file1.txt” “file2.txt”
Hello World Hello?5?2
Python is interesting World?5?1
Python?6?1
Is?2?1
Interesting?11?4

Q5. Write a Python program that accepts a list Number_List as input. Ensure that user enters numeric
values as input in the list. Take an input Num from the user to be searched in Number_List.

• Define a Python function SortAndSearch() with two arguments as Number_List and


Num. Use linear search in SortAndSearch() to search given number Num in
Number_List. Also, SortAndSearch() displays the position of Num if it is found in
Number_List otherwise displays the message ‘Number is not found in the
list’.

• Use insertion sort in SortAndSearch() to arrange the elements of Number_List in


ascending order. SortAndSearch()should return the sorted list along with the number of
comparisons required for sorting. What changes are required to arrange the elements of
Number_List in descending order?

• Consider Number_List = [2 15 5 4 12] and Num = 4. Show the changes


in Number_List after each iteration in SortAndSearch().

Page 3 of 4
Q6. Define a class Product that stores information about products manufactured by a company. The
class should contain the following data members:
• name–Name of the Product
• material– Material with which Product is made of ‘Metal’ or ‘Plastic’.
• costPrice– Cost of the Product in rupees. Include assert statement to ensure that the cost
is between 25 and 250.
• discount– Deduction in cost of the Product. It is equal to 20% of costPrice if the
material is ‘Metal’ and 10% for ‘Plastic’.
• count - number of objects created for Product class. Add appropriate statements in the code
to increment the value of count by 1, when an object is created. Use assert statement to check
that count is always greater than equal to 0.

The class should support the following methods:


• _init_() for initializing data members.
• sellingPrice() which computes and displays selling price where selling price is calculated
as difference of costPrice and discount
• display() which displays the information about the product.

Also write Python statements for the following:

• Create a product ‘Plate’ of ‘Metal’ having costPrice as 170. Display the value of
count.

• Create a product ‘Spoon’ of ‘Plastic’ having costPrice as 26. Display the value of
count.

• Compute and display the selling price of ‘Plate’ and ‘Spoon’. Display the value of
count.

Page 4 of 4

You might also like