Interpreters and compilers. Operational Semantics 3. Problem 1: Compile Aexp to a stack-based VM. Our target VM, 1. interpreter. compiler.
|
|
- Ronald Newton
- 5 years ago
- Views:
Transcription
1 Iterpreters d compilers iterpreter Opertiol Semtics 3 Compiltio Jim Royer CIS 352 Ferury 27, 2018 compiler source code source code i lexer i elutor/ strct sytx lue d prser iterpreter i lexer i compiler strct sytx oject code d prser i liker i hrdwre executle lue iterpreter There re my ritios o the oe Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1 Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1 Prolem 1: Compile Aexp to stck-sed VM Aexp Num (Numeric Vlues) Aexp (Arithmetic expressios) :: = ( ) ( 1 2 ) ( 1 2 ) A ig-step semtics for Aexp Num: where = +,, d El- : ( 1 2 ) Wht is our trget VM? ( = 1 2 ) Our trget VM, 1 Memory ks 256 my 8 it words so 8-it ddresses d 8-it cotets used to store the stck, oject code, d (lter) registers Registers (iterl) PC = progrm couter (poits to the curret istructio) = stck poiter (poits to the top of the stck + 1) Arithmetic mod 256 my 8 it words So = 0 (IMPORTANT!!!!) Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1 Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1
2 Our trget VM, 2 istructios Hlt Push Pop Add Su Mult Rule formt Wht do the istructios do? To precisely il this dow, we defie trsitio system gie y smll-step opertiol semtics: (pc, sp, stk) (pc, sp, stk ) where: oj = the oject code ( rry) stk = the stck ( rry) pc = the progrm couter ( idex ito oj) sp = the stck poiter ( idex ito stk) Our trget VM, 3 Push: Pop: Add: oj (pc, sp, stk) (pc + 2, sp + 1, stk[sp ]) (oj[pc] = pop) oj (pc, sp, stk) (pc + 1, sp 1, stk) oj (pc, sp, stk) (pc + 1, sp 1, stk[sp 2 ]) ( ) ( ) oj[pc] = dd d = stk[sp 2] + stk[sp 1] oj[pc] = push, oj[pc + 1] = me: premises oj (pc, sp, stk) (pc, sp, stk ) (side coditios) NB Sice poiter rithmetic is mod 256, uderflow d oerflow re wrp-rouds Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1 Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1 Elutio/Compiltio rules for Aexp Num: Num trs : Plus: Plus trs : [Push ] Hskell implemettio i m0hs BSS rule compiltio rule ( = ( ) ) BSS rule 1 I 1 2 I 2 compiltio rule ( ) I 1 ++ I 2 ++[Add] Questios Is the trsltio well-ehed? (I wht coditio does ech expressio lee the stck?) Is the trsltio correct? (No, we could esily oerflow the stck) (Yes, if we sty withi size ouds How to proe this?) Propositio Suppose is Aexp expressio I is the sequece of istructios the compiler geertes for I is loded ito the code k from ddress l 0 to ddress l 1 The (l 0, sp, stk) (l 1 + 1, sp + 1, stk[sp ]), where, proided there is o stck oerflow or uderflow Proof: By esy structurl iductio o Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1 Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1
3 Prolem 2: Compile LC to stck-sed VM LC Sytx d Bse Types (The s mrk chges) Phses P :: = C E B Commds C :: = skip l : = E C; C if B the C else C while B do C Iteger Expressos E :: =!l E E ( { +,,, }) Boole Expressos B :: = E E ( { =, <,, }) 8-Bit Itegers Z 256 = { 0, 1,, 255 } ( ) Booles B = { true, flse } Loctios l L = { l 0, l 1,, l 255 } ( )!l the iteger curretly stored i l Wht is our trget VM? Our trget VM, 1 memory ks 256 my 8 it words so 8-it ddresses d 8-it cotets used to store the stck, oject code, d user registers Registers (iterl) pc = progrm couter (poits to the curret istructio) sp = stck poiter (poits to the top of the stck + 1) Registers (user) 256-my 8-it registers Nmed l 0 through l 255 (or ltertiely, 0 through 255) Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1 Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1 Our trget VM, 2 The VM i picture istructios Hlt Push Pop Fetch Store Idd Isu Imult Ilt Jmp Jz Jz Wht do the istructios do? Trsitio system o VM cofigs: (pc, sp, stk, regs) oj = the oject code stk = the stck regs = the user registers pc = the progrm couter sp = the stck poiter Rule formt me: premises oj (pc, sp, stk, regs) (pc, sp, stk, regs ) ( ) ( ) = side-coditios PC Oj Fetch +1 +2? +1?? The VM just efore executig Fetch Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1 Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1
4 Our trget VM, 3 Fetch: Before d fter Oj PC PC +2 Oj Fetch: Store: oj (pc, sp, stk, regs) (pc + 2, sp + 1, stk[sp ], regs) ( ) oj (pc, sp, stk, regs) (pc + 2, sp, stk, regs[ ]) ( ) Fetch +1 +2? +1?? +1 Fetch ?? ( ) oj[pc] = fetch, oj[pc + 1] =, regs[] = ( ) oj[pc] = store, oj[pc + 1] =, stk[sp 1] = Before: Fetch After: Fetch NB Store does ot pop the stck!!! Fetch: oj (pc, sp, stk, regs) (pc + 2, sp + 1, stk[sp ], regs) ( ) ( ) oj[pc] = fetch, oj[pc + 1] =, regs[] = Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1 Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1 Store: Before d fter PC Oj PC +2 Oj Our trget VM, 4 Store +1 +2? -1 Store Ilt: Jmp: oj (pc, sp, stk, regs) (pc + 1, sp 1, stk[(sp 2) ], regs) ( ) oj (pc, sp, stk, regs) (pc, sp, stk, regs) ( ) Store: Before: Store After: Store oj (pc, sp, stk, regs) (pc + 2, sp, stk, regs[ ]) ( ) ( ) oj[pc] = ilt, stk[sp 2] = 1, stk[sp 1] = 2, d if 1 < 2 the = 1 else = 0 ( ) oj[pc] = jmp, oj[pc + 1] =, pc = pc NB Jmp is reltie jump ( ) oj[pc] = store, oj[pc + 1] =, stk[sp 1] = NB Store does ot pop the stck!!! Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1 Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1
5 Ilt: Before d After PC Oj PC +1 Oj Jmp: Before d fter PC Oj PC Oj +1 Ilt Ilt -2-1 Jmp + 1 Jmp Before: Ilt After: Ilt Before: Jmp After: Jmp Ilt: oj (pc, sp, stk, regs) (pc + 1, sp 1, stk[(sp 2) ], regs) ( ) Jmp: oj (pc, sp, stk, regs) (pc, sp, stk, regs) ( ) ( ) oj[pc] = ilt, stk[sp 2] = 1, stk[sp 1] = 2, d if 1 < 2 the = 1 else = 0 Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1 ( ) oj[pc] = jmp, oj[pc + 1] =, pc = pc NB Jmp is reltie jump Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1 Our trget VM, 5 Jz: Before d After PC Oj PC Oj Jz: Jz: oj (pc, sp, stk, regs) (pc, sp 1, stk, regs) ( ) oj (pc, sp, stk, regs) (pc, sp 1, stk, regs) ( ) Jz Jz -1? ( ) oj[pc] = jz, oj[pc + 1] =, stk[sp 1] =, d if = 0 the pc = pc else pc = pc + 2 NB Both Jz d Jz pop the stck!!! NB Both Jz d Jz re reltie jumps ( ) oj[pc] = jz, oj[pc + 1] =, stk[sp 1] =, d if = 0 the pc = pc else pc = pc Jz: Before: Jz oj (pc, sp, stk, regs) (pc, sp 1, stk, regs) After: Jz & if = 0 the pc = pc else pc = pc + 2 Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1 Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1
6 Jz: Before d After PC Oj PC Oj Compilig iteger d oole expressios Jz Jz -1? Compilig iteger expressios: A repet of wht we hd efore Compilig oole expressios: Miti the coetio tht oole lue is represeted y either 0 (for Flse) or 1 (for True) Bl trs : [Push ] = 1 whe = True, = 0 whe = Flse Lt trs : e 1 I 1 e 2 I 2 (e 1 < e 2 ) I 1 ++ I 2 ++[Ilt] Before: Jz After: Jz Eq trs : 1 I 1 2 I 2 (e 1 == e 2 ) I 1 ++I 2 ++[Isu, Push 1, Ilt] Jz: oj (pc, sp, stk, regs) (pc, sp 1, stk, regs) & if = 0 the pc = pc else pc = pc + 2 Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1 Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1 Compilig sttemets, 1 Compilig sttemets, 2 Skip trs : Assig trs : Seq trs : Skip [] e I 0 l i : = e I 0 ++[Store i, Pop] S 1 I 1 S 2 I 2 S 1 ; S 2 I 1 ++ I 2 If trs : e I 0 S 1 I 1 S 2 I 2 if e the S 1 else S 2 I 0 ++[Jz 0 ] ++ I 1 ++[Jmp 1 ] ++ I 2 ( ) 0 = 3 + codele(i 1 ) d 1 = 1 + codele(i 2 ) While trs : e I 0 S I 1 while e do S I 0 ++[Jz 0 ] ++ I 1 ++[Jmp 1 ] ( ) 0 = 3 + codele(i 1 ) d 1 = (3 + codele(i 0 ) + codele(i 1 )) Implemettio i LCmhs d LCCompilerhs ( ) ( ) Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1 Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1
7 Questios 1 Wht does it me for the compiler to e correct? Ay ru of compiled progrm eds up with the stte (register cotets) dictted y the opertiol semtics of LC 2 How does oe proe tht? Aother structurl iductio o LC code 3 Does compiled code ehe well (eg, lwys lees the stck i some sesile coditio)? 4 Wht out riles, locks, procedures, etc? Jim Royer (CIS 352) Opertiol Semtics 3 Ferury 27, / 1
Section 6.3: Geometric Sequences
40 Chpter 6 Sectio 6.: Geometric Sequeces My jobs offer ul cost-of-livig icrese to keep slries cosistet with ifltio. Suppose, for exmple, recet college grdute fids positio s sles mger erig ul slry of $6,000.
More informationICS141: Discrete Mathematics for Computer Science I
ICS4: Discrete Mthemtics for Computer Sciece I Dept. Iformtio & Computer Sci., J Stelovsky sed o slides y Dr. Bek d Dr. Still Origils y Dr. M. P. Frk d Dr. J.L. Gross Provided y McGrw-Hill 3- Quiz. gcd(84,96).
More informationCS S-12 Turing Machine Modifications 1. When we added a stack to NFA to get a PDA, we increased computational power
CS411-2015S-12 Turing Mchine Modifictions 1 12-0: Extending Turing Mchines When we dded stck to NFA to get PDA, we incresed computtionl power Cn we do the sme thing for Turing Mchines? Tht is, cn we dd
More informationSection IV.6: The Master Method and Applications
Sectio IV.6: The Mster Method d Applictios Defiitio IV.6.1: A fuctio f is symptoticlly positive if d oly if there exists rel umer such tht f(x) > for ll x >. A cosequece of this defiitio is tht fuctio
More informationObjective Mathematics
. o o o o {cos 4 cos 9 si cos 65 } si 7º () cos 6º si 8º. If x R oe of these, the mximum vlue of the expressio si x si x.cos x c cos x ( c) is : () c c c c c c. If ( cos )cos cos ; 0, the vlue of 4. The
More informationPROGRESSIONS AND SERIES
PROGRESSIONS AND SERIES A sequece is lso clled progressio. We ow study three importt types of sequeces: () The Arithmetic Progressio, () The Geometric Progressio, () The Hrmoic Progressio. Arithmetic Progressio.
More informationRecurrece reltio & Recursio 9 Chpter 3 Recurrece reltio & Recursio Recurrece reltio : A recurrece is equtio or iequlity tht describes fuctio i term of itself with its smller iputs. T T The problem of size
More informationis an ordered list of numbers. Each number in a sequence is a term of a sequence. n-1 term
Mthemticl Ptters. Arithmetic Sequeces. Arithmetic Series. To idetify mthemticl ptters foud sequece. To use formul to fid the th term of sequece. To defie, idetify, d pply rithmetic sequeces. To defie rithmetic
More informationLecture 4 Recursive Algorithm Analysis. Merge Sort Solving Recurrences The Master Theorem
Lecture 4 Recursive Algorithm Alysis Merge Sort Solvig Recurreces The Mster Theorem Merge Sort MergeSortA, left, right) { if left < right) { mid = floorleft + right) / 2); MergeSortA, left, mid); MergeSortA,
More informationContent. Languages, Alphabets and Strings. Operations on Strings. a ab abba baba. aaabbbaaba b 5. Languages. A language is a set of strings
CD5560 FABER Forml guges, Automt d Models of Computtio ecture Mälrdle Uiversity 006 Cotet guges, Alphets d Strigs Strigs & Strig Opertios guges & guge Opertios Regulr Expressios Fiite Automt, FA Determiistic
More informationf(t)dt 2δ f(x) f(t)dt 0 and b f(t)dt = 0 gives F (b) = 0. Since F is increasing, this means that
Uiversity of Illiois t Ur-Chmpig Fll 6 Mth 444 Group E3 Itegrtio : correctio of the exercises.. ( Assume tht f : [, ] R is cotiuous fuctio such tht f(x for ll x (,, d f(tdt =. Show tht f(x = for ll x [,
More informationDifferent kinds of Mathematical Induction
Differet ids of Mathematical Iductio () Mathematical Iductio Give A N, [ A (a A a A)] A N () (First) Priciple of Mathematical Iductio Let P() be a propositio (ope setece), if we put A { : N p() is true}
More informationDATA STRUCTURES I, II, III, AND IV
Data structures DATA STRUCTURES I, II, III, AND IV I. Amortized Aalysis II. Biary ad Biomial Heaps III. Fiboacci Heaps IV. Uio Fid Static problems. Give a iput, produce a output. Ex. Sortig, FFT, edit
More information0 otherwise. sin( nx)sin( kx) 0 otherwise. cos( nx) sin( kx) dx 0 for all integers n, k.
. Computtio of Fourier Series I this sectio, we compute the Fourier coefficiets, f ( x) cos( x) b si( x) d b, i the Fourier series To do this, we eed the followig result o the orthogolity of the trigoometric
More informationMATH 118 HW 7 KELLY DOUGAN, ANDREW KOMAR, MARIA SIMBIRSKY, BRANDEN LASKE
MATH 118 HW 7 KELLY DOUGAN, ANDREW KOMAR, MARIA SIMBIRSKY, BRANDEN LASKE Prt 1. Let be odd rime d let Z such tht gcd(, 1. Show tht if is qudrtic residue mod, the is qudrtic residue mod for y ositive iteger.
More informationf ( x) ( ) dx =
Defiite Itegrls & Numeric Itegrtio Show ll work. Clcultor permitted o, 6,, d Multiple Choice. (Clcultor Permitted) If the midpoits of equl-width rectgles is used to pproximte the re eclosed etwee the x-xis
More informationImproving XOR-Dominated Circuits by Exploiting Dependencies between Operands. Ajay K. Verma and Paolo Ienne. csda
Improvig XOR-Domited Circuits y Exploitig Depedecies etwee Operds Ajy K. Verm d Polo Iee csd Processor Architecture Lortory LAP & Cetre for Advced Digitl Systems CSDA Ecole Polytechique Fédérle de Luse
More information1.3 Continuous Functions and Riemann Sums
mth riem sums, prt 0 Cotiuous Fuctios d Riem Sums I Exmple we sw tht lim Lower() = lim Upper() for the fuctio!! f (x) = + x o [0, ] This is o ccidet It is exmple of the followig theorem THEOREM Let f be
More information10.1 Sequences. n term. We will deal a. a n or a n n. ( 1) n ( 1) n 1 2 ( 1) a =, 0 0,,,,, ln n. n an 2. n term.
0. Sequeces A sequece is a list of umbers writte i a defiite order: a, a,, a, a is called the first term, a is the secod term, ad i geeral eclusively with ifiite sequeces ad so each term Notatio: the sequece
More informationMultiplicative Versions of Infinitesimal Calculus
Multiplictive Versios o Iiitesiml Clculus Wht hppes whe you replce the summtio o stdrd itegrl clculus with multiplictio? Compre the revited deiitio o stdrd itegrl D å ( ) lim ( ) D i With ( ) lim ( ) D
More informationPOWER SERIES R. E. SHOWALTER
POWER SERIES R. E. SHOWALTER. sequeces We deote by lim = tht the limit of the sequece { } is the umber. By this we me tht for y ε > 0 there is iteger N such tht < ε for ll itegers N. This mkes precise
More informationNumbers (Part I) -- Solutions
Ley College -- For AMATYC SML Mth Competitio Cochig Sessios v.., [/7/00] sme s /6/009 versio, with presettio improvemets Numbers Prt I) -- Solutios. The equtio b c 008 hs solutio i which, b, c re distict
More informationMAS221 Analysis, Semester 2 Exercises
MAS22 Alysis, Semester 2 Exercises Srh Whitehouse (Exercises lbelled * my be more demdig.) Chpter Problems: Revisio Questio () Stte the defiitio of covergece of sequece of rel umbers, ( ), to limit. (b)
More informationLecture 4 Recursive Algorithm Analysis. Merge Sort Solving Recurrences The Master Theorem
Lecture 4 Recursive Algorithm Alysis Merge Sort Solvig Recurreces The Mster Theorem Merge Sort MergeSortA, left, right) { if left < right) { mid floorleft right) / 2); MergeSortA, left, mid); MergeSortA,
More informationA B = φ No conclusion. 2. (5) List the values of the sets below. Let A = {n 2 : n P n 5} = {1,4,9,16,25} and B = {n 4 : n P n 5} = {1,16,81,256,625}
CPSC 070 Aswer Keys Test # October 1, 014 1. (a) (5) Defie (A B) to be those elemets i set A but ot i set B. Use set membership tables to determie what elemets are cotaied i (A (B A)). Use set membership
More informationMathematical Induction (selected questions)
Mtheticl Iductio (selected questios). () Let P() e the propositio : For P(), L.H.S. R.H.S., P() is true. Assue P() is true for soe turl uer, tht is, () For P( ),, y () By the Priciple of Mtheticl Iductio,
More informationFig. 1. I a. V ag I c. I n. V cg. Z n Z Y. I b. V bg
ymmetricl Compoets equece impedces Although the followig focuses o lods, the results pply eqully well to lies, or lies d lods. Red these otes together with sectios.6 d.9 of text. Cosider the -coected lced
More informationSimilar idea to multiplication in N, C. Divide and conquer approach provides unexpected improvements. Naïve matrix multiplication
Next. Covered bsics of simple desig techique (Divided-coquer) Ch. of the text.. Next, Strsse s lgorithm. Lter: more desig d coquer lgorithms: MergeSort. Solvig recurreces d the Mster Theorem. Similr ide
More informationLoad. Load. Load 1 0 MUX B. MB select. Bus A. A B n H select S 2:0 C S. G select 4 V C N Z. unit (ALU) G. Zero Detect.
9- Write D data Load eable A address A select B address B select Load R 2 2 Load Load R R2 UX 2 3 UX 2 3 2 3 Decoder D address 2 Costat i Destiatio select 28 Pearso Educatio, Ic.. orris ao & Charles R.
More information4. When is the particle speeding up? Why? 5. When is the particle slowing down? Why?
AB CALCULUS: 5.3 Positio vs Distce Velocity vs. Speed Accelertio All the questios which follow refer to the grph t the right.. Whe is the prticle movig t costt speed?. Whe is the prticle movig to the right?
More informationTHE NATIONAL UNIVERSITY OF IRELAND, CORK COLÁISTE NA hollscoile, CORCAIGH UNIVERSITY COLLEGE, CORK SUMMER EXAMINATION 2005 FIRST ENGINEERING
OLLSCOIL NA héireann, CORCAIGH THE NATIONAL UNIVERSITY OF IRELAND, CORK COLÁISTE NA hollscoile, CORCAIGH UNIVERSITY COLLEGE, CORK SUMMER EXAMINATION 2005 FIRST ENGINEERING MATHEMATICS MA008 Clculus d Lier
More informationWeek 13 Notes: 1) Riemann Sum. Aim: Compute Area Under a Graph. Suppose we want to find out the area of a graph, like the one on the right:
Week 1 Notes: 1) Riem Sum Aim: Compute Are Uder Grph Suppose we wt to fid out the re of grph, like the oe o the right: We wt to kow the re of the red re. Here re some wys to pproximte the re: We cut the
More informationNUMBERS AND THE RULES OF ARITHMETIC
MathScope. Mathematics for Egieerig ad Sciece Studets NUMBERS AND THE RULES OF ARITHMETIC. INDICES (POWERS OF NUMBERS). Notatio ( represets a umer) () is writte as ( raised to the power of or squared)
More information10.5 Test Info. Test may change slightly.
0.5 Test Ifo Test my chge slightly. Short swer (0 questios 6 poits ech) o Must choose your ow test o Tests my oly be used oce o Tests/types you re resposible for: Geometric (kow sum) Telescopig (kow sum)
More informationb a 2 ((g(x))2 (f(x)) 2 dx
Clc II Fll 005 MATH Nme: T3 Istructios: Write swers to problems o seprte pper. You my NOT use clcultors or y electroic devices or otes of y kid. Ech st rred problem is extr credit d ech is worth 5 poits.
More informationCS 70 Second Midterm 7 April NAME (1 pt): SID (1 pt): TA (1 pt): Name of Neighbor to your left (1 pt): Name of Neighbor to your right (1 pt):
CS 70 Secod Midter 7 April 2011 NAME (1 pt): SID (1 pt): TA (1 pt): Nae of Neighbor to your left (1 pt): Nae of Neighbor to your right (1 pt): Istructios: This is a closed book, closed calculator, closed
More information,... are the terms of the sequence. If the domain consists of the first n positive integers only, the sequence is a finite sequence.
Chpter 9 & 0 FITZGERALD MAT 50/5 SECTION 9. Sequece Defiitio A ifiite sequece is fuctio whose domi is the set of positive itegers. The fuctio vlues,,, 4,...,,... re the terms of the sequece. If the domi
More informationMTH 146 Class 16 Notes
MTH 46 Clss 6 Notes 0.4- Cotiued Motivtio: We ow cosider the rc legth of polr curve. Suppose we wish to fid the legth of polr curve curve i terms of prmetric equtios s: r f where b. We c view the cos si
More informationReversing the Arithmetic mean Geometric mean inequality
Reversig the Arithmetic me Geometric me iequlity Tie Lm Nguye Abstrct I this pper we discuss some iequlities which re obtied by ddig o-egtive expressio to oe of the sides of the AM-GM iequlity I this wy
More informationSolutions to Homework 7
Solutios to Homework 7 Due Wedesday, August 4, 004. Chapter 4.1) 3, 4, 9, 0, 7, 30. Chapter 4.) 4, 9, 10, 11, 1. Chapter 4.1. Solutio to problem 3. The sum has the form a 1 a + a 3 with a k = 1/k. Sice
More informationLaws of Integral Indices
A Lws of Itegrl Idices A. Positive Itegrl Idices I, is clled the se, is clled the idex lso clled the expoet. mes times.... Exmple Simplify 5 6 c Solutio 8 5 6 c 6 Exmple Simplify Solutio The results i
More informationMathacle. PSet Stats, Concepts In Statistics Level Number Name: Date:
APPENDEX I. THE RAW ALGEBRA IN STATISTICS A I-1. THE INEQUALITY Exmple A I-1.1. Solve ech iequlity. Write the solutio i the itervl ottio..) 2 p - 6 p -8.) 2x- 3 < 5 Solutio:.). - 4 p -8 p³ 2 or pî[2, +
More informationSect Simplifying Radical Expressions. We can use our properties of exponents to establish two properties of radicals: and
128 Sect 10.3 - Simplifyig Rdicl Expressios Cocept #1 Multiplictio d Divisio Properties of Rdicls We c use our properties of expoets to estlish two properties of rdicls: () 1/ 1/ 1/ & ( Multiplictio d
More informationInfinite Sequences and Series
Chapter 6 Ifiite Sequeces ad Series 6.1 Ifiite Sequeces 6.1.1 Elemetary Cocepts Simply speakig, a sequece is a ordered list of umbers writte: {a 1, a 2, a 3,...a, a +1,...} where the elemets a i represet
More informationINFINITE SERIES. ,... having infinite number of terms is called infinite sequence and its indicated sum, i.e., a 1
Appedix A.. Itroductio As discussed i the Chpter 9 o Sequeces d Series, sequece,,...,,... hvig ifiite umber of terms is clled ifiite sequece d its idicted sum, i.e., + + +... + +... is clled ifite series
More informationCSE 1400 Applied Discrete Mathematics Number Theory and Proofs
CSE 1400 Applied Discrete Mathematics Number Theory ad Proofs Departmet of Computer Scieces College of Egieerig Florida Tech Sprig 01 Problems for Number Theory Backgroud Number theory is the brach of
More information( ) dx ; f ( x ) is height and Δx is
Mth : 6.3 Defiite Itegrls from Riem Sums We just sw tht the exct re ouded y cotiuous fuctio f d the x xis o the itervl x, ws give s A = lim A exct RAM, where is the umer of rectgles i the Rectgulr Approximtio
More informationCS 314 Principles of Programming Languages
C 314 Principles of Progrmming Lnguges Lecture 6: LL(1) Prsing Zheng (Eddy) Zhng Rutgers University Ferury 5, 2018 Clss Informtion Homework 2 due tomorrow. Homework 3 will e posted erly next week. 2 Top
More informationThe limit comparison test
Roerto s Notes o Ifiite Series Chpter : Covergece tests Sectio 4 The limit compriso test Wht you eed to kow lredy: Bsics of series d direct compriso test. Wht you c ler here: Aother compriso test tht does
More informationRiemann Integral and Bounded function. Ng Tze Beng
Riem Itegrl d Bouded fuctio. Ng Tze Beg I geerlistio of re uder grph of fuctio, it is ormlly ssumed tht the fuctio uder cosidertio e ouded. For ouded fuctio, the rge of the fuctio is ouded d hece y suset
More informationComputability and computational complexity
Computability ad computatioal complexity Lecture 4: Uiversal Turig machies. Udecidability Io Petre Computer Sciece, Åbo Akademi Uiversity Fall 2015 http://users.abo.fi/ipetre/computability/ 21. toukokuu
More informationTest Info. Test may change slightly.
9. 9.6 Test Ifo Test my chge slightly. Short swer (0 questios 6 poits ech) o Must choose your ow test o Tests my oly be used oce o Tests/types you re resposible for: Geometric (kow sum) Telescopig (kow
More informationThe Exponential Function
The Epoetil Fuctio Defiitio: A epoetil fuctio with bse is defied s P for some costt P where 0 d. The most frequetly used bse for epoetil fuctio is the fmous umber e.788... E.: It hs bee foud tht oyge cosumptio
More informationName: A2RCC Midterm Review Unit 1: Functions and Relations Know your parent functions!
Nme: ARCC Midterm Review Uit 1: Fuctios d Reltios Kow your pret fuctios! 1. The ccompyig grph shows the mout of rdio-ctivity over time. Defiitio of fuctio. Defiitio of 1-1. Which digrm represets oe-to-oe
More information0 x < 5 PIECEWISE FUNCTIONS DAY1 4.7
PIECEWISE FUNCTIONS DAY 7 GOAL Red fuctios of grphs represeted by more th oe equtio fuctios of grphs represeted by more th oe equtio Grph piecewise fuctios PIECEWISE FUNCTION A fuctio defied by two or
More information5. Solving recurrences
5. Solvig recurreces Time Complexity Alysis of Merge Sort T( ) 0 if 1 2T ( / 2) otherwise sortig oth hlves mergig Q. How to prove tht the ru-time of merge sort is O( )? A. 2 Time Complexity Alysis of Merge
More informationMA123, Chapter 9: Computing some integrals (pp )
MA13, Chpter 9: Computig some itegrls (pp. 189-05) Dte: Chpter Gols: Uderstd how to use bsic summtio formuls to evlute more complex sums. Uderstd how to compute its of rtiol fuctios t ifiity. Uderstd how
More informationNotes on Snell Envelops and Examples
Notes o Sell Evelops ad Examples Example (Secretary Problem): Coside a pool of N cadidates whose qualificatios are represeted by ukow umbers {a > a 2 > > a N } from best to last. They are iterviewed sequetially
More information1 Hash tables. 1.1 Implementation
Lecture 8 Hash Tables, Uiversal Hash Fuctios, Balls ad Bis Scribes: Luke Johsto, Moses Charikar, G. Valiat Date: Oct 18, 2017 Adapted From Virgiia Williams lecture otes 1 Hash tables A hash table is a
More informationEC 413 Computer Organization
EC 413 Computer Organization rithmetic Logic Unit (LU) and Register File Prof. Michel. Kinsy Computing: Computer Organization The DN of Modern Computing Computer CPU Memory System LU Register File Disks
More informationSEQUENCES AND SERIES
Sequeces ad 6 Sequeces Ad SEQUENCES AND SERIES Successio of umbers of which oe umber is desigated as the first, other as the secod, aother as the third ad so o gives rise to what is called a sequece. Sequeces
More informationSUTCLIFFE S NOTES: CALCULUS 2 SWOKOWSKI S CHAPTER 11
UTCLIFFE NOTE: CALCULU WOKOWKI CHAPTER Ifiite eries Coverget or Diverget eries Cosider the sequece If we form the ifiite sum 0, 00, 000, 0 00 000, we hve wht is clled ifiite series We wt to fid the sum
More informationThe Weierstrass Approximation Theorem
The Weierstrss Approximtio Theorem Jmes K. Peterso Deprtmet of Biologicl Scieces d Deprtmet of Mthemticl Scieces Clemso Uiversity Februry 26, 2018 Outlie The Wierstrss Approximtio Theorem MtLb Implemettio
More informationThe Random Walk For Dummies
The Radom Walk For Dummies Richard A Mote Abstract We look at the priciples goverig the oe-dimesioal discrete radom walk First we review five basic cocepts of probability theory The we cosider the Beroulli
More informationSums, products and sequences
Sums, products ad sequeces How to write log sums, e.g., 1+2+ (-1)+ cocisely? i=1 Sum otatio ( sum from 1 to ): i 3 = 1 + 2 + + If =3, i=1 i = 1+2+3=6. The ame ii does ot matter. Could use aother letter
More informationMISCELLANEOUS SEQUENCES & SERIES QUESTIONS
MISCELLANEOUS SEQUENCES & SERIES QUESTIONS Questio (***+) Evaluate the followig sum 30 r ( 2) 4r 78. 3 MP2-V, 75,822,200 Questio 2 (***+) Three umbers, A, B, C i that order, are i geometric progressio
More informationEdexcel GCE Further Pure Mathematics FP1 Advanced/Advanced Subsidiary
Cetre No. Cadidate No. Surame Sigature Paper Referece(s) 6667/0 Edexcel GCE Further Pure Mathematics FP Advaced/Advaced Subsidiary Moday 28 Jauary 203 Morig Time: hour 30 miutes Materials required for
More informationDiscrete Mathematics I Tutorial 12
Discrete Mthemtics I Tutoril Refer to Chpter 4., 4., 4.4. For ech of these sequeces fid recurrece reltio stisfied by this sequece. (The swers re ot uique becuse there re ifiitely my differet recurrece
More informationWeek 5-6: The Binomial Coefficients
Wee 5-6: The Biomial Coefficiets March 6, 2018 1 Pascal Formula Theorem 11 (Pascal s Formula For itegers ad such that 1, ( ( ( 1 1 + 1 The umbers ( 2 ( 1 2 ( 2 are triagle umbers, that is, The petago umbers
More informationUNIT 4 EXTENDING THE NUMBER SYSTEM Lesson 1: Working with the Number System Instruction
Lesso : Workig with the Nuber Syste Istructio Prerequisite Skills This lesso requires the use of the followig skills: evlutig expressios usig the order of opertios evlutig expoetil expressios ivolvig iteger
More informationLecture 38 (Trapped Particles) Physics Spring 2018 Douglas Fields
Lecture 38 (Trpped Prticles) Physics 6-01 Sprig 018 Dougls Fields Free Prticle Solutio Schrödiger s Wve Equtio i 1D If motio is restricted to oe-dimesio, the del opertor just becomes the prtil derivtive
More informationChapter Real Numbers
Chpter. - Rel Numbers Itegers: coutig umbers, zero, d the egtive of the coutig umbers. ex: {,-3, -, -,,,, 3, } Rtiol Numbers: quotiets of two itegers with ozero deomitor; termitig or repetig decimls. ex:
More informationWorksheet on Generating Functions
Worksheet o Geeratig Fuctios October 26, 205 This worksheet is adapted from otes/exercises by Nat Thiem. Derivatives of Geeratig Fuctios. If the sequece a 0, a, a 2,... has ordiary geeratig fuctio A(x,
More informationDiscrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Lecture 17
CS 70 Discrete Mthemtics d Proility Theory Sprig 206 Ro d Wlrd Lecture 7 Vrice We hve see i the previous ote tht if we toss coi times with is p, the the expected umer of heds is p. Wht this mes is tht
More informationChapter 7 Infinite Series
MA Ifiite Series Asst.Prof.Dr.Supree Liswdi Chpter 7 Ifiite Series Sectio 7. Sequece A sequece c be thought of s list of umbers writte i defiite order:,,...,,... 2 The umber is clled the first term, 2
More informationDe Moivre s Theorem - ALL
De Moivre s Theorem - ALL. Let x ad y be real umbers, ad be oe of the complex solutios of the equatio =. Evaluate: (a) + + ; (b) ( x + y)( x + y). [6]. (a) Sice is a complex umber which satisfies = 0,.
More informationSignal Processing. Lecture 02: Discrete Time Signals and Systems. Ahmet Taha Koru, Ph. D. Yildiz Technical University.
Sigal Processig Lecture 02: Discrete Time Sigals ad Systems Ahmet Taha Koru, Ph. D. Yildiz Techical Uiversity 2017-2018 Fall ATK (YTU) Sigal Processig 2017-2018 Fall 1 / 51 Discrete Time Sigals Discrete
More informationEVALUATING DEFINITE INTEGRALS
Chpter 4 EVALUATING DEFINITE INTEGRALS If the defiite itegrl represets re betwee curve d the x-xis, d if you c fid the re by recogizig the shpe of the regio, the you c evlute the defiite itegrl. Those
More informationMA131 - Analysis 1. Workbook 2 Sequences I
MA3 - Aalysis Workbook 2 Sequeces I Autum 203 Cotets 2 Sequeces I 2. Itroductio.............................. 2.2 Icreasig ad Decreasig Sequeces................ 2 2.3 Bouded Sequeces..........................
More informationNumber Representation
Number Represetatio 1 Number System :: The Basics We are accustomed to usig the so-called decimal umber system Te digits :: 0,1,2,3,4,5,6,7,8,9 Every digit positio has a weight which is a power of 10 Base
More information( 1) n (4x + 1) n. n=0
Problem 1 (10.6, #). Fid the radius of covergece for the series: ( 1) (4x + 1). For what values of x does the series coverge absolutely, ad for what values of x does the series coverge coditioally? Solutio.
More informationExam 2 CMSC 203 Fall 2009 Name SOLUTION KEY Show All Work! 1. (16 points) Circle T if the corresponding statement is True or F if it is False.
1 (1 poits) Circle T if the correspodig statemet is True or F if it is False T F For ay positive iteger,, GCD(, 1) = 1 T F Every positive iteger is either prime or composite T F If a b mod p, the (a/p)
More informationPresentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, Divide-and-Conquer
Presettio for use with the textook, Algorithm Desig d Applictios, y M. T. Goodrich d R. Tmssi, Wiley, 25 Divide-d-Coquer Divide-d-Coquer Divide-d coquer is geerl lgorithm desig prdigm: Divide: divide the
More informationRADICAL EXPRESSION. If a and x are real numbers and n is a positive integer, then x is an. n th root theorems: Example 1 Simplify
Example 1 Simplify 1.2A Radical Operatios a) 4 2 b) 16 1 2 c) 16 d) 2 e) 8 1 f) 8 What is the relatioship betwee a, b, c? What is the relatioship betwee d, e, f? If x = a, the x = = th root theorems: RADICAL
More information10. 3 The Integral and Comparison Test, Estimating Sums
0. The Itegrl d Comriso Test, Estimtig Sums I geerl, it is hrd to fid the ect sum of series. We were le to ccomlish this for geometric series d for telescoig series sice i ech of those cses we could fid
More information1. By using truth tables prove that, for all statements P and Q, the statement
Author: Satiago Salazar Problems I: Mathematical Statemets ad Proofs. By usig truth tables prove that, for all statemets P ad Q, the statemet P Q ad its cotrapositive ot Q (ot P) are equivalet. I example.2.3
More informationNUMERICAL METHODS FOR SOLVING EQUATIONS
Mathematics Revisio Guides Numerical Methods for Solvig Equatios Page 1 of 11 M.K. HOME TUITION Mathematics Revisio Guides Level: GCSE Higher Tier NUMERICAL METHODS FOR SOLVING EQUATIONS Versio:. Date:
More information: : 8.2. Test About a Population Mean. STT 351 Hypotheses Testing Case I: A Normal Population with Known. - null hypothesis states 0
8.2. Test About Popultio Me. Cse I: A Norml Popultio with Kow. H - ull hypothesis sttes. X1, X 2,..., X - rdom smple of size from the orml popultio. The the smple me X N, / X X Whe H is true. X 8.2.1.
More informationSM2H. Unit 2 Polynomials, Exponents, Radicals & Complex Numbers Notes. 3.1 Number Theory
SMH Uit Polyomils, Epoets, Rdicls & Comple Numbers Notes.1 Number Theory .1 Addig, Subtrctig, d Multiplyig Polyomils Notes Moomil: A epressio tht is umber, vrible, or umbers d vribles multiplied together.
More informationLesson-2 PROGRESSIONS AND SERIES
Lesso- PROGRESSIONS AND SERIES Arithmetic Progressio: A sequece of terms is sid to be i rithmetic progressio (A.P) whe the differece betwee y term d its preceedig term is fixed costt. This costt is clled
More information1.1 The FTC and Riemann Sums. An Application of Definite Integrals: Net Distance Travelled
mth 3 more o the fudmetl theorem of clculus The FTC d Riem Sums A Applictio of Defiite Itegrls: Net Distce Trvelled I the ext few sectios (d the ext few chpters) we will see severl importt pplictios of
More informationNational Quali cations SPECIMEN ONLY
AH Ntiol Quli ctios SPECIMEN ONLY SQ/AH/0 Mthemtics Dte Not pplicble Durtio hours Totl mrks 00 Attempt ALL questios. You my use clcultor. Full credit will be give oly to solutios which coti pproprite workig.
More informationMath 4400/6400 Homework #7 solutions
MATH 4400 problems. Math 4400/6400 Homewor #7 solutios 1. Let p be a prime umber. Show that the order of 1 + p modulo p 2 is exactly p. Hit: Expad (1 + p) p by the biomial theorem, ad recall from MATH
More information1 Lecture 2: Sequence, Series and power series (8/14/2012)
Summer Jump-Start Program for Aalysis, 202 Sog-Yig Li Lecture 2: Sequece, Series ad power series (8/4/202). More o sequeces Example.. Let {x } ad {y } be two bouded sequeces. Show lim sup (x + y ) lim
More informationStalnaker s Argument
Stlker s Argumet (This is supplemet to Coutble Additiviy, Dutch Books d the Sleepig Beuty roblem ) Stlker (008) suggests rgumet tht c be stted thus: Let t be the time t which Beuty wkes o Mody morig. Upo
More informationHOMEWORK 2 SOLUTIONS
HOMEWORK SOLUTIONS CSE 55 RANDOMIZED AND APPROXIMATION ALGORITHMS 1. Questio 1. a) The larger the value of k is, the smaller the expected umber of days util we get all the coupos we eed. I fact if = k
More informationSpherical refracting surface. Here, the outgoing rays are on the opposite side of the surface from the Incoming rays.
Sphericl refrctig urfce Here, the outgoig ry re o the oppoite ide of the urfce from the Icomig ry. The oject i t P. Icomig ry PB d PV form imge t P. All prxil ry from P which trike the phericl urfce will
More informationName Date PRECALCULUS SUMMER PACKET
Name Date PRECALCULUS SUMMER PACKET This packet covers some of the cocepts that you eed to e familiar with i order to e successful i Precalculus. This summer packet is due o the first day of school! Make
More information[ 20 ] 1. Inequality exists only between two real numbers (not complex numbers). 2. If a be any real number then one and only one of there hold.
[ 0 ]. Iequlity eists oly betwee two rel umbers (ot comple umbers).. If be y rel umber the oe d oly oe of there hold.. If, b 0 the b 0, b 0.. (i) b if b 0 (ii) (iii) (iv) b if b b if either b or b b if
More informationMath 155 (Lecture 3)
Math 55 (Lecture 3) September 8, I this lecture, we ll cosider the aswer to oe of the most basic coutig problems i combiatorics Questio How may ways are there to choose a -elemet subset of the set {,,,
More information