0% found this document useful (0 votes)
39 views25 pages

Sem3 Papers Y21

Uploaded by

rahul harpal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views25 pages

Sem3 Papers Y21

Uploaded by

rahul harpal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

LNMII1T

NMITB. Tech/CSEKore/2022 234DDCSF22/MT

Techncogy, Jaipur
The LNM Institute of Information
CSE226: Advance Programming
2022-23(Odd Semester
Mit Term Exam
aie: 27th September 2022 Time: 90 Mins
Max Marks: 50

C03 CO4 cos C6


Total Totat c01
uestions Mark Q1-5
50 03-10. Q5-6,
4-7 97-7 2-5
21/50= 13/50= 16/50
CO rcightage
42 26% 32%

Instructions:
. There are 7 questions. All the questions are mandatory.
h. Write all the sub-parts of a question at one place.
eMake and state assumptions precisely, as and when required.
d. All the notations have their usual meanings.

What do you mean by software? Discuss Custom, generic, and embedded software with
suitable exanples. 51
2 Discuss the Top-down and Bottom-up software development approach with suitable example. I51
An enployee ofthe company stays in a flat or a bungalow. It may be owned by company, employee
oF may be rented by either the company or the employee. The owner who let houses to company may
themselves be company employees. 1Tenant in a flat must pay society charges apat from rent while
bungalow tenant must pay additional water and electricity charges. Model the above sysiem using
UML techniques and draw the following diagrams. State your assumptions clearly. 10
(a) Class Diagram
b) Object Diagram
Explain Generalization and Aggregation with a suitable cxample. How to annotate these concepts in
the unified modeling language 5+2-71
What do you understand by instance variables? lHow they are dillerent froun reference variables.
plain the use of the statismethad.and staliëvatiable.with.a.suitableesanple. [11+2+2=6}
6.Write the short uotes on the followings:
al Stakehoiders
25-1t}
(b) Software Quality
() Feasibility Study
a) Encapsulation
(e Abstraction
LNMIIT/B. Tech/CSECore:2022-23/ODD/CSE222/MT LNMIIT
stetic hekeg

OnsideT the snap of code


given below and answer thefollowings
(a) what is the
output of the given code? 1+3+3-7
(6) Expiain the
evaluation process of all
E ow much nemory is occupied by thethree if stateienisS.
variables, declared in the program
Explal

ciass HelloWorld
public static void main(Stringll args)
String sl-"Sachin":
String s2-"Sachin"
String s3=new String("Sachin");
String s4-"Saurav";
if(s1=s2)
System.out.println("Hi");
if(s==s3)
System.out.println("Bye");
if(s3s4)
System.out.printin("Hi and Byye"):
LNMIIT
LNMIITAB. Tech./CSE/Core/2022-23/01D/KSE216/MT

Technology, Jalpur
The LNM Institute of Inioruation and Architecture
CSE216: Conputer Organiza izatíon
2022-23 d d Semester
Mid Term Exam Time: 0 Mins

2022 CO CO4
Max Marks: 40 Date: 29th September CO2
:
Total Marks
Totat 6.02-4.03-4,043.74 08- 4
QI6.
uestioS 40
Q5 6. Q6-9 8/40 20%
COweightage 32/40 80%
Instrueions:
AJI the questions are mandatory.
a. There are 9 questions.
at one place.
b. Write alt the sub-parts of a question
as and when required.
Make and state assumptions precisely,

machines by writing programsto compute


6 ] Compare 0- I- 2-and 3-address
X=(A+Bx C)/(D-Ex F) follows:
instructions available for use are as
For each offour machines. The 2-Address 3-Address
0-Address 1-Address MOV(X Y)
LOAD M MOV(XY)
PUSHM ADD (X=X+ Y) ADD(X=Y+Z)
STORE M
POPM SUB (X =X Y)
-
SUB (QX=Y-Z
ADDM =Y x2)
MUL(X=Xx Y) MUL (X Y/Z)
ADD
SUB SUB M DIV (X=
MUL
MUL M DIV (X =X/Y)
DIV M
DIV bit 4-bit registers. The 0-address
addresses or

M iis a 16-bit memory


address and X, Y, and Z are either 16 other two have 16 registers
and
machine uses an accumulator and
registers. With 8-bit opcodes and
the 1-address
machine uses a stack, memory locations and
on all combinations of need to compute X?
instructions operating
bits, how many bits does each machine
instruction lengths that are multiple of 4
reversed Polish notation expression:
following
2 12+2=4] Considerthe AB +C*D/EEE++4
notation equivalent?
What's the in-fix (our usual) the foltowing instructions
a. the expression. ASSume we have
b. Write a program compute
to the value of
Mul, Div.
Add, Sub,
available: push X, pop X,
address
addresses. Some instructions have one
has 16-bit instructions and 6-bit what is the maximumnumberof ome-address
314) A certain machineIf
and others havetwo. there
are ntwo-address instructions,
instructions?

4, 3}Consider thc following mejmory locations with the given contents


it
Lecation T00has number 101 in
Iocation 101has nunber 102 in it
LNMITT/B. Toch.SEC2D:13M1» S16 LNMIIT

iLocatio 102 has b e r i03


i
cation 0 has ntmber 14 in i
Locaion 104has unber 1W} in
What umber docseth of
the fsllowing lod tsttiern

.Losdindireet 10
Dut
sa that afl instructións can be imptemcnted nardware
le 4t eonyters ae
strtictured
iunaliy
Hein sonputrs are to ticeorn a kiitieg
h a t wouid ie the. henei(s) o using a two-address instruction
ofneation versus using rce-address instruction?
A
21 Progranis often link lo mmultipie DLlLs Would it not be efficient just put alf thO pCEderei

c big DiLL and then link o it?


6. 14239] Diferences between
a. proceiures/functions, co-routines, traps, and interrupts
b. Program counter vs instruction location
counter
Cnstrucion vs pseudy-iistruction vs macro

7 f41 Calculate the rale of instruction execution for a 2.5-GHz RISC processor that uses S-step sequence 10
eecute instnctions with following statistics.
Load 20%
Store 25%
Branch i5%
Computational instructions 40%
Assuie 80a fetch operations are completed in 1 clock cycle, the remaining 20% ferch operaticns are
compieted in 4 clock eycles, and on average. each access to the data operands of a Load or Siore
irstruction takes 3 clock cycles for completion.

1 4 2 2 ] Consider a processor with single-bus organization of datapath and proyide controB sighals for
Echstep to executefollowing instructions.
Add he contents of the memory location whose address is at memory location NLM to Tegister

b. Branch to subroutine: Call NUM, where NUM represents the ofiset value required tor compating
target address. Use a stack pointer to store the retunm address in inemory Assume that cach
insiction consisis ofiwo wonds where the first wordspecifiesthe operatiot and the addressing
Fode,and the seccnd word contains
the nun1ber NUM.
TA
LNMIIT/B. Tech./11 Sem/2022-23/EVEN/C;GE2

iNPORMATIONECNOLOY

INSTITUTE O NINEFRING
THE LNM COMPUTR SOENCE
1DEPABTMENT OF
ud Its Applications

CSE 228: Optimization Tethuiq


2022-202:3 Odd semester
Mid Torra Exanm
Aiaximil Marks 23
Time: 0 minutes {04:101-05:50PN}
Date: 30/09/2022
CO3 CO4 CO5
Total Questions Total Mark C01 CO2 Q1-4, Q2-2 Q2-4
Q1-1 Q3-6, Q4-f6
4 25 Q1-2 4%18/2572 % 4/25 =16
CO Weightage 2/25 8%T1/25

Insiructions
Answer all questions.
with proper justifications.
Write each and every steps while solving the problem

following LP Problem.
I. Consider the
basic ieasible
problen in standard form aud obtain the initial
the given optimization
a) Represent 2
solution.
4
) Optimizes it by using Two-phase Method.
to solve the given problem.
c) Justify why it needs Phase-II
Minimize Z= 3t1 + 2t2

i) 5 + r2101
(ii) 2 +2r2 212
ii) 4 a 1 2
. hree-shift hystom at, o ot tts plants, In a ceitau
2 Let there is production rompany t quired on aci tiue thre suifts is as otlos Th
section of the plant tle tumt f ipe
Namber of Operators
hift
Day (6 A.M to 2 P.M)
to 10P.M 24
Atternon (2 PM
Night 10 PAI to 6 P.M
the astk rate RS per hour inr tiOs working
Companypa s op iff othe day shii. Fr
night shifts, the rates T D
Dng ud
avrd Halt
tnlf t
the aftemoon and the rates tiies the b6sic ratéarit twice thc fiasie
rate respetively In agreenent with cnch operator at the connencement of his uploynee e i
alhd (H are as follows
allocated to oneof thee schenes A.B

A 1Work fou average) oue nigbt shit, o e o i l ait, ant two day shifis in very foar

shifts ancd afternoon shift.


o r k (one atrerage} equal nnber of day
Work day siifts only
In schemes A and B, it. is ecessary to work SEeIy alternating'sequences of sperified shists, urng
as the correct proportion of shifts is worked in the loug run.

a Forinulate a linear programming programmiig model to obtain the required number of operators
at the minimum cost.

b Convert the Primal problem into its Dual model. 2


Note: Write all steps while formulating the problem with proper justifications
3.Minimize Z 17+2r3 + u 412 Subject to

++F = 15
(1 2 2+2r3 = 20

, and rs 2 0 Apply Lagrangian Multiplier method optimize the given problem.

4.CConsiderthe function f{:) = t + 2at2 +1t2 --2

3 Determine the maximun and uinimu0


po (if any) of the funetion.
a Fid the ecessary condition and olbtain the
extreme point.
b) Conpiute tue Bessian Mlatrix and show
by the sufficient condition that
12AXIIAUIn/ MInitn at the extreme point. the functon OCcurs

****END***
LNMIIT

LNMIIT/B.Tech/IC/2022-23/Odd/MTH213/MT
Technology, Jaipur
The 1.NM Institnte of Inforali
Department of Mathematics
MTH213: Mathematics I i
2022-23 Odd Senester
Mid Term Exaination
Max.Marks: 30 Duration: 0 mins

Total Questions ate: Septomler 28, 2022


Totai Marks CO 3 CO
CO 1.6427-30-3
f o i Q 4 0 10
i 6 67% 20
CO-PO wighilage30 13,33
nexi t ,lhe (qustim alculato
11structions: There are toial eight yiestims, Marks awarded re show
to nkre au ielox slwins the qursbIO}Ne
W Ostily your statemita, is Uandatory

pg n b e r 0n the front tpage of vor answer sheet in the following fornat{the questiori nuiiber
without page iunber mentioned shall not be evaluated

Question No. 1 6 8
PageNo
xanine tie tiunction f(:) = 1z 3 for diltferentiability at z for all 2 E C

both in domain D. Show that fiz} must ye a


2Suppose f{:) and its conjugate S(:) are
analytic a

coustant throughout D
3. Verify that ulz.y)= Ary- r+3ey satisfics Laplace cquation for al (7,v). Furthior find harmonie
eunjugate of vir. y) aud find corresponding analytic function f(z).
4 Fimd tie largest tdonaiu ou whiclh f(z) = Log(;) is analytic and find the derivative f'() wherever
Cxists

5. F'ind all the oots of the equation cOs z = 2.


14
ti Fi the funetion f(:) = u{r, 0)+ie(r, 0) be analytie ina domain D that does not inchude the origii. Using
the Cauchy-Riemann equations in polar coordinates and assuming the coutimuity of partial derivaiives,.
show that, throughout D, the function u(r, 0) satisfices the partial differential equation
ur,0)+1u,(r,0) + us = 0,
wic is tie prltar form of Laplace's equation. Show that the fnction u(r, 0) = ** cos 26 is harnouie.
Hece iul its har mouicconjugate functiou and the correspouling aualytic fiuctiou f(#)

7 1et Che the citcke j - R{R > 1). deseribed in ihe counterclockwise dlirectioni. Usethe MI-inequality

T R+T
.

Eralute gyd: wlur Cis tihe paraboa 2 froru (,2)to (2, 8)


nd of paper
LNMIIT

LNMIIT/B.Tech/1C/2022-23/Odd/MTH213/pr
The LNM Institnte ot Iuformation
1echnology
Department of Mathematics Jaipur
MTH213: Mathenatics I
2022-23 0dd Semester
End Tera xamiiation
1Decoiber i, 2022 Duratiot:3 IIO1RS
Max,Marks: 50 Date:
TotalQpestionsTotal Marks COT CO2 CO3
14
Q-1 Q-2 -3,456,7(9,10,11,12
TO
CO-PO weighilage5 % 86 3 48%

Iistructions: Tlere aic total twelve qnestions. Marks awarded are shown next tothe question. (alcuiator
is not allowed. Justify your stafements. It is nandatory to make an index showing the questjon nurnb*
aud page mber on the ront page of your answer slect in the following format(the questiou number
withont page nunber mentioned shall not be evaluated):

Question No1
Page No.

rove tiat Arg( 2 ) = Arg(i) + Argl22) + 2nt for some n e{-1,0,1} 3 Marks

(Comsiuler the fnction f(:)= Show that f(z) satisfies the CR-Equations atz 0.1s
2 =0
tue functio difterentiable at z = 07 Justify your answer, 4 Marks]
3. Findl: 3 dz. where C is the right half of the circle C: (t) = 5e", st 4 Marks

. Fid ad the possible sevies expausions in powers of for the function f{:) = iz +3 the

iolioving donaius:
fa)D, fi<2}: (b) Da={:2< kl<3}: (0) D={::l=|>3}. 3 Marks}

5. Evaluate , wlhere C:al=5 with the positive orientation.i 4 Marks


6.Statethe Caiy 'sinequality for coutour iutegrals. Let a 0 b e a fixed uintber. If fis an entire functiou.
snd tlat )ot for all :; then prove that. f(2)2 for s0me coniplex uumber a 4 Marks)

t , n >0 4 Marks
7. Usn the residue ticory evaile H
ad the sjiutin of the equation uls + yhu t auly)u with the Caihy data o
Marks]
9Deeine the region i witclr ile pquation a 2w44 y j s iyperbolie. puabolie o
pfic. atit transfut the equation i th tespective gn tá its camiical ma 5 Marks
yekacit ukt,O} tia he trs z
wit the ititia tispiataneut í#,U) f(r) nnd initial i) i itingat tirrig f a t e . E
dispiacent 3 } 1on tie ituen m4inri (
Marks

r , } f i r t) I(rt et2
initiai value piobleni {IVPF
I Filid ti siutin ri ile foliow ing
.t
coT
( ,0) = a , u x ,0)
5 Marks
orTESatig
non-noniogeneous itial onitioi
C"osider the homogencous
wave equation with Furtyes.
Hini: the
d'Alembert's solution. Call soiution u(r,t
Solve it directly by using the
t VP (1)-(2. with ho110geneous
mitiál conditions orrestondng toIVP
equation
sidcr tie uon-lhonmogeneous wave Call the solution tlr. t). it
is easy to s e e
the Duhamel p1inciple.
I 2 Sove it directly by using
that u is the solution of thie IVP (1)-(2).
solution of the following initial-bountar
vde
method of separation of variaBbles, find the
12 Ug tie

U Upr , 0 < r 1 , t>0,


0Sr<l,
ul,0)= I-r
u(0.t)=u(1,t) 0 t0. =

5 Marks

End of paper
LNMUTB. Tech./CSECore/2022-23/0DD/CSE2i6a
6/T LNMIIT
The LNM institute of Inforaation Technology, Ja+pur Techiny
CSE216: Computer
CSE216: Computer Orga atiom ecnoloRy, Jaipuro
and Architecture
2022-23 Odd Semester
EndTerm Ea
Max Marks:80 Date: 5t Vecember 2022 Time: 3 Hours
Total Total CO1 C02 CO3 C04 COs
Questions Marks Q1-803-5- ,04 Q5-12 Q230

80 02 10
CO weightage 8/8010% 20/80=25 12/8015% 30/80 37.5%10/80-125%
Instructions:
a. There are 5 questions. Al the questiOnS are mandaiory.
b. Write all the sub-parts of a question at one place,
c. Make snd state assumptions precisely, as And when required.
d. Please do not escape any intermedinte step. No marks for only final answers.
18] Consider foliowing Algorithm to determinestudent's final grade:
Step 1: Start
Step 2: Take 4 integer inputs as marks in the 4 subjects: english, physics, chemistry, math.
Step 3: Then calculate the average based on above four marks.
math )/4
average (english + physics +chemistry +
Step 4: if the value of the average is more than 40., it will print grade aspass otherwise it showsfui.
Step 5: END
Design isA or an 8-bit accumulator based machine in term offollowing points, which can abBe toexecute
aboveslgorithm.Assume that 2048 bit memory isalsoavailable.
a. 16} Design expending opcode to represents at least all above instructions.
b. j2 Impiementabovementioned algorithm in above designed instraction set.
2. One computer system. composed of one processor (1 MIPS speed), one cache memory. one main memory.
one hard drive with DMA. All these devices are connected with one another using shared BUS which
transfers the data at 10 4S/byte. Information about all types of memoryis mentioned in table 1. Based on
the given datá answerthefoltowing questionswith proper justification.
Memory Size Speed Cost
Cache 5.bit 10ns/byte 1.0/byte
MM 10bit 10us/byte 0.1/byte
HDD each surface has 8 tracks, each 10 ms/sector, 0.0001/byte
track has 8 sectors, and each 50000/second
sectorstores 512 byte Seek time =3ms
a 4 f the storage capacity of RAM is 10%of HDD, what would:be the cost of HDD?
b. 16}1fcache hit rate is 90% and MM hit rate is 100% what would be the tolal time to execute one
program of100 byte
. 16 ff page updated/not-updated information requites:1 bit. access bontrol requires 3 bit, LRU
dati tskes 8 bit, cach index of pagetable takes 16 bit, and frame size is 512 byte what would be
the size olf page table of a 2048 byte program.
u il0j fthe clock period is 10 ns, howmany cloek cy cleswill be stolen by DMA incase of page
fat with data bufier.
e f14 Let suppose we have an array.A 12I2| which i18 stored-int a memory, compósed of two
nolule, in column najor order. Compare the performauce of interleavcd memory with non-
inerlvaved memory in case of cache miss. Assume each atray element takes one byte.
LNMIITB. Tech./CSE/Core/2022-23/0DD/CSEZI0
16ET
LNMIIT
3. 5-3+21 An instruction Add Rsre. RdstaddressiXCeutedin two ditfererntWapefydiretsderregister
direct and register indirect as Iwodifferent Ssing modes for the first operand. For a processor with
single-bus organization of datapath. prov sets of cntrol signats required for executing the
instruction in given addressing modes and CrCuit using basic iogie gatcs to generate the MAR in
control signa.
4. 15 4+7+ 4A microinstruction sequeneeBtiVen in the tollowing figure wherë mieroinstruction B
is followed by C. D. F, Ior K, depending onDlus b. bs. and bs ofthe machine instruction register
Implementmicroinstruction sequencing in the toowing throc possible ways.
a. Use microprogram counter and brancn nicroinstructions of the following fom to impiement
sequencing of the microinstructions.
fbobsby branch to
Where b.bsba is the branch condition au

X is the branch address.


b. Same as part (a) cxcept that the brancn
microinstruction has the following formi
Branch toX OR
Where X is a base branch address and the
1
vaiue of the mieroprogram counter
further modified by performing bit-ORing
ofbebsb with the appropriate bits within X.
Also, explain the concept of wide-branch
addressing through your implementation. next microinstruction
CUse an additional field in each microinstruction which specifiesthe address of the
andhas the capability to perform bit-ORing
5. 12 4+4+ 4} Answer the following questions
a. Consider a 4-stage pipeline processor. The number of clock cycles needed by the four instructions It,
12, 13, 14 in stages Si. $2, $3, S4 is showa below. Execute thegiven loop, represent all pipelining
stagesin ä diagram and calculatethe total number f clock cycles required for its successful execution?
S2 S3
For(i-1 to 2){
14: 13; 12 I:}

n an enhanced design of a CPU, the speed of a floating point unit has been increased by 30% and the
spocd ofa fiaed point unithas heen increased by 15%. Calculatethe specdup achieved iftheratio of
the number of floating point operations to the number of fixed point operations is 3:2 and the tloating
point operation usedtotake thrice the timetaken by the fixed point operation in the original design?
he lollowing assembly code is to be executed ina 3-stage pipelined processorwithhazard detection
and resolution in each stage. The stages areinstruetion fetch. decode and operand fetch (one or more
as reguired), and execute (including a write-back operation). Explain all possible hazards in the
execution ofthe code and use a mechanism to reduce the number of clock cycies required to execüte
thegiven code, assuming each stage takes 1 clock cycle to complete its work. Consider the first
operand of each instructionisrepreseniingthe destination where the computation result will getstored.
lnc R0
Mul Acc. R
Store RI Acc
Add hoe. R0
Store Aee
Marks 3] An 8 x inputs S4, d, a0d
I multiplexer has input A. B, and C connected to the selection1
=17= 0: 13 15 ; 1014D an 16
respectively. The data input i0 through l7, are as follows: 11
=
D. Analyze this system.
2. Marks 7=2+2t 3] Computer Arithmetic:
a. Convert-35.75 to its fhexadecimal representation in 1EEE floating point.
b.Whatis the decimal represented by hex number th40D09000, which is in IEEE 74 S1g
precision ormat.
3F200000
(X * Y) of following number (in hex): X= 41820000,Y
=
c.Evaluate multiplication
3 IMarks 6 3+31Implement
A left 3-shifter using s right 3-shifter.
b A 32-bit tree comparator using 4-bit module.
4 IMarks 1] Design XNOR gate using transmission gate.
. Marks 4} A sequential system has one input with values a, b, and c and one output with values p and q.
of b's. Write
The output is q whenever the input sequence has an even number of a's and an odd number
specification and implement the system using PSA.
6. Marks 31 Analyze the function performed by the following sequential network. Write its specification

considering 00 as the initial state.

CLK

7 Marks 8 2+ 3+3 A Sequential system takes one binary input and gives one binary output. Theoutput
at time t is I whenever xit-3,t)=0101 or 0110.
a. Write the specification of the system.
b Impiement the system using two JR flip-flops and one D flip-flop (for the most sigrniticant bit of
State).
mpleinent the system withadditional ouipui which is 1 whenever five occurrences of the
an

pattern (0101 or 010) are detected. {Hint:use a counter.}


8 Marks 3} Usingtwo mudulo-16 counters and gates. design a cournter with the following counting period
1,2 0,2,3 i0,3. 4,. 10 8.9. 10, 9, 10. ,

Marks 31 implement the fatowing switchirng functions using 8x4 ROM modules and, 4-input
4ultiplexers
Wab.cd.eonesct (0,3.7, 18, 20, 22. 26 30
X(ab.c.d.e) # one-set (1,4, 10.t1,23, 28,29)
a,6.c.d.c)- ofne-se (0, 9. 18.7. 20. 24,25. 30)
Z.b.t.d,s) ome-setí6, K1 3, 19,24)
2022-23/Odd/0nA artin4 0iy

THE LNM INSTITUTE


OF NFORMATION TECHNOLOGY
OP
DEPARTMENT OF INEON
COMPUTEH SCIENCE & ENGINEERING
Optimization Technigucs and Applicatios
End-Term Examination
Time: 180 minutes (03:30-06:30PM) Maximuu Marks: 35
Date: 06/12/2022

Questions Marks CO4 CO5


COL C02 C03
7
CO Weightage
35 Q-3 3,4,5,6,7 Q-3.4,5.6,7Q-3,4.5,6.7 O12
/35 11%{6/35 177/35 20%7/3,20% .
,

Instructions
1There are qUestions on 3 pages.
2. Al the questi018 àre mandatory
3 Make d state assumptions, as and when requirod.
4 Start cach answer fronn a fresh pagc.

. Attenpi all the parts of one question in one place.

6. Note. Calculator is allowed.

LQ1. Cousider the following optimization problem


Maximize Z =4r1+6it2 2?2x12-2.1
Subjcct to constraints
+2 2 and t1,.22 0
Apply Wolfe's modified method
(a Find the necessary and sufficient condition for the maximization of 2
() Obtain the feasible solution and maximum value of the give
Quadratic prograniming problem.

2SOve the fotlowing uadratic programuing prcbleni by using Wolfe's


modified method
Maxiinizo2 2 2
Shject to the.constraints
.fi 2a 3 6

Constmit 1he agrang funet,


and sutficieni conditio,
(s Fid thi pt iuat nstne Buinmivni d the nceessary
and
xim muni lue af
n valHe af the
tdie given obicetiw
given o t tunetsen
A

Algorithm
R3Gonory Cuttng Plane
(i) Solving the prouem by the sinplex netho Hoduens tie oitimal 1ah:au 1

erive tho
Clearly cutting
write
plane cistraint corp
thedetivatiot stes.A thn VAriable to
r row witBi i, nd esniete
ritges +S ihe
L 1atiloan

Basic Variables Current Valase

Table I ableau 1

a simplex tablean atter part (i). [Only oue iteration,


Drive the rext optimal
solution in forniot
i
not the complete solution.
number of master (juinbo).rolls, each 30 meters wide
A p8per marhine can produce an unlimited the problera find
Foruulate to
QA. the talble 2 must be
cut.
in quantities given in that the' demand is
3type8 l papers product rolls fron1 the master roll, such
for making
a n optim of patterns
set
an objective fiunction,
minimized. Define
DecISion variables, and constranmts
satisted and waste is 4
clearly
S.No. Width Number of items
10 15
5 60
120

Table 2: Cutting Stock requirements.

the eity into


its outlets in Jaipur. The company divides
Q8 A food delivery company wants to open in each region.
wants to provide a 15-ininite delivery guarantee
7 di-rent. regions. The coupany in tablë 4 The cost of
Delivery time from an outlet in a regioniinto regionj is given an
in the cell (, j)
Forinulate integer programming problenm t
pening an outlet in the: rogion is gven table 3..
RiDiIize 1lir rost of opening the outléts.

Region12 34567
Cost 0 G3035 S0 45 90
e

Table 3 Outket co8

Deining Consttaints.
Region1 2 3 4 5 67
0 10 18120 14 21 12
2 20 0 13 22 11 30 20
3 13 220T9 24 2712
826
18 12 19 020 1110
4
5 25 10 30 27 0 25
1423 7 12 200
10 0
1 289 28 14 25
Tabla 4 Time

D
(e s(T2,, constraints that the problem shoull
satisfy.
describe the
Define and concisely eonstraints to satisfy the folowing
of crates from A to B. Forimulate 12
A COmpany takes 6 types
of type 5 and
conditions. least 5 Crates
be sent. OR At
1 and type 2 must
least a crates of tvpe
(a At
type 6 nmust be
sent.
4 is sent.
only if at least one type
3 c r a t e s can be sent problem. in Miller,
(b) Type to avoid
sub-tour
salesman problem 2
constraints in a four city traveling
17 List
Tucker, Zemlin formulation.
LNMIIT "
LNMIUTB.Lech StORE 20224DYCSE27 Th atsest

The 1NM stute ol fhformatn Fechnotngy


IDeparten: (
nformation and afaBsase lanagement SysiemstE22
Exam PyM: ENITER
M Maerke8i
,

Time: INM iinutes Date: 407/12/2022

C02 CO3 07-12.08-6


Total uestis Totnl arks
. e 1,04 0 8,6 8 y08, 10-7
8t
Q11-2
41/Zi 50o
7/80
78021 16/80 20%
Cweightage

trcions to Candidate
Ther are il questions. All questions are Compulsory,
will De given zero marks.
Answers w ithout proper expl»nation of sequence of
order questions.
Al ansers should be given in

Torsider i dalabase that includes (wo relations Student and Program.

Program
Siudent
Prog code | P_name
Roil ng F_naneLname Prog_code
0001 DSA
Aicia Smith 0001
0002 IDBMS
Alan Smith 0002

902 Alicia Bush 0001

403 3ohn Smith 0001

will return the following result? (3 Marks)


what reinional aBgebra expression

Fame ane P'rogram


-

Alicia Smah DSA


Snith DSA
oin

Sinas rdations k and S have# urples aid lupeEpEcveY, where ng1 and mi,n are positive integers. Give
nunber of upies in t e
ouovng operalions with coipiete justitication.
he mieimum ard axtnum 224Marks)
b RS
LNMIITT
LNMIITB. Tech CSE/CORE/2022-23/ODD CSE227/ET
foF shipping
their tocations
3. Consider the ER schema for a ship-tracking database to track tranisport ships. and keys. 1he
foltowin
and foreign represented ns
authorities. Map this schema into a retational schenna and specify all primaxyThey shoulid be
and.T2. 7 marks
sample reprsentation MUST be used. Suppose there are two tubles 11
T1 (al. a2, a3, a4)
PRIMARY KEY (al)
12 (bi, b2, al, b3, b4)
PRIMARY KEY (b1, b2)
FOREIGN KEY (al) REFERENCES TIal)

Ligitule
Latuke

HiSTORY
Ty onay Hu
PYHE
Cwner

HOAE FCHT

AConsider the following relational schema;

Sale(clerk, store, city, date, item#, size, color)


records that a clerk sold an item on a particular day
ltemitenm, size, color. price)
i records prices and available sizes and colors lor items

Nake the foliowing assunptions, arzd on/y tlese assiumptiors, ahout tilie reai world being modelled:
Each clerk works in one store.
11. Each store is in one city
A given iem ahways has thesarie price, regardBess of size or color.
iv ach item is available in one or more sizes asd one or more coors, and each item is available in al
conbinations dfsizes and colors for thet ite

Alernpt he ioflowing problens:.


au Based on the assurions aove und no others). specify an appropriae se of complcieiy Tomrvat
ftoietiomal iependencies for relatnrs Sale and Fem.
sed n the asunptions above (ant no uthersi, specify al kuys for relaions saie ang item.
rtionsste
s in BNE
ant lream in Baye-d Norinsl Fom faCNF? 1f nat, decompose the retstions sntaey
marks
LNMIIT/B. Tech./CSECORE/2022-23/0DDCSE27/
LNMIIT
Consder a disk With block size B512 bytes, A ock poiter is P6 bytes kans, sn a reemi p
byles kongA tile has r 30000 EMPLOYEE ecords offixed euth. The reeordsieis R 1 D
.
a Calculate the bjockirng factor bfranithe hinber offileSpblocks
(o bytesh and we wani to
gr
SeNIclary

ppose that the file is ot ordered hy


the ke ield
indeson &n. Calculate
i.thie index blockmgfactur h number of first-level index blocks;
index caries and the
the ninter,of fist-icel
C make it ino a multilevelindex:
nunber of teveis uecded jf we
the index: and
regred by thie multilevel
i the totai mumber of biocks
accesses heucd 1o seareh for ad retrneve
a record Irot the iile gIYCn
tae number of' block (8 marks)
valyeusing tre sécondary 1iex
Ssr
arncd show
the i n and max requirements at leaf arnd rin-lcaf nodes
ortfne B* ree of order sa in Figure 1, mention
ihe formufthe tree after each ofthe following
sernes
of operatíons:

Figure 1
nsert 9

b. insert l0
insern 8
d. Delete 23 (8 marks)
Delete 19

items X and
read and write operation on share data
Consider the below given schedule. Here R and W denotes the
the transaction number TI, T2, and T3.
Y. Subscript , 2,3 after the Rand W represents

W(X), Ci, Ra(Y), Ca, Cs


Schedule: R:(X). R:(Y). Wi(X). R:(Y), Wi(Y),
Find out the foliowing for the given schedule: be the nuinber ofequivalent serial
Schedule is Serializable schedule
or not.
If yes. then what will
schedule?
Schedule is Recoverable
schedule or not?
Recoverable schedule or not?
Schedule is Cascade less Rollback
Recoverable scthedule or not? (12 marks)
Schedule is Strict
1.

etie heiov given transactions, Here R(REA12 ANd W{WRIFE) are the operations in the transaction.
pUsber arnd
are
the shared data times.
TI, T2 represent the transaction
Ti:R(X). WX), R[YC
12: RX), wIX). RZ) Cc2
Findon the followin
Total mmber ofrecowerable sehcoie ssibye wjth transaction Ti and T22
otl gumber of irrevoverabie seneaie possible with transaction Tl and T2?
Totalnunberof sehiedules possinle withznsactionTl ad 122 6 Marka):,
LNMIIT/B. Tech. CSE/CORE/2022-23/ODDCSE2271ET
LNMIIT
r a i t Teechriy

Consider the below given sehedule with the lock erders


T1:X(A). 12: S(A). T3:X(e). T4: S(C). T5.S(D), 1 NB, F4: X(A). T:SC), 13: S(D)
Draw the wait for graph tor the giveri order of locks. are
trarsactiorns which
Find whether the deadiock is present in the wai-for graph or not. Write the
invoivedin the deadlock. look instead of shured lock
oni data item D, then what
wait-
111 T1 is an exclirivc show using the updated
ST eck requested by a deadlock? ifyes,
wait-for gruph. wil it cause
a t ou the
fof grapi. (8 Marks)

Considier the below given schedule


T2 RA), T2: W(B). T3: WA), TI:R(B),. T4: R(B), TI: R(A). TI: W(C), T4: W(A)
the given schedule can be executed using the [20, 10, 30, 401 time stamp order or notr
pd ot whether
Which transactions will be rolled back using the (20, 10, 30, 40] time stamp ordering
Whaf will be the correct time stamp order to execute the given schedule? (7 Marks)

Consider a sinple checkpointing protocol and the following set of operations in the log file.
(start, T4); (write. T4. x, 3, 2): (start, TI): (commit, T4): (write, Tl, z, 7, 5%
(checkpoint.
(start. T2(Nrite, T2. x. 2,9); (commit. T2): (start, T3); (write, T3,y, 2,7): Crash
After the Crash. if the system tries to recover
Wbich ransactions will be there in the active list of the checkpoint.
What will be the contents of the UNDO and REDO list.
What will be the value of all shared data-items atter the recovery. (7 Marks)

.
LNMIITB. Tech./CSE/Core/2022-23/0D CSE227/MT
LNMIIT
Tlse
LNAM
Iaitute of
infeayhati Tooy
The LNM
The Institute of Ination Technology, Jaipur
LNM Ins
CSE227: Information & Database
&abase Management
Management Svste
2022-23dd semester Systems
tSystems
Mid Term Exam

Max Marks: 20 Date: 1October 2022


Time: 90 Mins
Total Total Marks CO CO2 C03 C04
Questions
20 QI-2.93-5, 02 1.05-7
Q4-2
CO weightage 9/20 45% 11/20- 55%
Instructions:
. There are 5 questions. Attempt questions in the given order.
b. Make and state assumptions precisely, as and when required.
c. All the notations have their usual meanings.

1. We want to design an attribute fora STUDENT entity type to keep track of previous college
cducation. This attribute Stnud_Degree will have one entry for each college previously attended.
and each such entry will be composed of college name, start and end dates, degree entries (degrees
awarded at that college). Each degree entry contains the degree name and the month and year the
degree was awarded. Represent this attribute to hold this information. 21
2. Answer each of the
followingquestions briefly, based on the following relational schema:
Emp( eid: integer, ename: string, age: integer, salary: real)
Works( eid: integer, did: integer, work_time: integer)
Dept(did: integer, dname: string, budget: real, managerid: integer)

a) What possible errors are expected if a Department tuple is deleted?


b) Write relational algebra expression for retrieving Department names (dname) where
employees are getting salary more than 20000?
c) Convert the relational algebra query to a TRC query: Teid (Gdid-4 (Works a Dept)
21
3. Frequent fliers have been complaining to PQR Airport oflicials about poor organization at
airport. You have been hired to design the database. Your task is to organize information about
all airplanes stationed and maintenance al airport. Relevant information is as follows:
i. Every airplane has a unique registration number
i. Each airplane is ofa specific model
iii. Airport accommodates a number ol airpkane models, and
each model is identified by a model
number (e.g. DC-10) and has a capacity and a weight.
iv. A number oftechnicians work at the airport. You need to store the name,1D, address, phone
number, and salary of each technician.
V. Each technician is an expert on one or more plane model(s). His/her expertise may overlap
with that of other technicians. This intormalion about technicians must also be recorded.
vi. Airport Authority (AA) requires the arport to keep track of each time a given airplane is
tested by a given technician. For each testing event, the information needed is date, number
of hours the technician spent doing the test, and the score the airplane received on the test.
LNMii
LNMITTB. Tech./CSECore/2022-23/ODDSE"
ODD SE227/MT JnteencikIVI Txhrkvgy

various
attributes of each entity
a) sure to indicate
Draw an ER diagram for airport database Be constraints. 3
and atio and participation
relationship type; also specify cardinality by a technician
who is an
b) AA passes be conducted
a
regulation that tests on a plane must
ER diagran? Ifyou
expert on that modei. this constraint in the
cannot express it Explain you express
pain how can vou 12
it, explain bricfly
includes

4.Consider ER schema for a database as shown. A C T O R


is used as a generic
term and
with True o r

actresses. Given constraints shown in sho


statcmeits

*as following
schema. respond to
2
False. Justify each answer.

PERFORMS IN

MOVIE
ACTOR

2 LEADROLE N

ALSO A
ACTOR
DIRECTOR
PRODUCER
DIRECTS
DIRECTOR

PRODUCER MPRODUCES

a) A movie can have only a maximum of two lead actors.

b) Every director has been an actor in some movie.

5. Consider the following relation: R(Doctor#, Patient#, Date, Diagnosis, Treat_code, Charge)
a treatment code and
a visit of a patient to a doctor, along with
In the relation, a tuple describes
daily charge. Assume that
. Diagnosis is determined (uniquely) foueach patient by a doctor
ii. Each treatment code has a fixed charge (regardless of patient).
11 Each day a patient visits a doctor, a different treatment is pertormed.

Attempt the following problems


a. Clearly write the FDs that hold on R.
Find the candidate key(s) of R.
C. Is this relation in 2NF? Justify vour answer and decompose it necessary.
S Turther normalization to 3NF necesary? Explain reason and decompose if required. {7]
LNMIT/B. Tech./CSE/Core/2022-23/ODD/CSE226/1:
LNMIIT
Ths LNAM Institute cf
infmatiori iechnology
The LNM Institute nformation Technology, Jaipur
CSE226: Advane Programming
2022-23 Odd Semester
End-Terni Examn
Max Marks: 60 Date: 03r December 2022
Time: 18O Mins.
Total Total CO CO2
CO3 C04 CO5
Questions Marks 6
60 03-6, Q4-4 Q1-7.02-9 Q6-6, Q7-8 Q5-4
COweightage 10/6017% 16/6027% 14/60-23% Q8-8. 09-8
A/606% 6/6)27
Instructions:
a. There are 9 questions. Al the questions are mandatory
b. Write all the sub-parts of a question at one place.
c. Make and state assumptions precisely, as and when required.
d. All the notations have their usual meanings.
e. Direct outputs will not be considered at all. Explain with suitable justification as mentioned in question.
All the questions responses should be (strictly) in sequential order only. We will not evaluate out-of-ordered
questions in any case.

( A ) . What should be the output ofthe following program? Give your justifications through proper memory interpretation
diagram only. 51
public class Test
public static void main (String U args)
inta{{123, {3,4}
int f] b i n t ]) a [1]:
O b j e c t o1 = a:

int [ ) [ ] a 2 = (int [] [ ) o l :

/ int [} b2 = (int [ ) o l : / LINE#-7


System.out.println (b [|): }}
(B). Suppose ifI uncomment Line#-7. Then, what should be the output of the program? Explain. 21
.a.Consider the Java code shown below. Show the complete memory interpretation for the array creation first. and then
show your outputs. 4
public class Test
public static void main (String l args) {
int [] a = new int [4] [3]; // stmt-1
a [0] new int [4]; //stmt-2
a [ ] new int [2]; // stmt-3
a new int [31[2]; // stmt-4
System.out.println("end of the code..."); }}
executes successfully?
How many objects are created when stmt-1
. How many objects are eligiblefor the CGarbage Collection (GC) when stmt-2 and stmt-3 execute successfully?
ii. How many objects are created afterthe complete execution of stmt-1 to stmt-4?
iv. How nany objects are eligible for the GC after the complcieaxccution of stmt-1 i1o stmt-4?

(B). Consider the.Java code shown bclow.


3. class Dozens{
4. int [ ]dz = {1,2,3,4.5,6,7,8,9,10,11,12:

5.
6. publicclass Eggs
7. publicstatic void main (String [] args)
Dozens da= new Dozens [3}:
LNMUT/R Tech.CSECore/2022-23/0DD/CSE226/1 LNMIIT
The LNM Institute of
9. da (0
Infoamatior 1choogy
new Dozens (0
Dozens d new Dozens ():
da [1- d
2 dnull;
13
14
ua [1null;
il do stuff

10W many objects are creatcd within


main in tolal and ihaw many
it with
the complete of them eligible for GiC when time 15 d
3. (A What should bememory interpretation diagram only.
the output of the following T51
programs" Give justiliealions,
SuppOse t i uncomment Line#-N in (ii)
progran. fhen. what should be the output of the progran () Espiain. 1
ti).class Bird (ii). class A
System.out.print("b1 "); } Object obj: int s:
public Bird() i System.out.printu"b2 "): } AO { this(20);
class Raptor System.outl.print("C");
extends Bird { Aint n) { x; System.out.print(x);
static System.out.print("rl "): public Object ml (){
public Raptor() { System.out.print("r2 "): } return obj;
System.0ut.print("r3 "); } class B extends A {
static Sy
stem.out.print("r4 "); public A ml 0

class Hawk extends System.out.print("A");


Raptor { Aa= new A();
public void Hawk() { System.out.print("r5 "X} return a; }
public B nml (int input){
class Test System.out.print("B");
public statie void main( String[] args) Bb= new BO:
System.out.print("pre "); return b; 3
new Hawk(); new Hawk();
class Test
System.out.printin("hawk "): publie static void main(String[} args)
Aa new B():
á.m10:
la.ml(10); // LINE-N
W h a t should be the output ofthe following prograns? Give justifications.
4
3. class Dog class Test
4. public void bark) t System.out.print("woof ");} static String s= "-";
5. public static void main(Stringl] args)
6. class Hound extends Dog { try
7. public void snif){ System.out.print("sniff "); } throw new Exception():
8. public void bark(){ System.out.print("howi "); }
catch (Exception e){
9. try
10. public class DogShow try throw new Exception():
1. public static void main(Stringl} args) { new
DogShow-go0: }
catch (Exception ex) {s+ "ic ":}
throw nev Exception{ ):
12. void go() catch (Exception x) {s+ "me ": }
13. new Hound().bark() finally s t"ml ";:
14. ((Dog) new lHound()). bark():
15. ((Dog) new Hound()).snifl():
finally s"of"
System.out.printin(s)
16. .

17.
5. Create an interface called Cur with two ahsiract methods String getNamet) and int getMasSpeed). Aisodeclareone default
method void applyBreak() which has the codesnippe System.out.printlaApplyingbreak on" getName): in the same
interface include a statie method Car getFastestCartCar carl, Car gar2). which relurns carl if the maxSpeed of carl is

Mo Speca
LNMIITB. Tech./CSE/Core/2022-23/0DD/CSE226/ET

LNMIIT
The tNM lttute of
greater than or equal to that of car2. else shouldcar: Lreate a class called
return
3ntoernation Techrioiogy
Car and provides the
implementation abstract metrous getName() and BMW which implements the interface
getMaxSpeed() (make sure to declare the
appropriate ficlds to store name and maxSpecd and alsothe constnuctor to initialize
Audi whieh
implements the interface Car and them). Similarly, create a
proeld class called
getMaxSpeed) (make sure to declare the appropriate
initialize them). Create public class
t c s lo nentation
store name
for the abstract methods
getName() and
and
with the bclow.code in its maxSpeed and also the constructor to
a
called MainApp
public static void main(String args[}){
main() method.
Car carl new BMWBMW X5, 320);
Car car2 new BMVAUDI Q7, 300)
System.out.println("tastest car is+ Car getF astestCar( carl.car2).getName)%.
. What is the output of the following code? Explain. 141

public class Testf 161


try
publie static void main(Stringl] args){
A a new A): notify):
TI l-new T1(a); wait();
} cateh (lInterruptedException e) {
T2 12 new T2(a);
tl.start(); C.printStackTrace();
t2.start():

class A
class TI extends
synchronized void f10 Thread{
A a
for(int i=0:i<3:it+) {
TI(A a)
this.a a ;
System.out.printla("thread1:"+i);
try
publie void run() {
notify0:
wait(; a.f1)
catch (lnterruptedException e){
e.printStackTrace(); class T2 extends Thread{
A a;
T2(A a)i
this.a = a,
synchronized void f20
for(int i-0;i<3;it+) {
publicvoid run(){
a.f20;
System.out.println("thread2:"+i);:

TWhat is the output of the following code? Explain.


class Account 8
int bankBalance;
public synchronized void debitAccount (int amount, String name)
try
System.out.println("Checking for balance");
while((bankBalance- amount)<0){
System.out.println("going to wait")
wait();

System.out.println("debiting "+amount);
bankBalance=amount,
catch(lnterruptedException e

3
LNMIIT/B. Tech./CSECore/2022-23/ODIDCSEZ26/ET
LNMIIT
The &M Irettute of
Tnfoemotoe echrnokigy

System.ot.printin"in catch"):
public synehronized void creditAccount (int amount)
hankBaiance + amount: public void run)
System.cnst.printint "balance-"*bankBaiance notify "
int i0
notify Al)
try whilefis0f
ac.creditAccmritf f60
cBass Thrcadi extends Thread{ sheep 101.

Account ac;
String name:
Thread1(Account ac. String name) catch(nterruptedException e)f
this.ac-ac: c.printStack'Tracel):
this.name näme

pubtic vaid run)i


ac.dcbiiAccount(500. name): public class Main
public static void main(Stringí} args)
Account acl-new Account( :
class Thread2 extends Thread Thread ti=new ThreadI(acl, "tl")
Account ac: t1.start):
String name; Account ac2-new Account
Thread2(Account ac. String name){ Thread2 12=new Thread2(ac2. "t2")
this.ac=ac: 2.start(0:

to use databases. Assume that you


have
coffee shop. In that software, you have code for
making a software for a
are
price, sales and
total
amount. Write java
ssume that you
that contains the n a m e
of the coffee, supplier id,
table named COFFEES
the foilowing:
Create the tabie
table
Enserithe following rows tothe sales total amount
name of the coffec supplieridprice
00i01 7.99 0
Colombian

8.99 10 89.9
i French Roast 00049
of coftees
the name of the coffee and its price for all the types tne DB are
Display and password
of
url, user name
driver name is "oracie.jdbc.driver OracleDriver".
Assumyihat the respectively
"idboracle:thin: 4DB IPaddress:port _no:host string"uid'" and "password" 81
Expiain the diflerent 1 pes of drivers wih necessary diagrams.

You might also like