Dashrath Nandan NMOUP (Unit-1) Notes
Dashrath Nandan NMOUP (Unit-1) Notes
UNIT-1 Jashgath,
Nomdam
Date
Page
NMOUP
DaBa, Types
Comments indentafion:
X=5 Print("Dashrath")
y=3"14 else :
name "Dashyath #sting þint ( Nondan")
is true = True
True # boolean
Conrol Shrucures :
Sequenttal Condhonal keeating
For each item
Block1 KCondiHon
Block2l Fatse Block al instn
Bodk 3 Block Block2
classMate
Date
Page
X* kwangs : Keyuord
keguuod vaxiable Jergth angunents
for Key, value in kwargd" Item()8
bint(f "fkey ?:fvalue}")
þint.inko (name: Dashath' saqe= 21, job= 'Eny')
Nale: KOg byntan allsuss tha tundin to acopt any
Las a aple
X* Kungs syntar allus Hhefnatien to acapt any
asa detienany?
Yariable in bylhon -
) Gulobal Vaaiabla: defined outsete a functien bsdy
classnate
Date
Page
: total= 0
dek Sum (angl,angz) :
total = gl+ arg2
þrint(" Tnstde thefumct? local fotal:, total)
7etm total
Sum(l0j20)
print'uside the tun" gobal total, tota)
Qutput ? Insde the Functon Local total : 30
Outaide the kunotion glebal total :0
t Data Shuctues: sts, Tuples DeHknaies , Seti .
List Tuble Set Dictio naxy
+Lit i a nen- ble. ia 0non -Tet u aT91- Non- henqRLJ
hemogensw data homogen tus dshemgonaw Ds DS that seres
shucuethat shve haf stres but Btores the Key- Value pais
he elemnt in elembnts in lement in 2
keyz':'ve?
Rebresonded by [] .by )
+ti
Lst is Mutatle. mutable mutable mutable
|List is Ohdered t Ordered Unordered +ded
* Numeiical Methade
nbencef Numenical MeHhads in Pytoni
Comle bneblem &oluin ABBticatiens
Abþieximation Gf aalutins
Gmbtutakeral elHeciency. Rost findonq:
BOBtimizatien Dnd minizmiplion -lnean alebia Oheatons
Ordinay i- yuatien(ove)
and Pantas BE(PDE)
baies for numenical computing
1. Numy:dt i the fundamantal backage tos mumenical
nmpltinq in Python
Key featuel :
a) Milkdiminsional amys: fectent Ds far hapresatigVecos, matitd,
b) Mathematital Aunctins : klide rarge q math sjenations -
Broodcasling :Powengul mechanisa for porforming feraltons
fdferart shapei
2Seily: dtin build Gn Nonfy Ond þoEuides additonal
unctieralty tor sinty' omjetig
key feakres ?
htepraton, interbolaten sand cphimigakfon tools
4Speíal tenctiens i
4Sional and image fssCRJ`ng
fieaMing unctins
classHAte
Date
Page
Rost-Finding Methods:
D Bisection Method
1) Neustoh- Raphsen mehed
) Secant meted
1o Bisection Method i
selitien
is aHDet fending alguthm Uaed to finda Value
to the egn. f=0*dt u based en dntermudiate
continusus tums. f
heoem, thich statu that to any
hbaite
lGuh am inerval 9, 6] uhene fa) andf6) hawe intenal
Aigni, thexe enist 0t least Ône Stoot in that
Stops &f the Btsectien Mehod
D Thitial tntenwal Selection: Chocse tuo points a and b,such
that fa).{(b) <o Tinterva
r Midpsint Calulatiini Calculate (= 2 t0.aybi
1i Functien Lvaluation : Compute fl
classmate
Date
Page
) Sion Check:
$ {C)= 0, them C sthe root.
" f(a)-fcc) <0 , the Hoot lies in a, C1 , set b=C"
Step3: f2) = 44 =0
f)=0 ' s i s the 908Bt.
Tlorettons)
b=c
cdassHAte
Date
Page.
Advantages
DSimplity DMadhantgs
n)
Gusanteid
in)Robustness cnvegence ) Snitial dnteial Reguisemerd
Eq
ngeneeslipecialy
a tang- at P(,foa)
shenlee to the 4oot.
Fomule :
f'(n)
ne1: Next aspöoximatiln
clAssMAte
Date
Page
f(3)= 16 e
"X= 2-2790
(n-3) X,= 2-2190-2-2790) 2:2190
422190)
Reat 22790
classmate
Date
Page
end if
4ew X-new
Alide ablt
X= Xnew
end tor Disodvantaae:
Dentalive Reguiremert
Convege"
evYor"Method did not onveage" Snital gues enstiuit
emd funclfon
3Secont Method
44isan itoratine umerical tchnigue Aed to fnd
Hhe oet ot men-linean e9uatien
+.his mehed iu uselel ihen the deruatie bf he
unctin i dijieult do compute.
Baaie brinci7le i-Jhiu mchecl assrerimatu the tost
afe functin f) by sing tus initial abEämatien
adX he mehod ileratiuely refines thase
Labbrorimatien byconstuctng sicant lnss betuen
these paint k stng the X- ntrcepta af these liineas
psonimaltbn.
txn) (Xy-Xy-),: Cwment
apanimatin.
maxZker)
classMate enuegne
DatePage
Xn-) ytol
inihial tan)n- til sX1,
tuuo fomula 3
0o
[f,
uthLoamd
L. and maxIter tol
abs(x,-4,)<
secantNethodif
-
Aply Xn 2
stebt
Stont Ln1=
procast to
:gussZS Repeat PEeudocdes ifend functin
j=1 De,=
X2
tenatiue function end
tor
Stabs:I-nibal iRepeat fox
end
4.
m4) (n=3) (n=) Xg
X4= D= |Aecant nEx:
g= 1
f)=-3 flo) = the
XG=0:20]- X2=0"25 0"25-
0-186- A
0:286, Lj
-= intewal real
)X2=0-2.5 method
,
t0-25)(O-25
flo25)-f)
(o- X3= t)2,-)=
1--) H9st
tort86)
t(ov201) tori864
t(0-25) -f0)t4) (0,)
00 s 6(0:201) X4= 186) 0-186 e
0:20) (O-186-O-25 yTSecant .the
0-201 Perlorm
-
1) eguáibn
- toun
-186) O 0"18644 Mehod
~ -3)-u) ileratfonA,
23-5Xt|
O201. (Q1)
20-20081 (1-0)aO-25 Page Date
classmate
of 0=
helics