1 Recursive Descent (LL(1) grammars)

Size: px
Start display at page:

Download "1 Recursive Descent (LL(1) grammars)"

Transcription

1 UNIVERSITY OF CALIFORNIA Dparmn of Elcrical Enginring and Compur Scincs Compur Scinc Division CS 164 Fall 2001 R. J. Faman CS 164: Programming Languags and Compilrs: Parsing Prviously, I 1 discussd wha i mans o hav a drivaion of a snnc according o a grammar, and how on can us a drivaion (onc found) o guid ha applicaion of smanic acions ha compu a smanic valu (i.., maning or ranslaion) of a snnc (whr snnc can man an nir program). In his handou, w urn o h qusion of how on finds such a drivaion. 1 Rcursiv Dscn (LL(1) grammars) Conx-fr grammars rsmbl rcursiv programs: hy ar crainly rcursivly dfind, and on can rad a rul A BCD as oparsana in h inpu, firs pars a B, hna C, andhnad. This insigh lads o a rahr inuiiv form of parsing known as rcursiv dscn. 1.1 From Grammars o Programs Considr h following grammar, wih augmns wrin in a kind of parn languag. Grammar 1. s \ra \of \ra 2 \= $$ = (addtrm $1 $2) 2 \ra + \> $$ = $2 2 \ra $\psilon$ \> $$ = nil \ra ( ) \> $$ = $2 \ra i \> $$ = $1 Hr,i, +, (, ),and $ (ndoffil)arrminalsymbols,andhsmanicvaluofani is, w ll say, a laf nod of an absrac synax r. W dfin (dfun addtrm (T1 T2) ;; ak wo rs, rurn sum as a r (if (null T2) T1 (lis + T1 T2))) 1 Takn in larg par from h Spring 1999 nos of Prof. P. Hilfingr. 1

2 L s assum ha hr is a funcion nxtokn() ha rurns h synacic cagory of h nx okn of h inpu (on of i, +, (, ), and $ ), and a funcion poptokn() ha rmovs ha okn. W somims combin hs ino a funcion a ha opionally aks an argumn: if h nx okn dos no qual h argumn, h procdur maks a fuss, xiing wih an rror. Givn no argumn, a jus pops h okn off h inpu. W can dfin boh vrsions a onc in Lisp: (dfun a( \&opional (x nil supplid?)) (cond ((no supplid?)(poptokn)) ((qual x (nxtokn))(poptokn)) ( (rror)))) Our sragy will b o produc a s of funcions, on for ach non-rminal symbol. Th body of ach funcion will dircly ranscrib h grammar ruls for h corrsponding nonrminal. To sar wih, w ll ignor h smanic acions: (dfun S () (E) a ( \of ) (dfun E () (T)(E2)) (dfun E2 () (cond ((qual (nxtokn) +) (a) (E)) ((qual (nxtokn \of))) ;$\psilon$ ( (rror)))) (dfun T () (cond ((qual (nxtokn) \( ) (a)(e) (a \) )) ((qual (nxtokn) i) (a)) ( (rror)))) If you xamin his closly, you should s ach grammar rul is ranscribd ino program x. Nonrminals on h righ-hand sids urn ino funcion calls; rminals urn ino calls o a. To pars a program (o sar hings off), you simply call (S). If you rac h xcuion of his program for a givn snnc and look a h ordr in which calls occur, comparing i o h pars r for ha snnc, you will s ha h program ssnially prforms a prordr walk (also calld op down ) of h pars r, corrsponding o a lfmos drivaion of h r. Adding in smanic acions complicas hings only a lil. Now w mak h funcions rurn h smanic valu for hir r: (dfun S () (l ((1 (E))) (a \of ) 1)) 2

3 (dfun E () (l ((1 (T)) (2 (E2))) (addtrm 1 2))) (dfun E2 () (cond ((qual (nxtokn) +) (a) (E)) ((qual (nxtokn) \of)) ( (rror)))) (dfun T () (cond ((qual (nxtokn) \( ) (a)(prog1 (E)(a \) ))) ((qual (nxtokn) i) (a)) ( (rror))) Programming no: In lisp, (prog1 a b c.. ) is a consrucion ha valuas a, b, c in ordr, and hn rurns a. Jus lik (l ((mp a)) b c... mp). 1.2 Choosing a branch: FIRST and FOLLOW I sill havn old you whr h if samns cam from. In gnral, you ll b facd wih svral ruls for a givn nonrminal l s say A α 1, A α 2,c.,whrachα i is a sring of rminal and nonrminal symbols. Ths rcursiv dscn parsrs work by choosing ( prdicing ) which of h α i o pursu basd on h nx, as y unscannd inpu okn. Assuming firs ha non of h α i can produc h mpy sring, w can choos h branch of h funcion for A ha corrsponds o rul A α i if h nx symbol of inpu is in FIRST(α i ), which (whn α i dos no produc h mpy sring) is dfind as h s of rminal symbols ha can bgin a snnc producd from α i. As long as hs ss of symbols do no ovrlap, w can unambiguously choos which branch o ak. Suppos on of h branchs, say α k, can produc h mpy sring, in which cas w dfin FIRST(α k ) o conain h mpy sring as wll as any symbols ha can bgin α k.w should choos h α k branch if ihr h nx inpu symbol is in FIRST(α k ) or h nx inpu symbol is in FOLLOW(A), which is dfind as h s of rminal symbols ha can com immdialy afr an A in som snnial form producd from h sar symbol. Clarly, w r in roubl if mor han on α i can produc h mpy sring, so for his ranslaion o rcursiv dscn o work, w mus insis ha a mos on branch can produc h mpy sring. If hr is no ovrlap in any of h ss of rminal srings producd by h procdur abov, hn w say ha h grammar is LL(1), maning ha i can b parsd Lf o righ o giv a Lfmos drivaion, looking ahad a mos 1 symbol of inpu. 3

4 1.3 Daling wih non-ll(1) grammars. You will hav noicd, no doub, ha h grammar abov is a bi odd, compard o a normal xprssion grammar. For on hing, i looks rahr conord, and for anohr, i groups xprssions o h righ rahr han h lf (i ras a+b+c as a+(b+c) ). If I ry o wri a mor naural grammar, howvr, I run ino roubl: Grammar 2. A. s \ra \of B. \ra + C. \ra D. \ra ( ) E. \ra i Th problm is ha h s o drmin whhr o apply h firs or scond rul for braks down: h sam symbols can sar an as can sar a. Anohr problm is ha h grammar is lf rcursiv: from, on can produc a snnial form ha bgins wih ; in a program his causs an infini rcursion. Boh of hs caus h grammar o b non-ll(1). Mos books go ino a gra dal of hair o g around problms lik his. Frankly, I ak a mor pracical sanc. Th parn abov is qui common. So much so ha h grammar is ofn wrin as A. s \ra \of B. \ra + D. \ra ( ) E. \ra i whr h bracs {} indica opionally zro or mor ims. This is asily dal wih by mans of a loop: (dfun E() (l ((1 (T))) (whil (qual (nxinpu) +) (a) (sf 1 (lis + 1 (T)))) 1)) ;; for fans of h Lisp do, hr s anohr vrsion (dfun E() (do ((1 (T)(lis + 1 (T)))) ((no (qual (nxinpu) +)) 1) (a))) 2 Boom-up Parsing You can hink of h difficulis wih LL(1) parsing rflcd in h nd o mung h grammars or cha wih spcial loops as arising from hir prdiciv naur. A pur 4

5 rcursiv dscn parsr chooss which righ-hand sid o us on h basis of jus h firs rminal symbol machd by ha righ-hand sid. If w could insad wai unil w had rad an nir producion, w migh do a br job. This is in fac h cas, bu h rsuling parsrs (calld boom-up parsrs) ffcivly rquir mchanical aids o b usful. Forunaly such aids xis, in h form of ools such as Yacc or Bison. I could simply nd h sory hr, bu I bliv you should hav a las on look a how your ools work bfor saring o ra hm as black magic. 2.1 Shif-rduc Parsing L s again considr Grammar 2 from abov, and look a a rvrs drivaion of h sring i+(i+i)$ : 1. i + ( i + i ) \of 2. + ( i + i ) \of 3. + ( i + i ) \of 4. + ( + i ) \of 5. + ( + i ) \of 6. + ( + ) \of 7. + ( ) \of 8. + \of 9. \of 10. p Rad from h boom up, his is a sraighforward righmos drivaion, bu wih a mysrious gap in h middl of ach snnial form. Th gap marks h posiion of h handl in ach snnial form h porion of h snnial form up o and including h symbols producd (rading upwards) by applying h nx producion or (rading downwards) h symbols abou o b rducd by applying h nx rvrs producion. Rading his downwards, you s ha h gap procds hrough h inpu (i.., h snnc o b parsd) from lf o righ. W call h symbols lf of h gap h sack (righ symbol on op) and h symbol jus o h righ of h gap h lookahad symbol. To add smanic acions, w jus apply h ruls aachd o a givn producion ach im w us i o rduc, aaching h rsuling smanic valu o h rsuling nonrminal insanc. For xampl, suppos ha h smanic valus aachd o h hr i s in h prcding xampl ar laf nods 1, 2, and 3, rspcivly. Thn, using x : E o man smanic valu E is aachd o symbol x, w hav h following pars 1. i:1 + ( i:2 + i:3 ) \of 2. :1 + ( i:2 + i:3 ) \of 3. :1 + ( i:2 + i:3 ) \of 4. :1 + ( :2 + i:3 ) \of 5. :1 + ( :2 + i:3 ) \of 6. :1 + ( :2 + :3 ) \of 7. :1 + ( :(+ 2 3) ) \of 8. :1 + :(+ 2 3) \of 9. :(+ 1 (+ 2 3)) \of 10. p 5

6 Iniially, only h rminal symbols hav smanic valus (as supplid by h lxr). Each rducion compus a nw smanic valu for h nonrminal symbol producd, as dircd by h grammar. Wih or wihou smanic acions, h procss illusrad abov is calld shif-rduc parsing. Each sp consiss ihr of shifing h lookahad symbol from h rmaining inpu (righ of h gap) o h op of h sack (lf of h gap), or of rducing som symbols (0 or mor) on op of h sack o a nonrminal according o on of h grammar producions (and prforming any smanic acions). Each lin in h xampls abov rprsns on rducion, plus som numbr of shifs. For xampl, lin 5 rprsns h rducion of o, followd by h shif of + and i. In all hs grammars, i is convnin o hav h nd-of-fil symbol ( $ ) and h sar symbol (in h xampls, p ) occur in xacly on producion. This firs producion hn has no imporan smanic acion aachd o i. This mans ha as soon as w shif h nd-of-fil symbol, w hav ffcivly accpd h sring and can sop. 2.2 Rcognizing Possibl Handls: h LR(0) machin W can complly mchaniz h procss of shif-rduc parsing as long as w can drmin whn w hav a handl on h sack, and which handl w hav. Th algorihm hn bcoms whil (\of{} no y shifd) if (handl is on op of h sack) rduc h handl; ls shif h lookahad symbol; I urns ou, inrsingly nough, ha alhough conx-fr languags canno b rcognizd in gnral by fini-sa machins, hir righmos handls can b rcognizd. Tha is, w can build a DFA ha allows us o prform h handl is on op of h sack s by pushing h sack hrough h DFA from boom o op (lf o righ in h diagrams abov). This DFA will also ll us which producion o us o rduc h handl. To do his, I will firs show how o consruc a handl grammar a grammar ha dscribs all possibl handls. Th rminal symbols of his grammar will b all h symbols (rminal and nonrminal) of h grammar w ar rying o pars. I will hn show how o convr h handl grammar ino an NFA, afr which h usual NFA-o-DFA consrucion will finish h job. Th nonrminals of h handl grammar for Grammar 2 ar H p, H,andH. H p mans a handl ha occurs during a righmos drivaion of a sring from p. Likwis, H mans a handl ha occurs during a righmos drivaion of a sring from, and so forh. L s sar wih H p. Thr ar wo cass: ihr h sack consiss of h handl $ and w ar rady for h final rducion, or w ar sill in h procss of forming h and havn gon around o shifing h $ y in ohr words, w hav som handl ha occurs during a drivaion of som sring from. Such a handl is supposd o b dscribd by H.This givs us h ruls: $H_p$ \ra \of $H_p$ \ra $H_$ (Again, h symbols and $ ar boh rminal symbols hr; H p is h nonrminal.) Now l s considr H. From h grammar, w s ha on possibl handl for is. I is also possibl ha w ar par way hrough h procss of rducing o his, so ha w hav h wo ruls 6

7 $H_$ \ra $H_$ \ra $H_$ Likwis, w also s ha anohr possibl handl is +. I is hrfor possibl o hav + on h sack, followd by a handl for an as-y-incompl, or finally, i is possibl ha h bfor h + is no y compl. Ths considraions lad o h following ruls for H : $H_$ \ra + $H_$ \ra + $H_$ $H_$ \ra $H_$ (Th las rul is uslss, bu harmlss). Coninuing, h full handl grammar looks lik his: $H_p$ \ra \of $H_$ $H_$ \ra $H_$ $H_$ \ra + + $H_$ $H_$ $H_$ \ra i $H_$ \ra ( ) ( $H_$ This grammar has a spcial propry: h only plac ha a nonrminal symbol appars on a righ-hand sid is a h nd (h nonrminals in h handl grammar ar H p, H,and H ). This is significan bcaus grammars wih his propry can b convrd ino NFAs vry asily. Considr, for xampl, h grammar A \ra x B B \ra y A B \ra z Th NFA in Fig. 1 rcognizs his grammar. W simply ransla ach nonrminal ino a sa, and ransfr o ha sa whnvr a righ-hand sid calls for rcognizing h corrsponding nonrminal. Th ranslaion in h figur uss som psilon ransiions whr hy rally could b avoidd, bcaus his will b convnin in h producion of a machin for h handl grammar. Whn w us his chniqu o convr h handl grammar ino a NFA, w g h machin shown in Fig. 2. I hav pu labls in h sas ha hin a why hy ar prsn. For xampl, h sa labld. + is supposd o man h sa of bing par way hrough a handl for h producion + jus bfor h +. Ths labls (producions wih a do in hm) ar known as LR(0) ims. Som of h sas hav h sam labls; howvr, if you xamin hm, you will s ha any sring ha rachs on of hm also rachs h ohr, so ha h idnical labls ar appropria. Thr ar no final sas mniond, bcaus all h informaion w ll nd rsids in h labls on h sas. Th final sp is o convr h NFA of Fig. 2 ino a DFA (so ha w can asily urn i ino a program). W us h s-of-sas consrucion ha you larnd prviously. Th labls on h rsuling sas ar ss of LR(0) ims; I lav ou h labls H p, H,andH, sinc hy urn ou o b rdundan. You can vrify ha w g h machin shown in Fig. 3. 7

8 x A y B z Figur 1: Exampl of convring a rgular grammar ino a NFA. 2.3 Using h Machin W may rprsn h LR(0) machin from Fig. 3 as a sa-ransiion abl: Acion Goo Sa i + ( ) $ 0. s2 s s6 s5 2. re re re re re 3. rc rc rc rc rc 4. s2 s ACCEPT 6. s2 s s6 s9 8. rb rb rb rb rb 9. rd rd rd rd rd Th numric nris in his abl (prcdd by s (shif) in h acion abl and apparing plain in h goo abl) com from h sa ransiions (arcs) in Fig. 3. Th r (rduc) nris com from LR(0) ims wih a do a h righ (indicaing a sa of bing o h righ of a ponial handl. ) Th lrs afr r rfr o producions in Grammar 2. To s how o us his abl, considr again h sring i+(i+i)$. Iniially, w hav h siuaion 1. $_0$ i + ( i + i ) \of Hr, h sparas h sack on h lf from h unprocssd inpu on h righ; h lookahad symbol is righ afr. Th subscrip 0 indicas ha h DFA sa ha 8

9 H p p ->. - p ->. - - p -> -. H ->. ->. -> +. ->. + -> > +. ->. + -> > +. H ->. i ->. ( ) i -> i. ( -> (. ) -> (. ) ->. ( ) ( ) -> (. ) -> ( ). Figur 2: NFA from h handl grammar. 9

10 5 0 p ->. - ->. ->. + ->. i i 1 - ->. + + p ->. - i 2 -> i. -> > +. ->. i ->. ( ) 8 -> + ->. ( ) 3 ( + ( ->. i ( 4 -> (. ) ->. ->. + ->. i 7 -> (. ) ->. + ) 9 -> ->. ( ) Figur 3: DFA consrucd from Fig. 2: Th canonical LR(0) machin. 10

11 corrsponds o h lf nd of h sack is sa 0. W us h abl, saring in sa 0. Thr is nohing on h sack, and row 0 of h abl lls us ha hr is no rducion possibl, bu ha w could procss an i okn if i wr on h sack. Thrfor, w shif h i okn from h inpu, giving 2. $_0$i$_2$ + ( i + i ) \of (Th subscrip 2 shows h DFA s sa afr scanning h i on h sack). Again, w sar in sa 0 and scan h sack, using h ransiions in h abl. This lavs us in sa 2. Row 2 in h abl lls us ha no shifs ar possibl, bu w may rduc ( r ) using producion E ( i). W hrfor pop h i off h sack, and push a back on, giving 2. $_0$$_3$ + ( i + i ) \of Running h machin ovr his nw sack lands us in sa 3, which says ha no shifs ar possibl, bu w can us rducion C ( ), which givs 3. $_0$$_1$ + ( i + i ) \of Now h machin nds up in sa 1, whos row lls us ha ihr a + or an $ could b nx on h sack, so ha w can shif ihr of hs, lading o 3a. $_0$$_1$ +$_6$ ( i + i ) \of Th sa 6 nry lls us ha w can shif (, and hn h sa 4 nry lls us w can shif i, giving 3b. $_0$$_1$ +$_6$($_4$ i$_2$ + i ) \of whrupon w s, again from h sa 2 nry, ha w should rduc using producion E: 4. $_0$$_1$ +$_6$ ($_4$ $_3$ + i ) \of and h sa 3 nry lls us o rduc using producion C: 5. $_0$$_1$ +$_6$ ($_4$ $_7$ + i ) \of and so forh. In gnral, hn, w rpadly prform h following sps for ach shif and rducion h parsr aks: FINDSTATE: sa = 0; for ach symbol, s, on h sack, sa = abl[sa][s]; FINDACTION: if abl[sa][lookahad] is s$n$ push h lookahad symbol on h sack; advanc h inpu; ls if abl[sa][lookahad] is r$k$ L $A \ra x_1\cdos x_m$ b producion $k$; pop $m$ symbols from h sack; push symbol $A$ on h sack; ls if abl[sa][lookahad] is ACCEPT nd h pars; 11

12 Th FINDACTION par of his fragmn aks a consan amoun of im for ach acion. Howvr, h im rquird for FINDSTATE incrass wih h siz of h sack. W can spd up h parsing procss wih a bi of mmoizaion. Rahr han sav h sack symbols, w insad sav h sas ha scanning hos symbols rsuls in (h subscrips in my xampls abov). Each parsing sp hn looks lik his: FINDACTION: if abl[op(sack)][lookahad] is s$n$ push $n$ on h sack; advanc h inpu; ls if abl[op(sack)][lookahad] is r$k$ L $A \ra x_1\cdos x_m$ b producion $k$; pop $m$ sas from h sack; // Rmindr: op(sack) is now changd! push abl[op(sack)][$a$] on h sack; ls if abl[sa][lookahad] is ACCEPT nd h pars; and our sampl pars looks lik his: 0. 0 i + ( i + i ) \of ( i + i ) \of ( i + i ) \of ( i + i ) \of 3a ( i + i ) \of 3b i + i ) \of 3c i ) \of i ) \of i ) \of 5a i ) \of 5b ) \of ) \of ) \of 7a \of \of \of 9a ACCEPT I s imporan o s ha all w hav don wih his chang is o spd up h pars. 2.4 Rsolving conflics Grammar 2 is calld an LR(0) grammar, maning ha is LR(0) machin has h propry ha ach sa conains ihr no rducion ims (ims wih a do a h far righ) or xacly on rducion im and nohing ls. In ohr words, an LR(0) grammar is on ha can b parsd from Lf o righ o produc a Righmos drivaion using a shif-rduc parsr ha dos no consul h lookahad characr (uss 0 symbols of lookahad). Fw grammars ar so simpl. Considr, for xampl, 12

13 0 p ->. - ->. ->. v ->. f ( ) v ->. i f ->. i v i f 1 6 p ->. - - p -> >. 3 v -> v. ->. v 4 ->. f ( ) v -> i. f -> i. i v ->. i f ->. i f ( ) -> f. ( ) -> f (. ) -> f ( ). Figur 4: LR(0) machin for Grammar 3. Grammar 3. A. program \ra \of B. C. \ra D. \ra f ( ) E. \ra v F. f \ra i G. v \ra i which givs us h DFA in Fig. 4. As you can s from h figur, hr ar problms in sas #2 and #4. Sa #2 has an LR(0) shif/rduc conflic: i is possibl boh o rduc by rducion C or o shif h In his paricular cas, i urns ou ha h corrc hing o do is o shif whn h lookahad symbol and o rduc ohrwis; ha is, rducing will always caus h pars o fail lar on. Sa #4 has an LR(0) rduc/rduc conflic: i is possibl o rduc ihr by rducion F or G. In his cas, h corrc hing o do is o rduc using F if h nx inpu symbol is ( and by G ohrwis. W nd up wih h following parsing abl: 13

14 Acion Goo Sa ( ) $ f v 0. s s6 2. rc s7 rc rc rc 3. re re re re re 4. rg rg rf rg rg 5. s8 6. ACCEPT 7. s s10 9. rb rb rb rb rb 10. rd rd rd rd rd Bcaus h choic bwn rducion and shif, or bwn wo rducions, dpnds on h lookahad symbol (in conras o Grammar 2), w say Grammar 3 is no LR(0). Howvr, sinc on symbol of lookahad suffics, w say ha i is LR(1) parsabl from Lf o righ producing a Righmos drivaion using a shif-rduc parsr wih 1 symbol of lookahad. In fac, Grammar 3 is wha w call LALR(1), h subclass of LR(1) for which h parsing abl has h sam sas and columns as for h LR(0) machin, and w mrly hav o choos h nris proprly o g h dsird rsul. (LALR mans Lookahad LR. Sinc LR parsrs do look ahad anyway, i s a rribl nam, bu w r suck wih i.) Yacc and Bison produc LALR(1) parsrs. Th class LR(1) is biggr, bu fw pracical grammars ar LR(1) wihou bing LALR(1), and LALR(1) parsing abls ar considrably smallr. Unforunaly, i is no clar from jus looking a h machin ha w hav filld in h problmaic nris corrcly. In paricular, whil h choic bwn rducions F and G in sa #4 is clar in his cas, h gnral rul is no a all obvious. As for h LR(0) shifrduc conflic in sa #2, i is obvious ha is h lookahad symbol, hn shifing has o b accpabl, bu prhaps his is bcaus h grammar is ambiguous and ihr h shif or h rducion could work, or prhaps if w lookd wo symbols ahad insad of jus on, w would somims choos h rducion rahr han h shif. On sysmaic approach is o us h FOLLOW ss ha w usd in LL(1) parsing. Facd wih an LR(0) rduc/rduc conflic such as f i vs. v i in sa #4, w choos o rduc o f if h lookahad symbol is in FOLLOW(f), choos o rduc v if h lookahad symbol is in FOLLOW(v), and choos ihr on ohrwis (or lav h nry blank). Likwis, w can assur ha h LR(0) shif-rduc conflic in sa #2 is proprly rsolvd in favor of as long dos no appar in FOLLOW(), as in fac i dosn. Whn his simpl mhod rsolvs all conflics and lls us how o fill in h LR(0) conflics in h abl, w say ha h grammar is SLR(1) (h S is for Simpl ). Grammar 3 happns o b SLR(1). Howvr, hr ar cass whr h FOLLOW ss fail o rsolv h conflic bcaus hy ar no snsiiv o h conx in which h rducion aks plac. Thrfor, ypical shifrduc parsr gnraors go a sp furhr and us h full LALR(1) lookahad compuaion. This works similarly o h FOLLOW compuaion dscribd in h xbook (pg. 189 of ASU ). W aach a s of lookahad symbols o h nd of ach LR(0) im, giving wha is calld an LR(1) im. Think of an LR(1) im such as \ra. v, 14

15 0 p ->. - ->., L1 L1 ->. v, L2 ->. f ( ), L2 v ->. i, L2 f ->. i, L3 v i 1 - p -> >., L1 3 -> v., L2 v 4 i v -> i., L2 6 9 p -> -. L3 7 L1 ->., L1 L1 ->. v, L2 ->. f ( ), L2 v ->. i, L2 f f -> i., L3 f ->. i, L3 5 f 8 ( -> f. ( ), L2 -> f (. ), L2 Lgnd: L1 = - ) 10 L2 = -> f ( )., L2 L3 = ( Figur 5: LALR(1) machin for Grammar 3. as maning w could b a h lf nd of a handl for, and afr ha handl, w xpc o s ihr an $ or W add hs lookahads o h LR(0) machin in Fig. 4 by applying h following wo opraions rpadly unil nohing changs, saring wih mpy lookahad ss: If w s an im of h form A α.bβ, L 1 inasa(whrl is a s of lookahads, B is a nonrminal, and α and β ar squncs of 0 or mor rminal and nonrminal symbols), hn for vry ohr im in ha sam sa of h form B.γ, L 2, add h s of rminal symbols FIRST(βL 1 )ohsl 2. (Hr, w dfin FIRST(L 1 )o b simply L 1. Thrfor, FIRST(βL 1 ) is simply FIRST(β) ifβ dos no produc h mpy sring, and ohrwis i is FIRST(β) L 1 ɛ). If w s an im of h form A α.xβ, L 1 in a sa, hn find h ransiion from ha sa on symbol X and find im A αx.β, L 2 in h arg of ha ransiion. Add h symbols in L 1 o L 2. Applying hs opraions o h machin in Fig. 4 givs h LALR(1) machin in Fig

CPSC 211 Data Structures & Implementations (c) Texas A&M University [ 259] B-Trees

CPSC 211 Data Structures & Implementations (c) Texas A&M University [ 259] B-Trees CPSC 211 Daa Srucurs & Implmnaions (c) Txas A&M Univrsiy [ 259] B-Trs Th AVL r and rd-black r allowd som variaion in h lnghs of h diffrn roo-o-laf pahs. An alrnaiv ida is o mak sur ha all roo-o-laf pahs

More information

Homework #2: CMPT-379 Distributed on Oct 2; due on Oct 16 Anoop Sarkar

Homework #2: CMPT-379 Distributed on Oct 2; due on Oct 16 Anoop Sarkar Homwork #2: CMPT-379 Disribud on Oc 2 du on Oc 16 Anoop Sarkar anoop@cs.su.ca Rading or his homwork includs Chp 4 o h Dragon book. I ndd, rr o: hp://ldp.org/howto/lx-yacc-howto.hml Only submi answrs or

More information

Spring 2006 Process Dynamics, Operations, and Control Lesson 2: Mathematics Review

Spring 2006 Process Dynamics, Operations, and Control Lesson 2: Mathematics Review Spring 6 Procss Dynamics, Opraions, and Conrol.45 Lsson : Mahmaics Rviw. conx and dircion Imagin a sysm ha varis in im; w migh plo is oupu vs. im. A plo migh imply an quaion, and h quaion is usually an

More information

Final Exam : Solutions

Final Exam : Solutions Comp : Algorihm and Daa Srucur Final Exam : Soluion. Rcuriv Algorihm. (a) To bgin ind h mdian o {x, x,... x n }. Sinc vry numbr xcp on in h inrval [0, n] appar xacly onc in h li, w hav ha h mdian mu b

More information

Let s look again at the first order linear differential equation we are attempting to solve, in its standard form:

Let s look again at the first order linear differential equation we are attempting to solve, in its standard form: Th Ingraing Facor Mhod In h prvious xampls of simpl firs ordr ODEs, w found h soluions by algbraically spara h dpndn variabl- and h indpndn variabl- rms, and wri h wo sids of a givn quaion as drivaivs,

More information

UNIT #5 EXPONENTIAL AND LOGARITHMIC FUNCTIONS

UNIT #5 EXPONENTIAL AND LOGARITHMIC FUNCTIONS Answr Ky Nam: Da: UNIT # EXPONENTIAL AND LOGARITHMIC FUNCTIONS Par I Qusions. Th prssion is quivaln o () () 6 6 6. Th ponnial funcion y 6 could rwrin as y () y y 6 () y y (). Th prssion a is quivaln o

More information

Elementary Differential Equations and Boundary Value Problems

Elementary Differential Equations and Boundary Value Problems Elmnar Diffrnial Equaions and Boundar Valu Problms Boc. & DiPrima 9 h Ediion Chapr : Firs Ordr Diffrnial Equaions 00600 คณ ตศาสตร ว ศวกรรม สาขาว ชาว ศวกรรมคอมพ วเตอร ป การศ กษา /55 ผศ.ดร.อร ญญา ผศ.ดร.สมศ

More information

Lecture 1: Numerical Integration The Trapezoidal and Simpson s Rule

Lecture 1: Numerical Integration The Trapezoidal and Simpson s Rule Lcur : Numrical ngraion Th Trapzoidal and Simpson s Rul A problm Th probabiliy of a normally disribud (man µ and sandard dviaion σ ) vn occurring bwn h valus a and b is B A P( a x b) d () π whr a µ b -

More information

CSE 245: Computer Aided Circuit Simulation and Verification

CSE 245: Computer Aided Circuit Simulation and Verification CSE 45: Compur Aidd Circui Simulaion and Vrificaion Fall 4, Sp 8 Lcur : Dynamic Linar Sysm Oulin Tim Domain Analysis Sa Equaions RLC Nwork Analysis by Taylor Expansion Impuls Rspons in im domain Frquncy

More information

Midterm exam 2, April 7, 2009 (solutions)

Midterm exam 2, April 7, 2009 (solutions) Univrsiy of Pnnsylvania Dparmn of Mahmaics Mah 26 Honors Calculus II Spring Smsr 29 Prof Grassi, TA Ashr Aul Midrm xam 2, April 7, 29 (soluions) 1 Wri a basis for h spac of pairs (u, v) of smooh funcions

More information

Boyce/DiPrima 9 th ed, Ch 2.1: Linear Equations; Method of Integrating Factors

Boyce/DiPrima 9 th ed, Ch 2.1: Linear Equations; Method of Integrating Factors Boc/DiPrima 9 h d, Ch.: Linar Equaions; Mhod of Ingraing Facors Elmnar Diffrnial Equaions and Boundar Valu Problms, 9 h diion, b William E. Boc and Richard C. DiPrima, 009 b John Wil & Sons, Inc. A linar

More information

Transfer function and the Laplace transformation

Transfer function and the Laplace transformation Lab No PH-35 Porland Sa Univriy A. La Roa Tranfr funcion and h Laplac ranformaion. INTRODUTION. THE LAPLAE TRANSFORMATION L 3. TRANSFER FUNTIONS 4. ELETRIAL SYSTEMS Analyi of h hr baic paiv lmn R, and

More information

SOLUTIONS. 1. Consider two continuous random variables X and Y with joint p.d.f. f ( x, y ) = = = 15. Stepanov Dalpiaz

SOLUTIONS. 1. Consider two continuous random variables X and Y with joint p.d.f. f ( x, y ) = = = 15. Stepanov Dalpiaz STAT UIUC Pracic Problms #7 SOLUTIONS Spanov Dalpiaz Th following ar a numbr of pracic problms ha ma b hlpful for compling h homwor, and will lil b vr usful for suding for ams.. Considr wo coninuous random

More information

CS 6353 Compiler Construction, Homework #1. 1. Write regular expressions for the following informally described languages:

CS 6353 Compiler Construction, Homework #1. 1. Write regular expressions for the following informally described languages: CS 6353 Compilr Construction, Homwork #1 1. Writ rgular xprssions for th following informally dscribd languags: a. All strings of 0 s and 1 s with th substring 01*1. Answr: (0 1)*01*1(0 1)* b. All strings

More information

4.1 The Uniform Distribution Def n: A c.r.v. X has a continuous uniform distribution on [a, b] when its pdf is = 1 a x b

4.1 The Uniform Distribution Def n: A c.r.v. X has a continuous uniform distribution on [a, b] when its pdf is = 1 a x b 4. Th Uniform Disribuion Df n: A c.r.v. has a coninuous uniform disribuion on [a, b] whn is pdf is f x a x b b a Also, b + a b a µ E and V Ex4. Suppos, h lvl of unblivabiliy a any poin in a Transformrs

More information

Chapter 3: Fourier Representation of Signals and LTI Systems. Chih-Wei Liu

Chapter 3: Fourier Representation of Signals and LTI Systems. Chih-Wei Liu Chapr 3: Fourir Rprsnaion of Signals and LTI Sysms Chih-Wi Liu Oulin Inroducion Complx Sinusoids and Frquncy Rspons Fourir Rprsnaions for Four Classs of Signals Discr-im Priodic Signals Fourir Sris Coninuous-im

More information

2.1. Differential Equations and Solutions #3, 4, 17, 20, 24, 35

2.1. Differential Equations and Solutions #3, 4, 17, 20, 24, 35 MATH 5 PS # Summr 00.. Diffrnial Equaions and Soluions PS.# Show ha ()C #, 4, 7, 0, 4, 5 ( / ) is a gnral soluion of h diffrnial quaion. Us a compur or calculaor o skch h soluions for h givn valus of h

More information

Programming Languages CRN Test 1 Version 1 CMSC 4023 Autumn 2013

Programming Languages CRN Test 1 Version 1 CMSC 4023 Autumn 2013 Programming Languags CRN 12105 Ts 1 Vrsion 1 CMSC 4023 Auumn 2013 1. Wri your nam on your scanron in h spac labld NAME. 2. Wri CMSC 4023 in h spac labld SUBJECT. 3. Prin h s numbr and vrsion, T1/V1, in

More information

Economics 302 (Sec. 001) Intermediate Macroeconomic Theory and Policy (Spring 2011) 3/28/2012. UW Madison

Economics 302 (Sec. 001) Intermediate Macroeconomic Theory and Policy (Spring 2011) 3/28/2012. UW Madison Economics 302 (Sc. 001) Inrmdia Macroconomic Thory and Policy (Spring 2011) 3/28/2012 Insrucor: Prof. Mnzi Chinn Insrucor: Prof. Mnzi Chinn UW Madison 16 1 Consumpion Th Vry Forsighd dconsumr A vry forsighd

More information

DEPARTMENT OF ELECTRICAL &ELECTRONICS ENGINEERING SIGNALS AND SYSTEMS. Assoc. Prof. Dr. Burak Kelleci. Spring 2018

DEPARTMENT OF ELECTRICAL &ELECTRONICS ENGINEERING SIGNALS AND SYSTEMS. Assoc. Prof. Dr. Burak Kelleci. Spring 2018 DEPARTMENT OF ELECTRICAL &ELECTRONICS ENGINEERING SIGNALS AND SYSTEMS Aoc. Prof. Dr. Burak Kllci Spring 08 OUTLINE Th Laplac Tranform Rgion of convrgnc for Laplac ranform Invr Laplac ranform Gomric valuaion

More information

CHAPTER CHAPTER14. Expectations: The Basic Tools. Prepared by: Fernando Quijano and Yvonn Quijano

CHAPTER CHAPTER14. Expectations: The Basic Tools. Prepared by: Fernando Quijano and Yvonn Quijano Expcaions: Th Basic Prpard by: Frnando Quijano and Yvonn Quijano CHAPTER CHAPTER14 2006 Prnic Hall Businss Publishing Macroconomics, 4/ Olivir Blanchard 14-1 Today s Lcur Chapr 14:Expcaions: Th Basic Th

More information

Lecture 2: Current in RC circuit D.K.Pandey

Lecture 2: Current in RC circuit D.K.Pandey Lcur 2: urrn in circui harging of apacior hrough Rsisr L us considr a capacior of capacianc is conncd o a D sourc of.m.f. E hrough a rsisr of rsisanc R and a ky K in sris. Whn h ky K is swichd on, h charging

More information

On the Derivatives of Bessel and Modified Bessel Functions with Respect to the Order and the Argument

On the Derivatives of Bessel and Modified Bessel Functions with Respect to the Order and the Argument Inrnaional Rsarch Journal of Applid Basic Scincs 03 Aailabl onlin a wwwirjabscom ISSN 5-838X / Vol 4 (): 47-433 Scinc Eplorr Publicaions On h Driais of Bssl Modifid Bssl Funcions wih Rspc o h Ordr h Argumn

More information

14.02 Principles of Macroeconomics Problem Set 5 Fall 2005

14.02 Principles of Macroeconomics Problem Set 5 Fall 2005 40 Principls of Macroconomics Problm S 5 Fall 005 Posd: Wdnsday, Novmbr 6, 005 Du: Wdnsday, Novmbr 3, 005 Plas wri your nam AND your TA s nam on your problm s Thanks! Exrcis I Tru/Fals? Explain Dpnding

More information

Phys463.nb Conductivity. Another equivalent definition of the Fermi velocity is

Phys463.nb Conductivity. Another equivalent definition of the Fermi velocity is 39 Anohr quival dfiniion of h Fri vlociy is pf vf (6.4) If h rgy is a quadraic funcion of k H k L, hs wo dfiniions ar idical. If is NOT a quadraic funcion of k (which could happ as will b discussd in h

More information

5. An object moving along an x-coordinate axis with its scale measured in meters has a velocity of 6t

5. An object moving along an x-coordinate axis with its scale measured in meters has a velocity of 6t AP CALCULUS FINAL UNIT WORKSHEETS ACCELERATION, VELOCTIY AND POSITION In problms -, drmin h posiion funcion, (), from h givn informaion.. v (), () = 5. v ()5, () = b g. a (), v() =, () = -. a (), v() =

More information

1 Finite Automata and Regular Expressions

1 Finite Automata and Regular Expressions 1 Fini Auom nd Rgulr Exprion Moivion: Givn prn (rgulr xprion) for ring rching, w migh wn o convr i ino drminiic fini uomon or nondrminiic fini uomon o mk ring rching mor fficin; drminiic uomon only h o

More information

Ma/CS 6a Class 15: Flows and Bipartite Graphs

Ma/CS 6a Class 15: Flows and Bipartite Graphs //206 Ma/CS 6a Cla : Flow and Bipari Graph By Adam Shffr Rmindr: Flow Nwork A flow nwork i a digraph G = V, E, oghr wih a ourc vrx V, a ink vrx V, and a capaciy funcion c: E N. Capaciy Sourc 7 a b c d

More information

7.4 QUANTUM MECHANICAL TREATMENT OF FLUCTUATIONS *

7.4 QUANTUM MECHANICAL TREATMENT OF FLUCTUATIONS * Andri Tokmakoff, MIT Dparmn of Chmisry, 5/19/5 7-11 7.4 QUANTUM MECANICAL TREATMENT OF FLUCTUATIONS * Inroducion and Prviw Now h origin of frquncy flucuaions is inracions of our molcul (or mor approprialy

More information

The transition:transversion rate ratio vs. the T-ratio.

The transition:transversion rate ratio vs. the T-ratio. PhyloMah Lcur 8 by Dan Vandrpool March, 00 opics of Discussion ransiion:ransvrsion ra raio Kappa vs. ransiion:ransvrsion raio raio alculaing h xpcd numbr of subsiuions using marix algbra Why h nral im

More information

Chapter 2 The Derivative Business Calculus 99

Chapter 2 The Derivative Business Calculus 99 Chapr Th Drivaiv Businss Calculus 99 Scion 5: Drivaivs of Formulas In his scion, w ll g h rivaiv ruls ha will l us fin formulas for rivaivs whn our funcion coms o us as a formula. This is a vry algbraic

More information

cycle that does not cross any edges (including its own), then it has at least

cycle that does not cross any edges (including its own), then it has at least W prov th following thorm: Thorm If a K n is drawn in th plan in such a way that it has a hamiltonian cycl that dos not cross any dgs (including its own, thn it has at last n ( 4 48 π + O(n crossings Th

More information

Discussion 06 Solutions

Discussion 06 Solutions STAT Discussion Soluions Spring 8. Th wigh of fish in La Paradis follows a normal disribuion wih man of 8. lbs and sandard dviaion of. lbs. a) Wha proporion of fish ar bwn 9 lbs and lbs? æ 9-8. - 8. P

More information

CS 361 Meeting 12 10/3/18

CS 361 Meeting 12 10/3/18 CS 36 Mting 2 /3/8 Announcmnts. Homwork 4 is du Friday. If Friday is Mountain Day, homwork should b turnd in at my offic or th dpartmnt offic bfor 4. 2. Homwork 5 will b availabl ovr th wknd. 3. Our midtrm

More information

Double Slits in Space and Time

Double Slits in Space and Time Doubl Slis in Sac an Tim Gorg Jons As has bn ror rcnly in h mia, a am l by Grhar Paulus has monsra an inrsing chniqu for ionizing argon aoms by using ulra-shor lasr ulss. Each lasr uls is ffcivly on an

More information

Chapter 5 The Laplace Transform. x(t) input y(t) output Dynamic System

Chapter 5 The Laplace Transform. x(t) input y(t) output Dynamic System EE 422G No: Chapr 5 Inrucor: Chung Chapr 5 Th Laplac Tranform 5- Inroducion () Sym analyi inpu oupu Dynamic Sym Linar Dynamic ym: A procor which proc h inpu ignal o produc h oupu dy ( n) ( n dy ( n) +

More information

Consider a system of 2 simultaneous first order linear equations

Consider a system of 2 simultaneous first order linear equations Soluon of sysms of frs ordr lnar quaons onsdr a sysm of smulanous frs ordr lnar quaons a b c d I has h alrna mar-vcor rprsnaon a b c d Or, n shorhand A, f A s alrady known from con W know ha h abov sysm

More information

Charging of capacitor through inductor and resistor

Charging of capacitor through inductor and resistor cur 4&: R circui harging of capacior hrough inducor and rsisor us considr a capacior of capacianc is conncd o a D sourc of.m.f. E hrough a rsisr of rsisanc R, an inducor of inducanc and a y K in sris.

More information

Chemistry 988 Part 1

Chemistry 988 Part 1 Chmisry 988 Par 1 Radiaion Dcion & Masurmn Dp. of Chmisry --- Michigan Sa Univ. aional Suprconducing Cycloron Lab DJMorrissy Spring/2oo9 Cours informaion can b found on h wbsi: hp://www.chmisry.msu.du/courss/cm988uclar/indx.hml

More information

Applied Statistics and Probability for Engineers, 6 th edition October 17, 2016

Applied Statistics and Probability for Engineers, 6 th edition October 17, 2016 Applid Saisics and robabiliy for Enginrs, 6 h diion Ocobr 7, 6 CHATER Scion - -. a d. 679.. b. d. 88 c d d d. 987 d. 98 f d.. Thn, = ln. =. g d.. Thn, = ln.9 =.. -7. a., by symmry. b.. d...6. 7.. c...

More information

Microscopic Flow Characteristics Time Headway - Distribution

Microscopic Flow Characteristics Time Headway - Distribution CE57: Traffic Flow Thory Spring 20 Wk 2 Modling Hadway Disribuion Microscopic Flow Characrisics Tim Hadway - Disribuion Tim Hadway Dfiniion Tim Hadway vrsus Gap Ahmd Abdl-Rahim Civil Enginring Dparmn,

More information

EEO 401 Digital Signal Processing Prof. Mark Fowler

EEO 401 Digital Signal Processing Prof. Mark Fowler EEO 401 Digital Signal Procssing Prof. Mark Fowlr Dtails of th ot St #19 Rading Assignmnt: Sct. 7.1.2, 7.1.3, & 7.2 of Proakis & Manolakis Dfinition of th So Givn signal data points x[n] for n = 0,, -1

More information

u x v x dx u x v x v x u x dx d u x v x u x v x dx u x v x dx Integration by Parts Formula

u x v x dx u x v x v x u x dx d u x v x u x v x dx u x v x dx Integration by Parts Formula 7. Intgration by Parts Each drivativ formula givs ris to a corrsponding intgral formula, as w v sn many tims. Th drivativ product rul yilds a vry usful intgration tchniqu calld intgration by parts. Starting

More information

Voltage v(z) ~ E(z)D. We can actually get to this wave behavior by using circuit theory, w/o going into details of the EM fields!

Voltage v(z) ~ E(z)D. We can actually get to this wave behavior by using circuit theory, w/o going into details of the EM fields! Considr a pair of wirs idal wirs ngh >, say, infinily long olag along a cabl can vary! D olag v( E(D W can acually g o his wav bhavior by using circui hory, w/o going ino dails of h EM filds! Thr

More information

Logistic equation of Human population growth (generalization to the case of reactive environment).

Logistic equation of Human population growth (generalization to the case of reactive environment). Logisic quaion of Human populaion growh gnralizaion o h cas of raciv nvironmn. Srg V. Ershkov Insiu for Tim aur Exploraions M.V. Lomonosov's Moscow Sa Univrsi Lninski gor - Moscow 999 ussia -mail: srgj-rshkov@andx.ru

More information

u r du = ur+1 r + 1 du = ln u + C u sin u du = cos u + C cos u du = sin u + C sec u tan u du = sec u + C e u du = e u + C

u r du = ur+1 r + 1 du = ln u + C u sin u du = cos u + C cos u du = sin u + C sec u tan u du = sec u + C e u du = e u + C Tchniqus of Intgration c Donald Kridr and Dwight Lahr In this sction w ar going to introduc th first approachs to valuating an indfinit intgral whos intgrand dos not hav an immdiat antidrivativ. W bgin

More information

SECTION where P (cos θ, sin θ) and Q(cos θ, sin θ) are polynomials in cos θ and sin θ, provided Q is never equal to zero.

SECTION where P (cos θ, sin θ) and Q(cos θ, sin θ) are polynomials in cos θ and sin θ, provided Q is never equal to zero. SETION 6. 57 6. Evaluation of Dfinit Intgrals Exampl 6.6 W hav usd dfinit intgrals to valuat contour intgrals. It may com as a surpris to larn that contour intgrals and rsidus can b usd to valuat crtain

More information

Wave Equation (2 Week)

Wave Equation (2 Week) Rfrnc Wav quaion ( Wk 6.5 Tim-armonic filds 7. Ovrviw 7. Plan Wavs in Losslss Mdia 7.3 Plan Wavs in Loss Mdia 7.5 Flow of lcromagnic Powr and h Poning Vcor 7.6 Normal Incidnc of Plan Wavs a Plan Boundaris

More information

Problem Set 6 Solutions

Problem Set 6 Solutions 6.04/18.06J Mathmatics for Computr Scinc March 15, 005 Srini Dvadas and Eric Lhman Problm St 6 Solutions Du: Monday, March 8 at 9 PM in Room 3-044 Problm 1. Sammy th Shark is a financial srvic providr

More information

MEM 355 Performance Enhancement of Dynamical Systems A First Control Problem - Cruise Control

MEM 355 Performance Enhancement of Dynamical Systems A First Control Problem - Cruise Control MEM 355 Prformanc Enhancmn of Dynamical Sysms A Firs Conrol Problm - Cruis Conrol Harry G. Kwany Darmn of Mchanical Enginring & Mchanics Drxl Univrsiy Cruis Conrol ( ) mv = F mg sinθ cv v +.2v= u 9.8θ

More information

Advanced Queueing Theory. M/G/1 Queueing Systems

Advanced Queueing Theory. M/G/1 Queueing Systems Advand Quung Thory Ths slds ar rad by Dr. Yh Huang of Gorg Mason Unvrsy. Sudns rgsrd n Dr. Huang's ourss a GMU an ma a sngl mahn-radabl opy and prn a sngl opy of ah sld for hr own rfrn, so long as ah sld

More information

EXERCISE - 01 CHECK YOUR GRASP

EXERCISE - 01 CHECK YOUR GRASP DIFFERENTIAL EQUATION EXERCISE - CHECK YOUR GRASP 7. m hn D() m m, D () m m. hn givn D () m m D D D + m m m m m m + m m m m + ( m ) (m ) (m ) (m + ) m,, Hnc numbr of valus of mn will b. n ( ) + c sinc

More information

Control System Engineering (EE301T) Assignment: 2

Control System Engineering (EE301T) Assignment: 2 Conrol Sysm Enginring (EE0T) Assignmn: PART-A (Tim Domain Analysis: Transin Rspons Analysis). Oain h rspons of a uniy fdack sysm whos opn-loop ransfr funcion is (s) s ( s 4) for a uni sp inpu and also

More information

An Indian Journal FULL PAPER. Trade Science Inc. A stage-structured model of a single-species with density-dependent and birth pulses ABSTRACT

An Indian Journal FULL PAPER. Trade Science Inc. A stage-structured model of a single-species with density-dependent and birth pulses ABSTRACT [Typ x] [Typ x] [Typ x] ISSN : 974-7435 Volum 1 Issu 24 BioTchnology 214 An Indian Journal FULL PAPE BTAIJ, 1(24), 214 [15197-1521] A sag-srucurd modl of a singl-spcis wih dnsiy-dpndn and birh pulss LI

More information

Alpha and beta decay equation practice

Alpha and beta decay equation practice Alpha and bta dcay quation practic Introduction Alpha and bta particls may b rprsntd in quations in svral diffrnt ways. Diffrnt xam boards hav thir own prfrnc. For xampl: Alpha Bta α β alpha bta Dspit

More information

Institute of Actuaries of India

Institute of Actuaries of India Insiu of Acuaris of India ubjc CT3 Probabiliy and Mahmaical aisics Novmbr Examinaions INDICATIVE OLUTION Pag of IAI CT3 Novmbr ol. a sampl man = 35 sampl sandard dviaion = 36.6 b for = uppr bound = 35+*36.6

More information

Lecture 4: Laplace Transforms

Lecture 4: Laplace Transforms Lur 4: Lapla Transforms Lapla and rlad ransformaions an b usd o solv diffrnial quaion and o rdu priodi nois in signals and imags. Basially, hy onvr h drivaiv opraions ino mulipliaion, diffrnial quaions

More information

1 Minimum Cut Problem

1 Minimum Cut Problem CS 6 Lctur 6 Min Cut and argr s Algorithm Scribs: Png Hui How (05), Virginia Dat: May 4, 06 Minimum Cut Problm Today, w introduc th minimum cut problm. This problm has many motivations, on of which coms

More information

COHORT MBA. Exponential function. MATH review (part2) by Lucian Mitroiu. The LOG and EXP functions. Properties: e e. lim.

COHORT MBA. Exponential function. MATH review (part2) by Lucian Mitroiu. The LOG and EXP functions. Properties: e e. lim. MTH rviw part b Lucian Mitroiu Th LOG and EXP functions Th ponntial function p : R, dfind as Proprtis: lim > lim p Eponntial function Y 8 6 - -8-6 - - X Th natural logarithm function ln in US- log: function

More information

Continous system: differential equations

Continous system: differential equations /6/008 Coious sysm: diffrial quaios Drmiisic modls drivaivs isad of (+)-( r( compar ( + ) R( + r ( (0) ( R ( 0 ) ( Dcid wha hav a ffc o h sysm Drmi whhr h paramrs ar posiiv or gaiv, i.. giv growh or rducio

More information

PhysicsAndMathsTutor.com

PhysicsAndMathsTutor.com C3 Eponnials and logarihms - Eponnial quaions. Rabbis wr inroducd ono an island. Th numbr of rabbis, P, yars afr hy wr inroducd is modlld by h quaion P = 3 0, 0 (a) Wri down h numbr of rabbis ha wr inroducd

More information

Physics 160 Lecture 3. R. Johnson April 6, 2015

Physics 160 Lecture 3. R. Johnson April 6, 2015 Physics 6 Lcur 3 R. Johnson April 6, 5 RC Circui (Low-Pass Filr This is h sam RC circui w lookd a arlir h im doma, bu hr w ar rsd h frquncy rspons. So w pu a s wav sad of a sp funcion. whr R C RC Complx

More information

COMPUTER GENERATED HOLOGRAMS Optical Sciences 627 W.J. Dallas (Monday, April 04, 2005, 8:35 AM) PART I: CHAPTER TWO COMB MATH.

COMPUTER GENERATED HOLOGRAMS Optical Sciences 627 W.J. Dallas (Monday, April 04, 2005, 8:35 AM) PART I: CHAPTER TWO COMB MATH. C:\Dallas\0_Courss\03A_OpSci_67\0 Cgh_Book\0_athmaticalPrliminaris\0_0 Combath.doc of 8 COPUTER GENERATED HOLOGRAS Optical Scincs 67 W.J. Dallas (onday, April 04, 005, 8:35 A) PART I: CHAPTER TWO COB ATH

More information

Revisiting what you have learned in Advanced Mathematical Analysis

Revisiting what you have learned in Advanced Mathematical Analysis Fourir sris Rvisiing wh you hv lrnd in Advncd Mhmicl Anlysis L f x b priodic funcion of priod nd is ingrbl ovr priod. f x cn b rprsnd by rigonomric sris, f x n cos nx bn sin nx n cos x b sin x cosx b whr

More information

LaPlace Transform in Circuit Analysis

LaPlace Transform in Circuit Analysis LaPlac Tranform in Circui Analyi Obciv: Calcula h Laplac ranform of common funcion uing h dfiniion and h Laplac ranform abl Laplac-ranform a circui, including componn wih non-zro iniial condiion. Analyz

More information

Higher order derivatives

Higher order derivatives Robrto s Nots on Diffrntial Calculus Chaptr 4: Basic diffrntiation ruls Sction 7 Highr ordr drivativs What you nd to know alrady: Basic diffrntiation ruls. What you can larn hr: How to rpat th procss of

More information

Fishing limits and the Logistic Equation. 1

Fishing limits and the Logistic Equation. 1 Fishing limis and he Logisic Equaion. 1 1. The Logisic Equaion. The logisic equaion is an equaion governing populaion growh for populaions in an environmen wih a limied amoun of resources (for insance,

More information

Random Access Techniques: ALOHA (cont.)

Random Access Techniques: ALOHA (cont.) Random Accss Tchniqus: ALOHA (cont.) 1 Exampl [ Aloha avoiding collision ] A pur ALOHA ntwork transmits a 200-bit fram on a shard channl Of 200 kbps at tim. What is th rquirmnt to mak this fram collision

More information

14.02 Principles of Macroeconomics Fall 2005 Quiz 3 Solutions

14.02 Principles of Macroeconomics Fall 2005 Quiz 3 Solutions 4.0 rincipl of Macroconomic Fall 005 Quiz 3 Soluion Shor Quion (30/00 poin la a whhr h following amn ar TRUE or FALSE wih a hor xplanaion (3 or 4 lin. Each quion coun 5/00 poin.. An incra in ax oday alway

More information

Part I: Short Answer [50 points] For each of the following, give a short answer (2-3 sentences, or a formula). [5 points each]

Part I: Short Answer [50 points] For each of the following, give a short answer (2-3 sentences, or a formula). [5 points each] Soluions o Midrm Exam Nam: Paricl Physics Fall 0 Ocobr 6 0 Par I: Shor Answr [50 poins] For ach of h following giv a shor answr (- snncs or a formula) [5 poins ach] Explain qualiaivly (a) how w acclra

More information

Brief Introduction to Statistical Mechanics

Brief Introduction to Statistical Mechanics Brif Introduction to Statistical Mchanics. Purpos: Ths nots ar intndd to provid a vry quick introduction to Statistical Mchanics. Th fild is of cours far mor vast than could b containd in ths fw pags.

More information

whereby we can express the phase by any one of the formulas cos ( 3 whereby we can express the phase by any one of the formulas

whereby we can express the phase by any one of the formulas cos ( 3 whereby we can express the phase by any one of the formulas Third In-Class Exam Soluions Mah 6, Profssor David Lvrmor Tusday, 5 April 07 [0] Th vrical displacmn of an unforcd mass on a spring is givn by h 5 3 cos 3 sin a [] Is his sysm undampd, undr dampd, criically

More information

Laplace transfom: t-translation rule , Haynes Miller and Jeremy Orloff

Laplace transfom: t-translation rule , Haynes Miller and Jeremy Orloff Laplace ransfom: -ranslaion rule 8.03, Haynes Miller and Jeremy Orloff Inroducory example Consider he sysem ẋ + 3x = f(, where f is he inpu and x he response. We know is uni impulse response is 0 for

More information

Summary: Solving a Homogeneous System of Two Linear First Order Equations in Two Unknowns

Summary: Solving a Homogeneous System of Two Linear First Order Equations in Two Unknowns Summary: Solvng a Homognous Sysm of Two Lnar Frs Ordr Equaons n Two Unknowns Gvn: A Frs fnd h wo gnvalus, r, and hr rspcv corrspondng gnvcors, k, of h coffcn mar A Dpndng on h gnvalus and gnvcors, h gnral

More information

The Variance-Covariance Matrix

The Variance-Covariance Matrix Th Varanc-Covaranc Marx Our bggs a so-ar has bn ng a lnar uncon o a s o daa by mnmzng h las squars drncs rom h o h daa wh mnsarch. Whn analyzng non-lnar daa you hav o us a program l Malab as many yps o

More information

DE Dr. M. Sakalli

DE Dr. M. Sakalli DE-0 Dr. M. Sakalli DE 55 M. Sakalli a n n 0 a Lh.: an Linar g Equaions Hr if g 0 homognous non-homognous ohrwis driving b a forc. You know h quaions blow alrad. A linar firs ordr ODE has h gnral form

More information

Copyright 2012 Pearson Education, Inc. Publishing as Prentice Hall.

Copyright 2012 Pearson Education, Inc. Publishing as Prentice Hall. Chapr Rviw 0 6. ( a a ln a. This will qual a if an onl if ln a, or a. + k an (ln + c. Thrfor, a an valu of, whr h wo curvs inrsc, h wo angn lins will b prpnicular. 6. (a Sinc h lin passs hrough h origin

More information

AR(1) Process. The first-order autoregressive process, AR(1) is. where e t is WN(0, σ 2 )

AR(1) Process. The first-order autoregressive process, AR(1) is. where e t is WN(0, σ 2 ) AR() Procss Th firs-ordr auorgrssiv procss, AR() is whr is WN(0, σ ) Condiional Man and Varianc of AR() Condiional man: Condiional varianc: ) ( ) ( Ω Ω E E ) var( ) ) ( var( ) var( σ Ω Ω Ω Ω E Auocovarianc

More information

4. Money cannot be neutral in the short-run the neutrality of money is exclusively a medium run phenomenon.

4. Money cannot be neutral in the short-run the neutrality of money is exclusively a medium run phenomenon. PART I TRUE/FALSE/UNCERTAIN (5 points ach) 1. Lik xpansionary montary policy, xpansionary fiscal policy rturns output in th mdium run to its natural lvl, and incrass prics. Thrfor, fiscal policy is also

More information

Lecture 4: Parsing. Administrivia

Lecture 4: Parsing. Administrivia Adminitrivia Lctur 4: Paring If you do not hav a group, pla pot a rqut on Piazzza ( th Form projct tam... itm. B ur to updat your pot if you find on. W will aign orphan to group randomly in a fw day. Programming

More information

I) Title: Rational Expectations and Adaptive Learning. II) Contents: Introduction to Adaptive Learning

I) Title: Rational Expectations and Adaptive Learning. II) Contents: Introduction to Adaptive Learning I) Til: Raional Expcaions and Adapiv Larning II) Conns: Inroducion o Adapiv Larning III) Documnaion: - Basdvan, Olivir. (2003). Larning procss and raional xpcaions: an analysis using a small macroconomic

More information

Instructors Solution for Assignment 3 Chapter 3: Time Domain Analysis of LTIC Systems

Instructors Solution for Assignment 3 Chapter 3: Time Domain Analysis of LTIC Systems Inrucor Soluion for Aignmn Chapr : Tim Domain Anali of LTIC Sm Problm i a 8 x x wih x u,, an Zro-inpu rpon of h m: Th characriic quaion of h LTIC m i i 8, which ha roo a ± j Th zro-inpu rpon i givn b zi

More information

Roadmap. XML Indexing. DataGuide example. DataGuides. Strong DataGuides. Multiple DataGuides for same data. CPS Topics in Database Systems

Roadmap. XML Indexing. DataGuide example. DataGuides. Strong DataGuides. Multiple DataGuides for same data. CPS Topics in Database Systems Roadmap XML Indxing CPS 296.1 Topics in Databas Systms Indx fabric Coopr t al. A Fast Indx for Smistructurd Data. VLDB, 2001 DataGuid Goldman and Widom. DataGuids: Enabling Qury Formulation and Optimization

More information

1 Isoparametric Concept

1 Isoparametric Concept UNIVERSITY OF CALIFORNIA BERKELEY Dpartmnt of Civil Enginring Spring 06 Structural Enginring, Mchanics and Matrials Profssor: S. Govindj Nots on D isoparamtric lmnts Isoparamtric Concpt Th isoparamtric

More information

On the Speed of Heat Wave. Mihály Makai

On the Speed of Heat Wave. Mihály Makai On h Spd of Ha Wa Mihály Maai maai@ra.bm.hu Conns Formulaion of h problm: infini spd? Local hrmal qulibrium (LTE hypohsis Balanc quaion Phnomnological balanc Spd of ha wa Applicaion in plasma ranspor 1.

More information

General Notes About 2007 AP Physics Scoring Guidelines

General Notes About 2007 AP Physics Scoring Guidelines AP PHYSICS C: ELECTRICITY AND MAGNETISM 2007 SCORING GUIDELINES Gnral Nots About 2007 AP Physics Scoring Guidlins 1. Th solutions contain th most common mthod of solving th fr-rspons qustions and th allocation

More information

3(8 ) (8 x x ) 3x x (8 )

3(8 ) (8 x x ) 3x x (8 ) Scion - CHATER -. a d.. b. d.86 c d 8 d d.9997 f g 6. d. d. Thn, = ln. =. =.. d Thn, = ln.9 =.7 8 -. a d.6 6 6 6 6 8 8 8 b 9 d 6 6 6 8 c d.8 6 6 6 6 8 8 7 7 d 6 d.6 6 6 6 6 6 6 8 u u u u du.9 6 6 6 6 6

More information

22/ Breakdown of the Born-Oppenheimer approximation. Selection rules for rotational-vibrational transitions. P, R branches.

22/ Breakdown of the Born-Oppenheimer approximation. Selection rules for rotational-vibrational transitions. P, R branches. Subjct Chmistry Papr No and Titl Modul No and Titl Modul Tag 8/ Physical Spctroscopy / Brakdown of th Born-Oppnhimr approximation. Slction ruls for rotational-vibrational transitions. P, R branchs. CHE_P8_M

More information

Ch. 24 Molecular Reaction Dynamics 1. Collision Theory

Ch. 24 Molecular Reaction Dynamics 1. Collision Theory Ch. 4 Molcular Raction Dynamics 1. Collision Thory Lctur 16. Diffusion-Controlld Raction 3. Th Matrial Balanc Equation 4. Transition Stat Thory: Th Eyring Equation 5. Transition Stat Thory: Thrmodynamic

More information

1 General boundary conditions in diffusion

1 General boundary conditions in diffusion Gnral boundary conditions in diffusion Πρόβλημα 4.8 : Δίνεται μονοδιάτατη πλάκα πάχους, που το ένα άκρο της κρατιέται ε θερμοκραία T t και το άλλο ε θερμοκραία T 2 t. Αν η αρχική θερμοκραία της πλάκας

More information

Lagrangian for RLC circuits using analogy with the classical mechanics concepts

Lagrangian for RLC circuits using analogy with the classical mechanics concepts Lagrangian for RLC circuis using analogy wih h classical mchanics concps Albrus Hariwangsa Panuluh and Asan Damanik Dparmn of Physics Educaion, Sanaa Dharma Univrsiy Kampus III USD Paingan, Maguwoharjo,

More information

General Article Application of differential equation in L-R and C-R circuit analysis by classical method. Abstract

General Article Application of differential equation in L-R and C-R circuit analysis by classical method. Abstract Applicaion of Diffrnial... Gnral Aricl Applicaion of diffrnial uaion in - and C- circui analysis by classical mhod. ajndra Prasad gmi curr, Dparmn of Mahmaics, P.N. Campus, Pokhara Email: rajndraprasadrgmi@yahoo.com

More information

EECE 301 Signals & Systems Prof. Mark Fowler

EECE 301 Signals & Systems Prof. Mark Fowler EECE 301 Signals & Systms Prof. Mark Fowlr ot St #21 D-T Signals: Rlation btwn DFT, DTFT, & CTFT 1/16 W can us th DFT to implmnt numrical FT procssing This nabls us to numrically analyz a signal to find

More information

THE SHORT-RUN AGGREGATE SUPPLY CURVE WITH A POSITIVE SLOPE. Based on EXPECTATIONS: Lecture. t t t t

THE SHORT-RUN AGGREGATE SUPPLY CURVE WITH A POSITIVE SLOPE. Based on EXPECTATIONS: Lecture. t t t t THE SHORT-RUN AGGREGATE SUL CURVE WITH A OSITIVE SLOE. Basd on EXECTATIONS: Lcur., 0. In Mankiw:, 0 Ths quaions sa ha oupu dvias from is naural ra whn h pric lvl dvias from h xpcd pric lvl. Th paramr a

More information

10. If p and q are the lengths of the perpendiculars from the origin on the tangent and the normal to the curve

10. If p and q are the lengths of the perpendiculars from the origin on the tangent and the normal to the curve 0. If p and q ar h lnghs of h prpndiculars from h origin on h angn and h normal o h curv + Mahmaics y = a, hn 4p + q = a a (C) a (D) 5a 6. Wha is h diffrnial quaion of h family of circls having hir cnrs

More information

Chapter 10. The singular integral Introducing S(n) and J(n)

Chapter 10. The singular integral Introducing S(n) and J(n) Chaptr Th singular intgral Our aim in this chaptr is to rplac th functions S (n) and J (n) by mor convnint xprssions; ths will b calld th singular sris S(n) and th singular intgral J(n). This will b don

More information

Economics 302 (Sec. 001) Intermediate Macroeconomic Theory and Policy (Spring 2011) 4/25/2011. UW Madison

Economics 302 (Sec. 001) Intermediate Macroeconomic Theory and Policy (Spring 2011) 4/25/2011. UW Madison conomics 302 (Sc. 001) Inrmdia Macroconomic Thory and Policy (Spring 2011) 4/25/2011 Insrucor: Prof. Mnzi Chinn Insrucor: Prof. Mnzi Chinn UW Madison 21 1 Th Mdium Run ε = P * P Thr ar wo ways in which

More information

FIRST-ORDER SYSTEMS OF ORDINARY DIFFERENTIAL EQUATIONS I: Introduction and Linear Systems

FIRST-ORDER SYSTEMS OF ORDINARY DIFFERENTIAL EQUATIONS I: Introduction and Linear Systems FIRST-ORDER SYSTEMS OF ORDINARY DIFFERENTIAL EQUATIONS I: Inroducion and Linar Sysms David Lvrmor Dparmn of Mahmaics Univrsiy of Maryland 9 Dcmbr 0 Bcaus h prsnaion of his marial in lcur will diffr from

More information

That is, we start with a general matrix: And end with a simpler matrix:

That is, we start with a general matrix: And end with a simpler matrix: DIAGON ALIZATION OF THE STR ESS TEN SOR INTRO DUCTIO N By th us of Cauchy s thorm w ar abl to rduc th numbr of strss componnts in th strss tnsor to only nin valus. An additional simplification of th strss

More information