Professional Documents
Culture Documents
B.sc. (CBCS) Semester III 2021
B.sc. (CBCS) Semester III 2021
B.sc. (CBCS) Semester III 2021
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.
UniquePaperCode:32341301
NameoftheCourse:B.Sc.(H)ComputerScience
Nameofthepaper:DataStructures
Semester:III
Yearofadmission:2019
Duration:3Hours MaximumMarks:75
InstructionsforCandidate
Attemptanyfourquestions.Allquestionscarryequalmarks.
Q1 Writeaprogramtoimplementaticketreservationsystemforaparticularflight.
Theprogramshoulddisplayamenuwiththefollowingoptions:
1. reserveaticket.
2. cancelareservation.
3. checkwhetheraticketisreservedforaparticularperson.
4. displaythepassengerlist.
Usesinglylinkedlistforstoringinformation.Informationismaintainedin
ascendingorderofnames.
Isthereanydisadvantageifinformationisnotkeptinasortedway?
Question3
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
postfixexpression.
2+(((30-10)*(10-5)+15)/5)*(10-5)
Showthestatusofthestackateachstep.
b) Whatdoesthefollowingfunctioncompute?
intfunction(int*array,intsize)
{
inttemp=0;
for(inti=0;i<size;i++)
temp+=array[i];
returntemp;
}
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
functionwrittenaboveandanarraycontainingthevalues2,6,3,4,5,9,1.
Calculatethefirstpointfromwhereatruckwillbeabletocompletethecircle
(Thetruckwillstopateachpetrolpumpandithasinfinitecapacity).Expected
timecomplexityisO(n).Assumefor1-litrepetrol,thetruckcango1unitof
distance.
Suggesttheappropriatedatastructureandgivetheimplementationoftheabove
functiontocalculatethefirstpoint.Further,traceyourfunctiononthegiven
followingdata:
6petrolpumpswithamountofpetrolanddistancetonextpetrolpumpare
{3,5},{6,7},{4,1},{2,6},{8,3},{4,5}
Question5 a) AnoperatingsystemusestheNon-PreemptivePriorityscheduling
(NPPS)algorithmtoscheduleprocesses,wherein,eachprocessis
assignedapriority.Processwiththehighestpriority(priority1ishighest
priority)istobeexecutedfirstandsoon.Tiesarebrokenarbitrarily.
FortheNPPSschedulingalgorithm,whichofthefollowingdata
structures:-linkedlist,binarysearchtree,Binary-Heap;is/aresuitable
toaddaprocessinO(logn)timeandscheduleaprocessinO(logn)
time.Justifyyouranswer.
For t hechosend atastructureshowitscontentsasprocessesareadded
andscheduledasperthegivensequence.(showresultsaftereachstep)
-AddprocessP1(Priority8)
-AddprocessP2(priority4)
-AddprocessP3(priority3)
-AddprocessP4(priority5)
-AddprocessP5 (priority1)
-AddprocessP6(priority6)
-Retrieveaprocessforscheduling
-Retrieveaprocessforscheduling
b) InanemptyB-treeoforder3insertthefollowingkeys<10,20,30,40,
50,5,15,25,1,2,7>.S
howtheB-treediagrammaticallyaftereachkey
insertion.
Nextdeletethekey40fromtheconstructedB-Tree.
Question6 a) Reenawantstosendatextfileoverthenetwork.Beforesendingthefile
shewantstoencodeitusingsomealgorithmwhichneedsthefrequency
ofallthelettersinthefile.HelpReenatofindthefrequencyofeach
letterusinganAVLtree.
i)GivethestructureofthenodeoftheAVLtree.
ii)Youaregiventhesamplefile,drawanAVLtreeforthesameand
printallthelettersinalphabeticalorderalongwiththeirfrequencies
SampleFile
soisaidyestothomas
iii)Arguethatthetimecomplexityoffindingthefrequencyoflettersin
atextfileislinear.(2+8+3)
b) Specifywhichsearchingtechniqueoutoflinearsearchandbinarysearch
needsasortedarrayasinput?Whatisitsrunningtime?
DoesHashingguaranteesearchinO(1)runningtime?
ForaHashtableofsize11thatusesopenaddressingforcollision
resolution,h(k)=kmodulo11.Constructasequenceof10keystobe
insertedintoanemptyhashtableonebyonesuchthatforeachofthe
first5keysthereisnocollisionandforeachofthelast5keysthereisat
leastonecollision.
Name of the Course : Generic Elective
Semester : III
Duration : 3 Hours
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
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
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.‟
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
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) 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-
2 P starts execution
3 Process Q preempts P
4 P resumes execution
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.
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;
}
a) The child process is known as a zombie process when its parent terminates
before it.
b) How will the synchronization be achieved if six processes want to use this
resource simultaneously?
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
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.
0 200 446
1 2122 15
2 88 222
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
B*B
C *** C
D ***** D
E ******* E
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:
• 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:
• 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:
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}
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.
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.
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.
• 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