BS Computer Science 3rd Year A21
BS Computer Science 3rd Year A21
Ouortioqf 2 (4 orch)
Glve short rurwers to thc foltowbg
guatloar:
a)Briedyexptain&ecb,Iffiisticsodworkiagprinaipleoftime'strringsystc$'
;; d;it "'"tt*"I machine anduihat arc itsadvantagcs?
.! WUt it u tytt", call and how itworks?
ii u*sr*r"tcriticalsectiosandcriticalscaionproblmofcoapr*iugproccsses'
aew ptocess?
;i frn"l " iJ, no* tn rl*ua or"rnn* is difre*Dt fron spawning a
Ouet$ou#3
AIso discuss rlifrrcnt statas of a
** prccass and oplaiu the proocss wation mcchsnim" (10)
") Prooess' -o0).
----^-^ ^^**r,riaatiam
eosa{oic$iee'
ils.trss ihc n!$od&.4whanism" gsd.toolr of
intcr-ptocess
tl
Ocs$ictl cpu bu$t givco in nllisocords: (20)
tn"
ffi"oo*, sct of proccss€s, udth tho re,ng& of
Orstlon# 5
by initializing I sctn+horE with 0, I
or n? what
a)
- what is a scmapbore? whd cau be achicved wait and sigDal operatio*' (10)
probtcms may oc",,, ao. tfrr#g;6"I#;; p*.**;tf
P.T.O.
Page 1 of 2
b) &nsidpr&s sryflhoi of*ryffi, A-ltB=l6C=I2,D-10 o0)
Procerr Xr:r llloErtLsn ' Icad .tra!.Irblr
ABCD tscD }BCD lSCD
PO 8d62 2420
PI {68{ 4220
P2 6424 {2A2
P3 4864 04{2
P4 4642 2A20
Aniu,sr th foltowlng qrmtims u\S Batcr's Agorithm:
i)q/hat ts &c coffsnt
ofthe msix nsd?
i0 h tLi sy$tom ina safa shb? rycq ft{n u,trt fu the safo sc$onse? shwyuu rrcrk
iii) Dctermino u/hcfure€ fouowing requmcos arc safc oruof?
PA P3, P4, P0,pl; p3, pdP0, F2, p4; y2,tq&, Hl,Fl;
Oucrthr #6
ry
a) wbat is a pago tbls md rryhat are ttr advantrgcs of pgd &Gmory systcm? Bdcfly cqla;n thc
strtrhrc ofhicranhi,oal md inrurid page hble.
b) Consid$r a logicat ad&css of 36 bib udlh 256 cegnmrs perproffis md apege size of 4I(8"O0)
Tho
aailablcRAM is of46B. Firdlhs$mbcr ofpagxparqncof, maximumproocs
dm, rnmtmu*
sgnrcnt sizs, fomatof logical adihcss md fonratofphysical addrc$s. (j)
c) coruidcn a sSrsmm wi& 4&bit logical ad&css ryrcc t* ;ryprrtr sKB pgs sizs. Armil*tc phnBical
mcmory i8 64G8" A€rafir{E systm runnfutg on ttris syrem usod iol,orted page
table and supeort
pagchblcsizc. d
32{it prroess IDs. Calsulsc the nrmber of bir ro$rird for p, d f. Alsooalcutatc thc pTEs and
(S)
Page 2 of 2
UNIVERSITY OF THE PUNJAB "., RottNo. in Fig...........
W I vsr :
I rr" s Year
B.S. in Computer Science' Third ' nrrrrvs' -v- ' '..'t.Roll
Annual-2021 No. in words. .rrr....r,,r
subject: operating systems
Paper:12 Time: 30 Min. Marks: 20..
onlv.
Qi:rision gf marks is qiven in front of each question
will be collected back after exoirv of time timit m"-"ti.
Q.l. Encircle the right answer cuffing and overwriting is not altowed. (20x1=201
1. Switching the CPU to another Process reguires to savc state ofthe old proccss and loading new
proce$s statc is calld
A. Conteirt Switoh B. Process import C. flocoss eryort D. Proccss srritch
2, In ope,rating system, cach proccss has its own
A. Address spce B. Open filcs C, Stat6 D. All of thc memtionod
3. The state ofprocess aftcr it is submittcd h tbe main memory is state.
5. ltrlhich of the following schedulcr is invokcd whcn aproc€ss is s*appd out of main memory?
A, loagtermscheduler C, Medium tcrur schduler
B. Shorttcrm scheduler D. AII ofths grvm
6. If all proccss€s sre CPU bounq &e ready queirs will almost always be . , and the short-terrr
scbeduler will have a to do.
12. Which of ttre fotlowing may not be the reason of failurc of the fo*0 system call?
14. If semapbore is being used for mutual exslu$ion problem, &en it must be initializBd by
A. one B. Zsrc c. Any positive integer D' None ofthe given
-.
t$. An rm-intcmptible operation is knoqm 83
A. Single B. aromic C. statis D. mism
1?. In fixcd sized partitiorL the dc$cc of multi pgramming is bounded by tlrc
A. CPU C. Nr:mber of Wtitions
B. Memory size D. Partitionsize
18. The mechanism that brings s Fagc into momory orly u&cn it is n€edd is called
A. Segmerrtation C. PageReplacemeirt
B. Fragrnentation D. DemandPasug
entry size of trn'o
Ig. A computer system has 48-bit logcal addrws, page size of 4KB, and pagc table
bytss. lVbat will bc the pagc tsblc sizc?
A. 2'LBy&Bs B.2ll Bytss c.2& Byt€s D' 24E Bytgs
20, A computer systrm hos 36bit logical address with a page size of 4KB. The
maximum numbs of
pages I procoss can have i$
A. Ztz 8.2t6 C.zu D.236
-. Page 2 of 2
UNIVERSTTY OF THE PUNJAB
& B.S. in computer Science Third year : Annual_2021 I
Subject: Software Engineering paper:13
:
nollNo.
A. TESTING C.
BI.ACK BOX RISX MANAGEMENT
PEOPLE In 4.Ps?
B.S. in Computer Science Third Year : Annual-2021 aaaaaao aaaaa aaa a.a !
Subject: Database Systems Paper: {4 Time: 2 Hnr.30 Min. Marks:65
E-r C
E--r D
t, List all kcys (not supcrkeys)
2. consider frre decomposition into{ rcrations: (AE[O (ABEC) (AD) (cB. Is 0ris
decomposition in (cirsle all &atappty):
a.BCNF
b.3NF
c.lNF
d. Noro ofthc abovc
3. Consider thc decomposition into 3 r,clstions: (AD) (EC) (ABEFH). ls this decomposition
in (circlo all that apply):
eBCNF
b.3NP
c.lNF
d. Nonc oftho abovc
modeling) process?
(b) I20 pointrf You are designing a databa.se for KW Humane Society. The result
is the following s€t ofrelations where ttre type of each relations attribute is
giveu followingthc ateibute (e.g., ID: integer):
wher€
(r) The primrry keys am undcrllnod'
(b) Animals rtoro tnt**Jon aboutthe anfunalc
cwrotly at the Humans Socicty' Each is
(attributf
ttrc sIN of thoir provious ownors
given an ID, rnct tr,ui, n.mu, tog.*.r wittr
is rccordcd. $pe re&rs to fie typo of mimal (dog;
Frevgwner), and thoir date of imission
cat, *c).
(c) Adoptar is the relation that holds infsrm*ion
$out animd adopters' The attributes are
number of otlrsr animals thlt ttte
sclf{cscriptiv& exccpt oth€rAnirnlls I'hich rgcofds tlre
adopter cunurtlY has at home' lo
Animals' Simil*ly, $lN in Adopt'ronrcfrs
(d) AnimallD in eOop6oli ,uferst' thG ID of implilttd
nrmrbcr on Su mienochip drrt b
&. SIN of A&ptor. emi6re.iipNo etom drc this casc the
on ttrc anim*l fortmcking, Orncr
in Aninsls rsfcrsto thc SIN of Adopter {in
prcvious adoPtcr).
(b) course
;"rH;;u*tili*to, titlc, cnedits, svllahs, and prcrequisiteq
seAion numb' insfuotor(s)'
ofreringS, inctgding coprso oumtsrr yor, o*oto,
stude'nt'td nsme' and pogram; and
timingS, and classroo;; ft) students, including Further'
name,, dFpartrn€ot ard title'
(d) instructoo, in haiogiintification nwnb€rr
cach soursc
and gnde swsrdd to studonB iu
the enmllment of snrdents in corscs for
modeled" Constnrct an E;R diagram
they re €Nnollod fo, *urtbe appropriately
the rcgistrar's office.
Describedifkrenttyp€sofmomalythatcanarisefor&istahlewithexample
records.
Page 2 of 2
UNIVERSITY OF THE PUNJAB ',. RollNo. in Fig. ..........,....,..!..
B.S. in Gomputer Science Third year : Annual-2021 '.'..RollNo.
Subjecfi Database Systems in Words.
Paper: 14 Time:30 Min. Marks: 10'.
r.Signature of Supdt.:
Q.l. Encircle the right answer cutting and overwriting is not allowed. (10x1=10)
l. Which ono ofthc following is a s* of onc or mors sttrlbutss tskco oolhctively to unigrrly
idendfy arccord?
a)Candi&tckcy
b) Sub kcy
c) Superkey
Ofodgrkcy
2. Ttc-condition allows a gurcral pcdicarc over thc rclrtions beingjoinod.
slOn
b)Usurg
o) Sot
d)Whcrc
3. SQL vicw ir sald to bc Watabb (drat is, lnserts, udatcs o &la* can be appliod ur tho view)
lfwhidr of thc following cordldsrs arp sadsfiod by tho qury dcfintng tlp visw?
a) Thc ftosr olausc has only sre dat boso relation
b) Thc query docs nohara a gnoup by or having claso
c) Thc rche clauso coftaLls only atuihrs ilamcs of thc rsldion lrd fu not hrve any
expusions, aggrtguos, r distinct spooification
d) All oftlc mcntiorrcd
4. Ttrc dcscriptiyc property pcsesscd by each entity set is
a) Entity
b)Attrtbuts
o) Rebim
d) Modd
5. Tha sfldhrtc rarrc could be smrcored ss an anribrae corining of fint name' middle initial, ad
Iaet nm. This type of alribtlc is called
e) Simpleanributc
b)Compoeitc atuibutc
c) Muldvalued atbibutc
d)Duiveduibutc
6. Ttts dEibutc AGE is calculatcd ftonr DATE Of BIRTI{. Tlrc atuih*e A6E is
a)Slrulcrshd
b) Multi valucd
e) Composite
d) Dcrived
7. Whichone ofthe following stcemena abo$ normal forrns b FALSE?
a) BCNF is striaer ttran 3 Nf
b) lacsless, dcpendercy -prcserving decomposition lnto 3 NF is always possiblc
c) l,oss less. dependency - preserving decompoeition into BCNF is always posible
d) Any relation wittr two attributes is BCNF
8. Th€ normal form which satisfies rnultivalued dcpendencies and which is in BCNF is
a)4NF
b)3NF
c)2NF
d) All of ttrc mentioned
9. Which of the normal form is basod on rnultivalued dependencies?
a) Firsr
b) Second
c) Third
d) Fourth
10. A_ is a qrry that r€uieyes rows from more than onc Ablc or view:
a) Stafi
b) Erd
c) Join
d) All ofthe mentioncd
aaaaaaaa"l"""t"'t
Q.2 suppoce ttrat you heve a ilct of i,000,000 gredec (ftom 016 to l0si6) on a
niuorilflld. !.ci, and you uant io prtthom ln or&r(eod ln my ordc). 6crgn m
a[orlfim that roilr thb lbt ln finear time {o(n). Ateo, fur@ yorr chotcr of
algorl{hm. tfonfl
Q.t Flll ln ttc iollourtng tabtc wtor eproprkt lnputl outsutt and runnirg tLnra
for each of $o iotlillng atgort0rru. p.f6l
Alsorlthm lnpul put TlmoGomploxlty
DF8
8FS
Krurkal
Pdm'r
DUkstra
FloydWaphall
Knapnck
Fractlonal
tlatrlx Chaln
I{uldpllcallon
.l .i
4/
Start here
ac
Page 2 ol 2
& UNIVERSITY OF THE PUNJAB ".. RollNo. in Fig.
W B.S. in ComputerScience Third Year: Annual'2021 '. Roll No. in Words'
Subjec(: AnalYsis of Algorithms Time:30 Min. Marks: 20'.
Paper: 15
\.
rSi
gnature of SuPdt. :
,ffi
i.A
ii.B
ifl. c
end E edgec, the eum of thc dagrcer of
,. h3, an undrrecbd graph G wnh v ver,ceg
all vertccr la
r.E
ll.v
iii. 2E
lv. 3/
-' t{hat ls tho oblecdvN of the knap*ctt-problsm??
9. The ltuapsack
i- T" C.ittl"xititu, Total Value ln
li.i;e"t iit"ltnum rotd v"tutln,The.Knapsack
In Tlp-l$apsack
iii.' ro o"t uottmum Weight
iu. fo O"t Mlnlmum wetgnt ln Ths !fuapsaclt
?
f0.Th.BlgThetrnota$on(Oloff(nlranr+n'llr
l. nr
il.rf
ili. tt'
lv. n
& UNIYERSITY OF THE PUNJAB
w B.S. in Computer Science Third Year : Annual-2021
Subject: Numerical Analysis Paper: 16
# 1 is compulsory'
' any FIVE in atl while Question
tt}fe, att".pt
Ail questions carry equal marks'
Quortion No l:
0 Ape0Btmf&.! root conectto tour rteclmal drcc olthe $nt ''5r-2 '!E!3U'' -rllmedcal
'qurdon
medrd.
QuordoaNo2:
fur $' ty6ttm of
a) c.lctlatc the irst thra. lEr.uont of Gaust{'ldd ms$od
gS'
At +3!+ 12" 4r + LLy 'qutdont
-r = 33
* -3y *22 -2O,
bl Wrlte .n .Eorlttm to solvo $e nonllnoar $hg r'$'lr falsl method'
'qutson
QrodorNo3:
construct r differance tablo 8nd d€tsmlne tlre or&r of the
mct.PProptiat€ polynomlal approximatlon to
iho $ven daa. x 0.3 0.4 0.5 0.6
ll Apprqlmate f(0.4O uslnS narton fururrd lnt'rpolttlon fiormule'
ft{muh'
Y !2 13 74 16
,il lppto,ot.t" iiOS6) u3ln8 neu,ton btskw'rd lntcrpol*lon
Quatlol No 4l
.
s1ngdp uslt€ slmpson,s 1/3 formula w 11klnS l, = 6 ard compare lt wlth th. e,6ct
a! rvahate ffi
vrluc. .
Querflor Nc 6:
Ure msdrod RX mGthod of ordor 4 with ,l = 0.5, IV = 4, to obtaln Bpprodmadonr to tie solutbn of tha
lnltal{olua Problem
yt -y -t2 tl, 03tsz, r(o) = 0.5
QuathlNo7:
D€fina dg.nvatirer, elgenvBto6 end rPe'tttl rtdlis d r mfri( A Compute
5) Wlrtir IHRAAM ?
0o) U-.talqaPtlJtr
n{an,5,g$toLlvt-e t L{t t c-g /g / tt $.-o, ttx! fW,P -t
W {$r*Li*, h f ,,=w ct7 *7 -t t74*lg/itut$,)Vtz
t$,<{*r,$;!grpa t7t7{e2ty>Vtt-3
ry',f,gi-el[crf -t t6$.s.{LL&,.tyut-+
|
7t 7{c-e[ut {,;,,V *, -t0 t6$1zt-s
Q. 2. tlow ahc Holy euran was prsorvcd by rhitd Csliph ltlznr Usurgr (Re)?
Page 1 ot 2 P.T.O.
Max. Marks:40
(20)
Discuss the Pakistan ldeology in the light
of the statements of the Quaid-e-
Q.1.
Azam Muhammad Ali Jinnah. '
f i' t/)tr
-4/-,v,,! rtdyt ,.t t! or' r i Lr,u t! I tr v {
Pakistan? (20)
o.2. Discuss the aims and objectives of the creation of
-,1/ct4,tv'ir)LodYSV rf lrr
(20)
Policies of Congress Ministries in
Q.3. Write a critical note on the Anti-Muslim
't937-1939?
-4,let 40/ ta;to Ltt jP t!(ts37 -t%ilL)i tu'd"fu :r/lrr
(20)
Q'4.DiscussthestrategicimportanceofPakistan,slocationintheworld,
- 1t ./,*..1o4 fig
ry' 6 odyu:V'
r
:rf )tr
Page2ol2