ITI Introduction to Computing II

Size: px
Start display at page:

Download "ITI Introduction to Computing II"

Transcription

1 ITI Intoduction to Computing II Mcel Tucotte School of Electicl Engineeing nd Compute Science Abstct dt type: Stck Stck-bsed lgoithms Vesion of Febuy 2, 2013 Abstct These lectue notes e ment to be looked t on compute sceen. Do not pint them unless it is necessy.

2 Evluting ithmetic expessions Stck-bsed lgoithms e used fo syntcticl nlysis (psing). Fo exmple to evlute the following expession: Compiles use simil lgoithms to check the syntx of you pogms nd genete mchine instuctions (executble). To veify tht pentheses e blnced: ([]) is ok, but not ([)] o )((())(.

3 The fist two steps of the nlysis of souce pogm by compile e the lexicl nlysis nd the syntcticl nlysis. Duing the lexicl nlysis (scnning) the souce code is ed fom left to ight nd the chctes e egouped into tokens, which e successive chctes tht constitute numbes o identifies. One of the tsks of the lexicl nlyse is to emove spces fom the input. E.g.: whee epesent blnk spces, is tnsfomed into the following list of tokens: [10,+,2,+,300]

4 The next step is the syntcticl nlysis (psing) nd consists in egouping the tokens into gmmticl units, fo exmple the sub-expessions of RPN expessions (seen in clss this week). In the next slides, we look t simple exmples of lexicl nd syntcticl nlysis.

5 public clss Test { public sttic void scn( Sting expession ) { Rede ede = new Rede( expession ); } while ( ede.hsmoetokens() ) { System.out.pintln( ede.nexttoken() ); } public sttic void min( Sting[] gs ) { scn( " * 567 " ); } } // > jv Test // INTEGER: 3 // SYMBOL: + // INTEGER: 4 // SYMBOL: * // INTEGER: 567

6 public clss Token { pivte sttic finl int INTEGER = 1; pivte sttic finl int SYMBOL = 2; pivte int ivlue; pivte Sting svlue; pivte int type; public Token( int ivlue ) { this.ivlue = ivlue; type = INTEGER; } public Token( Sting svlue ) { this.svlue = svlue; type = SYMBOL; } public int ivlue() {... } public Sting svlue() {... } } public boolen isintege() { etun type == INTEGER; } public boolen issymbol() { etun type == SYMBOL; }

7 LR Scn public sttic int execute( Sting expession ) { Token op = null; int l = 0, = 0; Rede ede = new Rede( expession ); l = ede.nexttoken().ivlue(); } while ( ede.hsmoetokens() ) { op = ede.nexttoken(); = ede.nexttoken().ivlue(); l = evl( op, l, ); } etun l;

8 evl( Token op, int l, int ) public sttic int evl( Token op, int l, int ) { int esult = 0; if ( op.svlue().equls( "+" ) ) esult = l + ; else if ( op.svlue().equls( "-" ) ) esult = l - ; else if ( op.svlue().equls( "*" ) ) esult = l * ; else if ( op.svlue().equls( "/" ) ) esult = l / ; else System.e.pintln( "not vlid symbol" ); } etun esult;

9 Evluting n ithmetic expession: LR Scn Left-to-ight lgoithm: Decle L, R nd OP Red L While not end-of-expession do: Red OP Red R Evlute L OP R Stoe esult in L At the end of the loop the esult cn be found in L.

10 3 * 8-10

11 ^ L = 3 OP = R = > Red L While not end-of-expession do: Red OP Red R Evlute L OP R Stoe esult in L

12 ^ L = 3 OP = + R = Red L While not end-of-expession do: > Red OP Red R Evlute L OP R Stoe esult in L

13 ^ L = 3 OP = + R = 4 Red L While not end-of-expession do: Red OP > Red R Evlute L OP R Stoe esult in L

14 ^ L = 3 OP = + R = 4 Red L While not end-of-expession do: Red OP Red R > Evlute L OP R (7) Stoe esult in L

15 ^ L = 7 OP = + R = 4 Red L While not end-of-expession do: Red OP Red R Evlute L OP R > Stoe esult in L

16 ^ L = 7 OP = - R = 4 Red L While not end-of-expession do: > Red OP Red R Evlute L OP R Stoe esult in L

17 ^ L = 7 OP = - R = 5 Red L While not end-of-expession do: Red OP > Red R Evlute L OP R Stoe esult in L

18 ^ L = 7 OP = - R = 5 Red L While not end-of-expession do: Red OP Red R > Evlute L OP R (2) Stoe esult in L

19 ^ L = 2 OP = - R = 5 Red L While not end-of-expession do: Red OP Red R Evlute L OP R > Stoe esult in L

20 ^ L = 2 OP = - R = 5 > Red L While not end-of-expession do: Red OP Red R Evlute L OP R Stoe esult in L end of expession, exit the loop, L contins the esult.

21 Wht do you think? Without pentheses the following expession cnnot be evluted coectly: 7 - (3-2) Becuse the esult of the left-to-ight nlysis coesponds to: (7-3) - 2 Similly the following expession cnnot be evluted by ou simple lgoithm: 7-3 * 2 Since the left-to-ight nlysis coesponds to: (7-3) * 2 But ccoding to the opeto pecedences, the evlution should hve poceeded s follows: 7 - (3 * 2)

22 Remks The left-to-ight lgoithm: Does not hndle pentheses; No pecedence. Solutions: 1. Use diffeent nottion; 2. Develop moe complex lgoithms. Both solutions involve stcks!

23 Nottions Thee e 3 wys to epesent the following expession: L OP R. infix: this is the usul nottion, the opeto is sndwiched in between its opends: L OP R; postfix: in postfix nottion, the opends e plced befoe the opeto, L R OP. This nottion is lso clled Revese Polish Nottion o RPN, it s the nottion used by cetin scientific clcultos (such s the HP-35 fom Hewlett-Pckd o the Texs Instuments TI-89 using the RPN Intefce by Ls Fedeiksen 1 ) o PostScipt pogmming lnguge. 7 - (3-2) = (7-3) - 2 = pefix: the thid nottion consists in plcing the opeto befoe the opends, OP L R. The pogmming lnguge Lisp uses combintion of pentheses nd pefix nottion: (- 7 (* 3 2)). 1

24 Infix postfix (mentlly) Successively tnsfom, one by one, ll the sub-expessions following the sme ode of evlution tht you would nomlly follow to evlute n infix expession. An infix expession l becomes l, whee l nd e sub-expessions nd is n opeto.

25 9 / ( ) 9 / ( 2 }{{} l 9 / ( l {}}{ 2 }{{} {}}{ 4 4 }{{} 5 ) {}}{ 5 ) 9 / ( [ 2 4 ] 5 ) 9 / ( [ 2 4 ] }{{} l l {}}{ 9 / [ [ 2 4 ] 9 }{{} l l {}}{ 9 }{{} {}}{ 5 9 / [ ] / }{{} 5 }{{} ) {}}{ ] [ ] }{{} {}}{ [ ] / {}}{ /

26 Evluting postfix expession (mentlly) Scn the expession fom left to ight. When the cuent element is n opeto, pply the opeto to its opends, i.e. eplce l by the esult of the evlution of l. 9 2 }{{} l / 9 9 }{{} 8 l 9 }{{} 9 l }{{} 4 l {}}{ }{{} 8 5 / }{{} 5 }{{} l {}}{ 3 / 3 }{{} l {}}{ 3 / }{{} 5 / /

27 Evluting postfix expession Until the end of the expession hs been eched: 1. Fom left to ight until the fist opeto; 2. Apply the opeto to the two peceding opends; 3. Replce the opeto nd its opends by the esult. At the end we hve esult.

28 9 3 / * - +

29 9 2 4 * 5 - /

30 Remks: infix vs postfix The ode of the opends is the sme fo both nottions, howeve opetos e inseted t diffeent plces: 2 + (3 * 4) = * + (2 + 3) * 4 = * Evluting n infix expession involves hndling opetos pecedence nd penthesis in the cse of the postfix nottion, those two concepts e embedded in the expession, i.e. the ode of the opends nd opetos.

31 Wht ole will the stck be plying? opends = new stck; Algoithm: Evl Infix while ( "hs moe tokens" ) { t = next token; if ( "t is n opend" ) { opends.push( "the intege vlue of t" ); } else { // this is n opeto op = "opeto vlue of t"; = opends.pop(); l = opends.pop(); opends.push( "evl( l, op, )" ); } } etun opends.pop();

32 Evluting postfix expession The lgoithm equies stck (Numbes), vible tht contins the lst element tht ws ed (X) nd two moe vibles, L nd R, whose pupose is the sme s befoe. Numbes = [ While not end-of-expession do: Red X If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes (ight befoe left?!) L = POP Numbes Evlute L X R; PUSH esult onto Numbes To obtin the finl esult: POP Numbes.

33 9 3-2 /

34 9 3 / * - +

35 9 / ((2 * 4) - 5) = * 5 - / ^ > Numbes = [ X = L = R = While not end-of-expession do: Red X If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes L = POP Numbes Evlute L X R; PUSH esult onto Numbes Cete new stck

36 9 / ((2 * 4) - 5) = * 5 - / ^ Numbes = [ X = 9 L = R = While not end-of-expession do: > Red X If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes L = POP Numbes Evlute L X R; PUSH esult onto Numbes Red X

37 9 / ((2 * 4) - 5) = * 5 - / ^ Numbes = [9 X = 9 L = R = While not end-of-expession do: Red X > If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes L = POP Numbes Evlute L X R; PUSH esult onto Numbes Push X

38 9 / ((2 * 4) - 5) = * 5 - / ^ Numbes = [9 X = 2 L = R = While not end-of-expession do: > Red X If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes L = POP Numbes Evlute L X R; PUSH esult onto Numbes Red X

39 9 / ((2 * 4) - 5) = * 5 - / ^ Numbes = [9 2 X = 2 L = R = While not end-of-expession do: Red X > If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes L = POP Numbes Evlute L X R; PUSH esult onto Numbes Push X

40 9 / ((2 * 4) - 5) = * 5 - / ^ Numbes = [9 2 X = 4 L = R = While not end-of-expession do: > Red X If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes L = POP Numbes Evlute L X R; PUSH esult onto Numbes Red X

41 9 / ((2 * 4) - 5) = * 5 - / ^ Numbes = [9 2 4 X = 4 L = R = While not end-of-expession do: Red X > If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes L = POP Numbes Evlute L X R; PUSH esult onto Numbes Push X

42 9 / ((2 * 4) - 5) = * 5 - / ^ Numbes = [9 2 4 X = * L = R = While not end-of-expession do: > Red X If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes L = POP Numbes Evlute L X R; PUSH esult onto Numbes Red X

43 9 / ((2 * 4) - 5) = * 5 - / ^ Numbes = [9 2 X = * L = R = 4 While not end-of-expession do: Red X If X isnumbe, PUSH X onto Numbes If X isopeto, > R = POP Numbes L = POP Numbes Evlute L X R; PUSH esult onto Numbes Ah! X is n opeto, pop the top element sve into R

44 9 / ((2 * 4) - 5) = * 5 - / ^ Numbes = [9 X = * L = 2 R = 4 While not end-of-expession do: Red X If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes > L = POP Numbes Evlute L X R; PUSH esult onto Numbes Top element is emoved nd sved into L

45 9 / ((2 * 4) - 5) = * 5 - / ^ Numbes = [9 8 X = * L = 2 R = 4 While not end-of-expession do: Red X If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes L = POP Numbes > Evlute L X R; PUSH esult onto Numbes Push the esult of L X R, 2 4 = 8, onto the stck

46 9 / ((2 * 4) - 5) = * 5 - / ^ Numbes = [9 8 X = 5 L = 2 R = 4 While not end-of-expession do: > Red X If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes L = POP Numbes Evlute L X R; PUSH esult onto Numbes Red X

47 9 / ((2 * 4) - 5) = * 5 - / ^ Numbes = [9 8 5 X = 5 L = 2 R = 4 While not end-of-expession do: Red X > If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes L = POP Numbes Evlute L X R; PUSH esult onto Numbes Push X

48 9 / ((2 * 4) - 5) = * 5 - / ^ Numbes = [9 8 5 X = - L = 2 R = 4 While not end-of-expession do: > Red X If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes L = POP Numbes Evlute L X R; PUSH esult onto Numbes Red X

49 9 / ((2 * 4) - 5) = * 5 - / ^ Numbes = [9 8 X = - L = 2 R = 5 While not end-of-expession do: Red X If X isnumbe, PUSH X onto Numbes If X isopeto, > R = POP Numbes L = POP Numbes Evlute L X R; PUSH esult onto Numbes Remove the top element nd sve it into R

50 9 / ((2 * 4) - 5) = * 5 - / ^ Numbes = [9 X = - L = 8 R = 5 While not end-of-expession do: Red X If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes > L = POP Numbes Evlute L X R; PUSH esult onto Numbes Remove the top element nd sve it into L

51 9 / ((2 * 4) - 5) = * 5 - / ^ Numbes = [9 3 X = - L = 8 R = 5 While not end-of-expession do: Red X If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes L = POP Numbes > Evlute L X R; PUSH esult onto Numbes Push the esult of L X R, 8 5 = 3, onto the stck

52 9 / ((2 * 4) - 5) = * 5 - / ^ Numbes = [9 3 X = / L = 8 R = 5 While not end-of-expession do: > Red X If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes L = POP Numbes Evlute L X R; PUSH esult onto Numbes Red X

53 9 / ((2 * 4) - 5) = * 5 - / ^ Numbes = [9 X = / L = 8 R = 3 While not end-of-expession do: Red X If X isnumbe, PUSH X onto Numbes If X isopeto, > R = POP Numbes L = POP Numbes Evlute L X R; PUSH esult onto Numbes R = POP Numbes.

54 9 / ((2 * 4) - 5) = * 5 - / ^ Numbes = [ X = / L = 9 R = 3 While not end-of-expession do: Red X If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes > L = POP Numbes Evlute L X R; PUSH esult onto Numbes L = POP Numbes.

55 9 / ((2 * 4) - 5) = * 5 - / ^ Numbes = [3 X = / L = 9 R = 3 While not end-of-expession do: Red X If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes L = POP Numbes > Evlute L X R; PUSH esult onto Numbes Push L X R, 9 3 = 3, onto the stck su l pile.

56 9 / ((2 * 4) - 5) = * 5 - / ^ Numbes = [3 X = / L = 9 R = 3 While not end-of-expession do: Red X If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes L = POP Numbes > Evlute L X R; PUSH esult onto Numbes End-of-expession

57 9 / ((2 * 4) - 5) = * 5 - / ^ Numbes = [ X = / L = 9 R = 3 > While not end-of-expession do: Red X If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes L = POP Numbes Evlute L X R; PUSH esult onto Numbes The esult is POP Numbes = 3 ; the stck is now empty

58 Poblem Rthe thn evluting n RPN expession, we would like to convet n RPN expession to infix (usul nottion). Hum? Do we need new lgoithm? No, simple modifiction will do, eplce Evlute L OP R by Conctente (L OP R). Note: pentheses e essentil (not ll of them but some e). This time the stck does not contin numbes but chcte stings tht epesent sub-expessions.

59 / - /

60 Postfix infix Sting pntoinfix(sting[] tokens) Numbes = [ X = L = R = While not end-of-expession do: Red X If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes L = POP Numbes Conctente ( L X R ); PUSH esult onto Numbes

61 Postfix? While not end-of-expession do: Red X If X isnumbe, PUSH X onto Numbes If X isopeto, R = POP Numbes L = POP Numbes Pocess L X R; PUSH esult onto Numbes We ve seen n exmple whee Pocess == Evlute, then one whee Pocess == Conctente, but Pocess could lso poduce ssembly code (i.e. mchine instuctions). This shows how pogms e compiled o tnslted.

62 Memoy mngement hep (instnces) fee bsept Stck fo method clls Vibles sttic pogm (byte code) Jv Vitul Mchine Method n ctivtion ecod... Method 2 ctivtion ecod Method 1 (min) ctivtion ecod Pogm counte Locl vibles Pmetes Retun ddess Pevious bsept Retun vlue Schemtic nd simplified epesenttion of the memoy duing the execution of Jv pogm.

63 The Jv Vitul Mchine (JVM) must: Method cll 1. Cete new ctivtion ecod/block (which contins spce fo the locl vibles nd the pmetes mong othe things); 2. Sve the cuent vlue of bsept in the ctivtion ecod nd set the bsept to the ddess of the cuent ecod; 3. Sve the vlue of the pogm counte in the designted spce of the ctivtion ecod, set the pogm counte to the fist instuction of the cuent method; 4. Copy the vlues of the effective pmetes into the designted e of the cuent ctivtion ecod; 5. Initil the locl vibles; 6. Stt executing the instuction designted by the pogm counte. ctivtion block = stck fme, cll fme o ctivtion ecod.

64 When the method ends The JVM must: 1. Sve the etun vlue (t the designted spce) 2. Retun the contol to the clling method, i.e. set the pogm counte nd bsept bck to thei pevious vlue; 3. Remove the cuent block; 4. Execute instuction designted by the cuent vlue of the pogm counte.

65 Exmple 1 (simplified) public clss Clls { public sttic int c( int v ) { int n; n = v + 1; etun n; } public sttic int b( int v ) { int m,n; m = v + 1; n = c( m ); etun n; } public sttic int ( int v ) { int m,n; m = v + 1; n = b( m ); etun n; }

66 } public sttic void min( Sting[] gs ) { int m,n; m = 1; n = ( m ); System.out.pintln( n ); }

67 Exmple 1 (simplified) : min: v m n gs m n 1 1 (1)

68 Exmple 1 (simplified) b: : min: v m n v m n gs m n b(2) (1)

69 Exmple 1 (simplified) c: v n 3 c(3) b: v m 2 3 n b(2) : v 1 m n 2 (1) min: gs m 1 n

70 Exmple 1 (simplified) 4 c(3) b: : min: v m n v m n gs m n b(2) (1)

71 Exmple 1 (simplified) 4 b(2) : v m n (1) min: gs m n 1

72 Exmple 1 (simplified) 4 (1) min: gs m n 1 4

73 Exmple 1: summy c: 4 v n 3 4 c(3) b: 4 v m n b(2) : 4 v m n (1) min: gs m n 1 4

74 Exmple 2 (with pogm counte) 01 public clss Fct { 02 public sttic int fct( int n ) { 03 // pe-condition: n >= 0 04 int, ; 05 if ( n == 0 n == 1 ) { 06 = 1; 07 } else { 08 = fct( n-1 ); 09 = n * ; 10 } 11 etun ; 12 } 13 public sttic void min( Sting[] gs ) { 14 int, n; 15 n = 3; 16 = fct( n ); 17 } 18}

75 min gs n pogm counte 15

76 min gs n 3 pogm counte 16

77 fct n etun ddess min gs n 3 fct( 3 ) pogm counte 16

78 fct n 3 etun ddess min gs n 3 fct( 3 ) pogm counte 16

79 fct n 3 etun ddess 16 min gs n 3 fct( 3 ) pogm counte 16

80 fct n 3 etun ddess 16 min gs n 3 fct( 3 ) pogm counte 5

81 fct n 3 etun ddess 16 min gs n 3 fct( 3 ) pogm counte 8

82 fct n etun ddess fct n 3 etun ddess 16 min gs n 3 fct( 2 ) fct( 3 ) pogm counte 8

83 fct n 2 etun ddess fct n 3 etun ddess 16 min gs n 3 fct( 2 ) fct( 3 ) pogm counte 8

84 fct n 2 etun ddess 8 fct n 3 etun ddess 16 min gs n 3 fct( 2 ) fct( 3 ) pogm counte 8

85 fct n 2 etun ddess 8 fct n 3 etun ddess 16 min gs n 3 fct( 2 ) fct( 3 ) pogm counte 5

86 fct n 2 etun ddess 8 fct n 3 etun ddess 16 min gs n 3 fct( 2 ) fct( 3 ) pogm counte 8

87 fct n etun ddess fct n 2 etun ddess 8 fct n 3 etun ddess 16 min gs n 3 fct( 1 ) fct( 2 ) fct( 3 ) pogm counte 8

88 fct n 1 etun ddess fct n 2 etun ddess 8 fct n 3 etun ddess 16 min gs n 3 fct( 1 ) fct( 2 ) fct( 3 ) pogm counte 8

89 fct n 1 etun ddess 8 fct n 2 etun ddess 8 fct n 3 etun ddess 16 min gs n 3 fct( 1 ) fct( 2 ) fct( 3 ) pogm counte 8

90 fct n 1 etun ddess 8 fct n 2 etun ddess 8 fct n 3 etun ddess 16 min gs n 3 fct( 1 ) fct( 2 ) fct( 3 ) pogm counte 5

91 fct n 1 etun ddess 8 fct n 2 etun ddess 8 fct n 3 etun ddess 16 min gs n 3 fct( 1 ) fct( 2 ) fct( 3 ) pogm counte 6

92 fct n 1 1 etun ddess 8 fct n 2 etun ddess 8 fct n 3 etun ddess 16 min gs n 3 fct( 1 ) fct( 2 ) fct( 3 ) pogm counte 11

93 fct n 1 1 etun ddess 8 1 fct n 2 etun ddess 8 fct n 3 etun ddess 16 min gs n 3 fct( 1 ) fct( 2 ) fct( 3 ) pogm counte 11

94 fct n 1 1 etun ddess 8 1 fct n 2 etun ddess 8 fct n 3 etun ddess 16 min gs n 3 fct( 1 ) fct( 2 ) fct( 3 ) pogm counte 8

95 1 fct n 2 etun ddess 8 fct n 3 etun ddess 16 min gs n 3 fct( 2 ) fct( 3 ) pogm counte 8

96 1 fct n 2 1 etun ddess 8 fct n 3 etun ddess 16 min gs n 3 fct( 2 ) fct( 3 ) pogm counte 9

97 1 fct n etun ddess 8 fct n 3 etun ddess 16 min gs n 3 fct( 2 ) fct( 3 ) pogm counte 11

98 1 fct n etun ddess 8 2 fct n 3 etun ddess 16 min gs n 3 fct( 2 ) fct( 3 ) pogm counte 11

99 1 fct n etun ddess 8 2 fct n 3 etun ddess 16 min gs n 3 fct( 2 ) fct( 3 ) pogm counte 8

100 2 fct n 3 etun ddess 16 min gs n 3 fct( 3 ) pogm counte 8

101 2 fct n 3 2 etun ddess 16 min gs n 3 fct( 3 ) pogm counte 9

102 2 fct n etun ddess 16 min gs n 3 fct( 3 ) pogm counte 11

103 2 fct n etun ddess 16 6 min gs n 3 fct( 3 ) pogm counte 11

104 2 fct n etun ddess 16 6 min gs n 3 fct( 3 ) pogm counte 16

105 min 6 gs n 3 pogm counte 16

106 min 6 gs n 3 6 pogm counte 17

ITI Introduction to Computing II

ITI Introduction to Computing II ITI 1121. Intoduction to Computing II Macel Tucotte School of Electical Engineeing and Compute Science Abstact data type: Stack Stack-based algoithms Vesion of Febuay 2, 2013 Abstact These lectue notes

More information

Chapter 7. Kleene s Theorem. 7.1 Kleene s Theorem. The following theorem is the most important and fundamental result in the theory of FA s:

Chapter 7. Kleene s Theorem. 7.1 Kleene s Theorem. The following theorem is the most important and fundamental result in the theory of FA s: Chpte 7 Kleene s Theoem 7.1 Kleene s Theoem The following theoem is the most impotnt nd fundmentl esult in the theoy of FA s: Theoem 6 Any lnguge tht cn e defined y eithe egul expession, o finite utomt,

More information

Lecture 10. Solution of Nonlinear Equations - II

Lecture 10. Solution of Nonlinear Equations - II Fied point Poblems Lectue Solution o Nonline Equtions - II Given unction g : R R, vlue such tht gis clled ied point o the unction g, since is unchnged when g is pplied to it. Whees with nonline eqution

More information

Previously. Extensions to backstepping controller designs. Tracking using backstepping Suppose we consider the general system

Previously. Extensions to backstepping controller designs. Tracking using backstepping Suppose we consider the general system 436-459 Advnced contol nd utomtion Extensions to bckstepping contolle designs Tcking Obseves (nonline dmping) Peviously Lst lectue we looked t designing nonline contolles using the bckstepping technique

More information

( ) D x ( s) if r s (3) ( ) (6) ( r) = d dr D x

( ) D x ( s) if r s (3) ( ) (6) ( r) = d dr D x SIO 22B, Rudnick dpted fom Dvis III. Single vile sttistics The next few lectues e intended s eview of fundmentl sttistics. The gol is to hve us ll speking the sme lnguge s we move to moe dvnced topics.

More information

Data Structures. Element Uniqueness Problem. Hash Tables. Example. Hash Tables. Dana Shapira. 19 x 1. ) h(x 4. ) h(x 2. ) h(x 3. h(x 1. x 4. x 2.

Data Structures. Element Uniqueness Problem. Hash Tables. Example. Hash Tables. Dana Shapira. 19 x 1. ) h(x 4. ) h(x 2. ) h(x 3. h(x 1. x 4. x 2. Element Uniqueness Poblem Dt Stuctues Let x,..., xn < m Detemine whethe thee exist i j such tht x i =x j Sot Algoithm Bucket Sot Dn Shpi Hsh Tbles fo (i=;i

More information

Class Summary. be functions and f( D) , we define the composition of f with g, denoted g f by

Class Summary. be functions and f( D) , we define the composition of f with g, denoted g f by Clss Summy.5 Eponentil Functions.6 Invese Functions nd Logithms A function f is ule tht ssigns to ech element D ectly one element, clled f( ), in. Fo emple : function not function Given functions f, g:

More information

School of Electrical and Computer Engineering, Cornell University. ECE 303: Electromagnetic Fields and Waves. Fall 2007

School of Electrical and Computer Engineering, Cornell University. ECE 303: Electromagnetic Fields and Waves. Fall 2007 School of Electicl nd Compute Engineeing, Conell Univesity ECE 303: Electomgnetic Fields nd Wves Fll 007 Homewok 3 Due on Sep. 14, 007 by 5:00 PM Reding Assignments: i) Review the lectue notes. ii) Relevnt

More information

Convert the NFA into DFA

Convert the NFA into DFA Convert the NF into F For ech NF we cn find F ccepting the sme lnguge. The numer of sttes of the F could e exponentil in the numer of sttes of the NF, ut in prctice this worst cse occurs rrely. lgorithm:

More information

9.4 The response of equilibrium to temperature (continued)

9.4 The response of equilibrium to temperature (continued) 9.4 The esponse of equilibium to tempetue (continued) In the lst lectue, we studied how the chemicl equilibium esponds to the vition of pessue nd tempetue. At the end, we deived the vn t off eqution: d

More information

(a) Counter-Clockwise (b) Clockwise ()N (c) No rotation (d) Not enough information

(a) Counter-Clockwise (b) Clockwise ()N (c) No rotation (d) Not enough information m m m00 kg dult, m0 kg bby. he seesw stts fom est. Which diection will it ottes? ( Counte-Clockwise (b Clockwise ( (c o ottion ti (d ot enough infomtion Effect of Constnt et oque.3 A constnt non-zeo toque

More information

Language Processors F29LP2, Lecture 5

Language Processors F29LP2, Lecture 5 Lnguge Pocessos F29LP2, Lectue 5 Jmie Gy Feuy 2, 2014 1 / 1 Nondeteministic Finite Automt (NFA) NFA genelise deteministic finite utomt (DFA). They llow sevel (0, 1, o moe thn 1) outgoing tnsitions with

More information

Deterministic simulation of a NFA with k symbol lookahead

Deterministic simulation of a NFA with k symbol lookahead Deteministic simultion of NFA with k symbol lookhed SOFSEM 7 Bl Rvikum, Clifoni Stte Univesity (joint wok with Nic Snten, Univesity of Wteloo) Oveview Definitions: DFA, NFA nd lookhed DFA Motivtion: utomted

More information

This immediately suggests an inverse-square law for a "piece" of current along the line.

This immediately suggests an inverse-square law for a piece of current along the line. Electomgnetic Theoy (EMT) Pof Rui, UNC Asheville, doctophys on YouTube Chpte T Notes The iot-svt Lw T nvese-sque Lw fo Mgnetism Compe the mgnitude of the electic field t distnce wy fom n infinite line

More information

Electric Potential. and Equipotentials

Electric Potential. and Equipotentials Electic Potentil nd Euipotentils U Electicl Potentil Review: W wok done y foce in going fom to long pth. l d E dl F W dl F θ Δ l d E W U U U Δ Δ l d E W U U U U potentil enegy electic potentil Potentil

More information

CHAPTER 18: ELECTRIC CHARGE AND ELECTRIC FIELD

CHAPTER 18: ELECTRIC CHARGE AND ELECTRIC FIELD ollege Physics Student s Mnul hpte 8 HAPTR 8: LTRI HARG AD LTRI ILD 8. STATI LTRIITY AD HARG: OSRVATIO O HARG. ommon sttic electicity involves chges nging fom nnocoulombs to micocoulombs. () How mny electons

More information

5.1 Definitions and Examples 5.2 Deterministic Pushdown Automata

5.1 Definitions and Examples 5.2 Deterministic Pushdown Automata CSC4510 AUTOMATA 5.1 Definitions nd Exmples 5.2 Deterministic Pushdown Automt Definitions nd Exmples A lnguge cn be generted by CFG if nd only if it cn be ccepted by pushdown utomton. A pushdown utomton

More information

Radial geodesics in Schwarzschild spacetime

Radial geodesics in Schwarzschild spacetime Rdil geodesics in Schwzschild spcetime Spheiclly symmetic solutions to the Einstein eqution tke the fom ds dt d dθ sin θdϕ whee is constnt. We lso hve the connection components, which now tke the fom using

More information

Pushdown Automata (PDAs)

Pushdown Automata (PDAs) CHAPTER 2 Context-Fee Languages Contents Context-Fee Gammas definitions, examples, designing, ambiguity, Chomsky nomal fom Pushdown Automata definitions, examples, euivalence with context-fee gammas Non-Context-Fee

More information

Optimization. x = 22 corresponds to local maximum by second derivative test

Optimization. x = 22 corresponds to local maximum by second derivative test Optimiztion Lectue 17 discussed the exteme vlues of functions. This lectue will pply the lesson fom Lectue 17 to wod poblems. In this section, it is impotnt to emembe we e in Clculus I nd e deling one-vible

More information

Physics 604 Problem Set 1 Due Sept 16, 2010

Physics 604 Problem Set 1 Due Sept 16, 2010 Physics 64 Polem et 1 Due ept 16 1 1) ) Inside good conducto the electic field is eo (electons in the conducto ecuse they e fee to move move in wy to cncel ny electic field impessed on the conducto inside

More information

HOW TO TEACH THE FUNDAMENTALS OF INFORMATION SCIENCE, CODING, DECODING AND NUMBER SYSTEMS?

HOW TO TEACH THE FUNDAMENTALS OF INFORMATION SCIENCE, CODING, DECODING AND NUMBER SYSTEMS? 6th INTERNATIONAL MULTIDISCIPLINARY CONFERENCE HOW TO TEACH THE FUNDAMENTALS OF INFORMATION SCIENCE, CODING, DECODING AND NUMBER SYSTEMS? Cecília Sitkuné Göömbei College of Nyíegyháza Hungay Abstact: The

More information

EECE 260 Electrical Circuits Prof. Mark Fowler

EECE 260 Electrical Circuits Prof. Mark Fowler EECE 60 Electicl Cicuits Pof. Mk Fowle Complex Numbe Review /6 Complex Numbes Complex numbes ise s oots of polynomils. Definition of imginy # nd some esulting popeties: ( ( )( ) )( ) Recll tht the solution

More information

FI 2201 Electromagnetism

FI 2201 Electromagnetism FI 1 Electomgnetism Alexnde A. Isknd, Ph.D. Physics of Mgnetism nd Photonics Resech Goup Electosttics ELECTRIC PTENTIALS 1 Recll tht we e inteested to clculte the electic field of some chge distiution.

More information

CHAPTER 2d. MATRICES

CHAPTER 2d. MATRICES CHPTER d. MTRICES University of Bhrin Deprtment of Civil nd rch. Engineering CEG -Numericl Methods in Civil Engineering Deprtment of Civil Engineering University of Bhrin Every squre mtrix hs ssocited

More information

Mark Scheme (Results) January 2008

Mark Scheme (Results) January 2008 Mk Scheme (Results) Jnuy 00 GCE GCE Mthemtics (6679/0) Edecel Limited. Registeed in Englnd nd Wles No. 4496750 Registeed Office: One90 High Holbon, London WCV 7BH Jnuy 00 6679 Mechnics M Mk Scheme Question

More information

A Bijective Approach to the Permutational Power of a Priority Queue

A Bijective Approach to the Permutational Power of a Priority Queue A Bijective Appoach to the Pemutational Powe of a Pioity Queue Ia M. Gessel Kuang-Yeh Wang Depatment of Mathematics Bandeis Univesity Waltham, MA 02254-9110 Abstact A pioity queue tansfoms an input pemutation

More information

7.5-Determinants in Two Variables

7.5-Determinants in Two Variables 7.-eteminnts in Two Vibles efinition of eteminnt The deteminnt of sque mti is el numbe ssocited with the mti. Eve sque mti hs deteminnt. The deteminnt of mti is the single ent of the mti. The deteminnt

More information

π,π is the angle FROM a! TO b

π,π is the angle FROM a! TO b Mth 151: 1.2 The Dot Poduct We hve scled vectos (o, multiplied vectos y el nume clled scl) nd dded vectos (in ectngul component fom). Cn we multiply vectos togethe? The nswe is YES! In fct, thee e two

More information

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 Automt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Problem (II) Chpter II.6.: Push Down Automt Remrk: This mteril is no longer tught nd not directly exm relevnt Anton Setzer (Bsed

More information

Week 8. Topic 2 Properties of Logarithms

Week 8. Topic 2 Properties of Logarithms Week 8 Topic 2 Popeties of Logithms 1 Week 8 Topic 2 Popeties of Logithms Intoduction Since the esult of ithm is n eponent, we hve mny popeties of ithms tht e elted to the popeties of eponents. They e

More information

2-Way Finite Automata Radboud University, Nijmegen. Writer: Serena Rietbergen, s Supervisor: Herman Geuvers

2-Way Finite Automata Radboud University, Nijmegen. Writer: Serena Rietbergen, s Supervisor: Herman Geuvers 2-Wy Finite Automt Rdoud Univesity, Nijmegen Wite: Seen Rietegen, s4182804 Supeviso: Hemn Geuves Acdemic Ye 2017-2018 Contents 1 Intoduction 3 2 One wy utomt, deteministic nd non-deteministic 5 3 Ovehed

More information

School of Electrical and Computer Engineering, Cornell University. ECE 303: Electromagnetic Fields and Waves. Fall 2007

School of Electrical and Computer Engineering, Cornell University. ECE 303: Electromagnetic Fields and Waves. Fall 2007 School of Electicl nd Compute Engineeing, Conell Univesity ECE 303: Electomgnetic Fields nd Wves Fll 007 Homewok 4 Due on Sep. 1, 007 by 5:00 PM Reding Assignments: i) Review the lectue notes. ii) Relevnt

More information

The Formulas of Vector Calculus John Cullinan

The Formulas of Vector Calculus John Cullinan The Fomuls of Vecto lculus John ullinn Anlytic Geomety A vecto v is n n-tuple of el numbes: v = (v 1,..., v n ). Given two vectos v, w n, ddition nd multipliction with scl t e defined by Hee is bief list

More information

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 Automt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Problem (II) Chpter II.5.: Properties of Context Free Grmmrs (14) Anton Setzer (Bsed on book drft by J. V. Tucker nd K. Stephenson)

More information

Discrete Model Parametrization

Discrete Model Parametrization Poceedings of Intentionl cientific Confeence of FME ession 4: Automtion Contol nd Applied Infomtics Ppe 9 Discete Model Pmetition NOKIEVIČ, Pet Doc,Ing,Cc Deptment of Contol ystems nd Instumenttion, Fculty

More information

Section 35 SHM and Circular Motion

Section 35 SHM and Circular Motion Section 35 SHM nd Cicul Motion Phsics 204A Clss Notes Wht do objects do? nd Wh do the do it? Objects sometimes oscillte in simple hmonic motion. In the lst section we looed t mss ibting t the end of sping.

More information

CSCI 340: Computational Models. Transition Graphs. Department of Computer Science

CSCI 340: Computational Models. Transition Graphs. Department of Computer Science CSCI 340: Computtionl Models Trnsition Grphs Chpter 6 Deprtment of Computer Science Relxing Restrints on Inputs We cn uild n FA tht ccepts only the word! 5 sttes ecuse n FA cn only process one letter t

More information

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014 CMPSCI 250: Introduction to Computtion Lecture #31: Wht DFA s Cn nd Cn t Do Dvid Mix Brrington 9 April 2014 Wht DFA s Cn nd Cn t Do Deterministic Finite Automt Forml Definition of DFA s Exmples of DFA

More information

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38 Theory of Computtion Regulr Lnguges (NTU EE) Regulr Lnguges Fll 2017 1 / 38 Schemtic of Finite Automt control 0 0 1 0 1 1 1 0 Figure: Schemtic of Finite Automt A finite utomton hs finite set of control

More information

Continuous Charge Distributions

Continuous Charge Distributions Continuous Chge Distibutions Review Wht if we hve distibution of chge? ˆ Q chge of distibution. Q dq element of chge. d contibution to due to dq. Cn wite dq = ρ dv; ρ is the chge density. = 1 4πε 0 qi

More information

For convenience, we rewrite m2 s m2 = m m m ; where m is repeted m times. Since xyz = m m m nd jxyj»m, we hve tht the string y is substring of the fir

For convenience, we rewrite m2 s m2 = m m m ; where m is repeted m times. Since xyz = m m m nd jxyj»m, we hve tht the string y is substring of the fir CSCI 2400 Models of Computtion, Section 3 Solutions to Homework 4 Problem 1. ll the solutions below refer to the Pumping Lemm of Theorem 4.8, pge 119. () L = f n b l k : k n + lg Let's ssume for contrdiction

More information

The Area of a Triangle

The Area of a Triangle The e of Tingle tkhlid June 1, 015 1 Intodution In this tile we will e disussing the vious methods used fo detemining the e of tingle. Let [X] denote the e of X. Using se nd Height To stt off, the simplest

More information

On the Eötvös effect

On the Eötvös effect On the Eötvös effect Mugu B. Răuţ The im of this ppe is to popose new theoy bout the Eötvös effect. We develop mthemticl model which loud us bette undestnding of this effect. Fom the eqution of motion

More information

Unit #9 : Definite Integral Properties; Fundamental Theorem of Calculus

Unit #9 : Definite Integral Properties; Fundamental Theorem of Calculus Unit #9 : Definite Integrl Properties; Fundmentl Theorem of Clculus Gols: Identify properties of definite integrls Define odd nd even functions, nd reltionship to integrl vlues Introduce the Fundmentl

More information

Physics 11b Lecture #11

Physics 11b Lecture #11 Physics 11b Lectue #11 Mgnetic Fields Souces of the Mgnetic Field S&J Chpte 9, 3 Wht We Did Lst Time Mgnetic fields e simil to electic fields Only diffeence: no single mgnetic pole Loentz foce Moving chge

More information

Two dimensional polar coordinate system in airy stress functions

Two dimensional polar coordinate system in airy stress functions I J C T A, 9(9), 6, pp. 433-44 Intentionl Science Pess Two dimensionl pol coodinte system in iy stess functions S. Senthil nd P. Sek ABSTRACT Stisfy the given equtions, boundy conditions nd bihmonic eqution.in

More information

Finite Automata-cont d

Finite Automata-cont d Automt Theory nd Forml Lnguges Professor Leslie Lnder Lecture # 6 Finite Automt-cont d The Pumping Lemm WEB SITE: http://ingwe.inghmton.edu/ ~lnder/cs573.html Septemer 18, 2000 Exmple 1 Consider L = {ww

More information

Jim Lambers MAT 169 Fall Semester Lecture 4 Notes

Jim Lambers MAT 169 Fall Semester Lecture 4 Notes Jim Lmbers MAT 169 Fll Semester 2009-10 Lecture 4 Notes These notes correspond to Section 8.2 in the text. Series Wht is Series? An infinte series, usully referred to simply s series, is n sum of ll of

More information

Energy Dissipation Gravitational Potential Energy Power

Energy Dissipation Gravitational Potential Energy Power Lectue 4 Chpte 8 Physics I 0.8.03 negy Dissiption Gvittionl Potentil negy Powe Couse wesite: http://fculty.uml.edu/andiy_dnylov/teching/physicsi Lectue Cptue: http://echo360.uml.edu/dnylov03/physicsfll.html

More information

dx was area under f ( x ) if ( ) 0

dx was area under f ( x ) if ( ) 0 13. Line Integls Line integls e simil to single integl, f ( x) dx ws e unde f ( x ) if ( ) 0 Insted of integting ove n intevl [, ] (, ) f xy ds f x., we integte ove cuve, (in the xy-plne). **Figue - get

More information

This lecture covers Chapter 8 of HMU: Properties of CFLs

This lecture covers Chapter 8 of HMU: Properties of CFLs This lecture covers Chpter 8 of HMU: Properties of CFLs Turing Mchine Extensions of Turing Mchines Restrictions of Turing Mchines Additionl Reding: Chpter 8 of HMU. Turing Mchine: Informl Definition B

More information

Review of Calculus, cont d

Review of Calculus, cont d Jim Lmbers MAT 460 Fll Semester 2009-10 Lecture 3 Notes These notes correspond to Section 1.1 in the text. Review of Clculus, cont d Riemnn Sums nd the Definite Integrl There re mny cses in which some

More information

Riemann Sums and Riemann Integrals

Riemann Sums and Riemann Integrals Riemnn Sums nd Riemnn Integrls Jmes K. Peterson Deprtment of Biologicl Sciences nd Deprtment of Mthemticl Sciences Clemson University August 26, 203 Outline Riemnn Sums Riemnn Integrls Properties Abstrct

More information

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun:

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun: CMPU 240 Lnguge Theory nd Computtion Spring 2019 NFAs nd Regulr Expressions Lst clss: Introduced nondeterministic finite utomt with -trnsitions Tody: Prove n NFA- is no more powerful thn n NFA Introduce

More information

Theory of Computation Regular Languages

Theory of Computation Regular Languages Theory of Computtion Regulr Lnguges Bow-Yw Wng Acdemi Sinic Spring 2012 Bow-Yw Wng (Acdemi Sinic) Regulr Lnguges Spring 2012 1 / 38 Schemtic of Finite Automt control 0 0 1 0 1 1 1 0 Figure: Schemtic of

More information

Homework 3 MAE 118C Problems 2, 5, 7, 10, 14, 15, 18, 23, 30, 31 from Chapter 5, Lamarsh & Baratta. The flux for a point source is:

Homework 3 MAE 118C Problems 2, 5, 7, 10, 14, 15, 18, 23, 30, 31 from Chapter 5, Lamarsh & Baratta. The flux for a point source is: . Homewok 3 MAE 8C Poblems, 5, 7, 0, 4, 5, 8, 3, 30, 3 fom Chpte 5, msh & Btt Point souces emit nuetons/sec t points,,, n 3 fin the flux cuent hlf wy between one sie of the tingle (blck ot). The flux fo

More information

Lecture 14. Protocols. Key Distribution Center (KDC) or Trusted Third Party (TTP) KDC generates R1

Lecture 14. Protocols. Key Distribution Center (KDC) or Trusted Third Party (TTP) KDC generates R1 Lectue 14 Potocols 1 Key Distiution Cente (KDC) o Tusted Thid Pty (TTP) KDC genetes R1 lice otins R1 Msg1: K () Msg2: K (R1 K (R1) ) Msg3: K (R1) o otins R1 nd knows to use s key fo communicting with lice

More information

Friedmannien equations

Friedmannien equations ..6 Fiedmnnien equtions FLRW metic is : ds c The metic intevl is: dt ( t) d ( ) hee f ( ) is function which detemines globl geometic l popety of D spce. f d sin d One cn put it in the Einstein equtions

More information

Riemann Sums and Riemann Integrals

Riemann Sums and Riemann Integrals Riemnn Sums nd Riemnn Integrls Jmes K. Peterson Deprtment of Biologicl Sciences nd Deprtment of Mthemticl Sciences Clemson University August 26, 2013 Outline 1 Riemnn Sums 2 Riemnn Integrls 3 Properties

More information

MA 513: Data Structures Lecture Note Partha Sarathi Mandal

MA 513: Data Structures Lecture Note  Partha Sarathi Mandal MA 513: Dt Structures Lecture Note http://www.iitg.ernet.in/psm/indexing_m513/y09/index.html Prth Srthi Mndl psm@iitg.ernet.in Dept. of Mthemtics, IIT Guwhti Tue 9:00-9:55 Wed 10:00-10:55 Thu 11:00-11:55

More information

A Mathematica package to cope with partially ordered sets

A Mathematica package to cope with partially ordered sets A Mthemtic pckge to cope with ptill odeed sets P. Cod Diptimento di Infomtic e Comunicione, Univesità degli Studi di Milno Abstct Mthemtic offes, b w of the pckge Combintoics, mn useful functions to wok

More information

Improper Integrals, and Differential Equations

Improper Integrals, and Differential Equations Improper Integrls, nd Differentil Equtions October 22, 204 5.3 Improper Integrls Previously, we discussed how integrls correspond to res. More specificlly, we sid tht for function f(x), the region creted

More information

Linear Inequalities. Work Sheet 1

Linear Inequalities. Work Sheet 1 Work Sheet 1 Liner Inequlities Rent--Hep, cr rentl compny,chrges $ 15 per week plus $ 0.0 per mile to rent one of their crs. Suppose you re limited y how much money you cn spend for the week : You cn spend

More information

Recursively Enumerable and Recursive. Languages

Recursively Enumerable and Recursive. Languages Recursively Enumerble nd Recursive nguges 1 Recll Definition (clss 19.pdf) Definition 10.4, inz, 6 th, pge 279 et S be set of strings. An enumertion procedure for Turing Mchine tht genertes ll strings

More information

Handout: Natural deduction for first order logic

Handout: Natural deduction for first order logic MATH 457 Introduction to Mthemticl Logic Spring 2016 Dr Json Rute Hndout: Nturl deduction for first order logic We will extend our nturl deduction rules for sententil logic to first order logic These notes

More information

3.1 Magnetic Fields. Oersted and Ampere

3.1 Magnetic Fields. Oersted and Ampere 3.1 Mgnetic Fields Oested nd Ampee The definition of mgnetic induction, B Fields of smll loop (dipole) Mgnetic fields in mtte: ) feomgnetism ) mgnetiztion, (M ) c) mgnetic susceptiility, m d) mgnetic field,

More information

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9.

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9. Regulr Expressions, Pumping Lemm, Right Liner Grmmrs Ling 106 Mrch 25, 2002 1 Regulr Expressions A regulr expression descries or genertes lnguge: it is kind of shorthnd for listing the memers of lnguge.

More information

Before we can begin Ch. 3 on Radicals, we need to be familiar with perfect squares, cubes, etc. Try and do as many as you can without a calculator!!!

Before we can begin Ch. 3 on Radicals, we need to be familiar with perfect squares, cubes, etc. Try and do as many as you can without a calculator!!! Nme: Algebr II Honors Pre-Chpter Homework Before we cn begin Ch on Rdicls, we need to be fmilir with perfect squres, cubes, etc Try nd do s mny s you cn without clcultor!!! n The nth root of n n Be ble

More information

CS 314 Principles of Programming Languages

CS 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 information

The Regulated and Riemann Integrals

The Regulated and Riemann Integrals Chpter 1 The Regulted nd Riemnn Integrls 1.1 Introduction We will consider severl different pproches to defining the definite integrl f(x) dx of function f(x). These definitions will ll ssign the sme vlue

More information

Scanner. Specifying patterns. Specifying patterns. Operations on languages. A scanner must recognize the units of syntax Some parts are easy:

Scanner. Specifying patterns. Specifying patterns. Operations on languages. A scanner must recognize the units of syntax Some parts are easy: Scnner Specifying ptterns source code tokens scnner prser IR A scnner must recognize the units of syntx Some prts re esy: errors mps chrcters into tokens the sic unit of syntx x = x + y; ecomes

More information

Solution of fuzzy multi-objective nonlinear programming problem using interval arithmetic based alpha-cut

Solution of fuzzy multi-objective nonlinear programming problem using interval arithmetic based alpha-cut Intentionl Jounl of Sttistics nd Applied Mthemtics 016; 1(3): 1-5 ISSN: 456-145 Mths 016; 1(3): 1-5 016 Stts & Mths www.mthsounl.com Received: 05-07-016 Accepted: 06-08-016 C Lognthn Dept of Mthemtics

More information

Probabilistic Retrieval

Probabilistic Retrieval CS 630 Lectue 4: 02/07/2006 Lectue: Lillin Lee Scibes: Pete Bbinski, Dvid Lin Pobbilistic Retievl I. Nïve Beginnings. Motivtions b. Flse Stt : A Pobbilistic Model without Vition? II. Fomultion. Tems nd

More information

1 Using Integration to Find Arc Lengths and Surface Areas

1 Using Integration to Find Arc Lengths and Surface Areas Novembe 9, 8 MAT86 Week Justin Ko Using Integtion to Find Ac Lengths nd Sufce Aes. Ac Length Fomul: If f () is continuous on [, b], then the c length of the cuve = f() on the intevl [, b] is given b s

More information

Vyacheslav Telnin. Search for New Numbers.

Vyacheslav Telnin. Search for New Numbers. Vycheslv Telnin Serch for New Numbers. 1 CHAPTER I 2 I.1 Introduction. In 1984, in the first issue for tht yer of the Science nd Life mgzine, I red the rticle "Non-Stndrd Anlysis" by V. Uspensky, in which

More information

SUMMER KNOWHOW STUDY AND LEARNING CENTRE

SUMMER KNOWHOW STUDY AND LEARNING CENTRE SUMMER KNOWHOW STUDY AND LEARNING CENTRE Indices & Logrithms 2 Contents Indices.2 Frctionl Indices.4 Logrithms 6 Exponentil equtions. Simplifying Surds 13 Opertions on Surds..16 Scientific Nottion..18

More information

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton 25. Finite Automt AUTOMATA AND LANGUAGES A system of computtion tht only hs finite numer of possile sttes cn e modeled using finite utomton A finite utomton is often illustrted s stte digrm d d d. d q

More information

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.) CS 373, Spring 29. Solutions to Mock midterm (sed on first midterm in CS 273, Fll 28.) Prolem : Short nswer (8 points) The nswers to these prolems should e short nd not complicted. () If n NF M ccepts

More information

Multiplying integers EXERCISE 2B INDIVIDUAL PATHWAYS. -6 ì 4 = -6 ì 0 = 4 ì 0 = -6 ì 3 = -5 ì -3 = 4 ì 3 = 4 ì 2 = 4 ì 1 = -5 ì -2 = -6 ì 2 = -6 ì 1 =

Multiplying integers EXERCISE 2B INDIVIDUAL PATHWAYS. -6 ì 4 = -6 ì 0 = 4 ì 0 = -6 ì 3 = -5 ì -3 = 4 ì 3 = 4 ì 2 = 4 ì 1 = -5 ì -2 = -6 ì 2 = -6 ì 1 = EXERCISE B INDIVIDUAL PATHWAYS Activity -B- Integer multipliction doc-69 Activity -B- More integer multipliction doc-698 Activity -B- Advnced integer multipliction doc-699 Multiplying integers FLUENCY

More information

NS-IBTS indices calculation procedure

NS-IBTS indices calculation procedure ICES Dt Cente DATRAS 1.1 NS-IBTS indices 2013 DATRAS Pocedue Document NS-IBTS indices clcultion pocedue Contents Genel... 2 I Rw ge dt CA -> Age-length key by RFA fo defined ge nge ALK... 4 II Rw length

More information

Lecture 3 ( ) (translated and slightly adapted from lecture notes by Martin Klazar)

Lecture 3 ( ) (translated and slightly adapted from lecture notes by Martin Klazar) Lecture 3 (5.3.2018) (trnslted nd slightly dpted from lecture notes by Mrtin Klzr) Riemnn integrl Now we define precisely the concept of the re, in prticulr, the re of figure U(, b, f) under the grph of

More information

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS CS 310 (sec 20) - Winter 2003 - Finl Exm (solutions) SOLUTIONS 1. (Logic) Use truth tles to prove the following logicl equivlences: () p q (p p) (q q) () p q (p q) (p q) () p q p q p p q q (q q) (p p)

More information

Math 426: Probability Final Exam Practice

Math 426: Probability Final Exam Practice Mth 46: Probbility Finl Exm Prctice. Computtionl problems 4. Let T k (n) denote the number of prtitions of the set {,..., n} into k nonempty subsets, where k n. Argue tht T k (n) kt k (n ) + T k (n ) by

More information

Michael Rotkowitz 1,2

Michael Rotkowitz 1,2 Novembe 23, 2006 edited Line Contolles e Unifomly Optiml fo the Witsenhusen Counteexmple Michel Rotkowitz 1,2 IEEE Confeence on Decision nd Contol, 2006 Abstct In 1968, Witsenhusen intoduced his celebted

More information

Answers to test yourself questions

Answers to test yourself questions Answes to test youself questions opic Descibing fields Gm Gm Gm Gm he net field t is: g ( d / ) ( 4d / ) d d Gm Gm Gm Gm Gm Gm b he net potentil t is: V d / 4d / d 4d d d V e 4 7 9 49 J kg 7 7 Gm d b E

More information

Nondeterminism and Nodeterministic Automata

Nondeterminism and Nodeterministic Automata Nondeterminism nd Nodeterministic Automt 61 Nondeterminism nd Nondeterministic Automt The computtionl mchine models tht we lerned in the clss re deterministic in the sense tht the next move is uniquely

More information

THEORY OF EQUATIONS OBJECTIVE PROBLEMS. If the eqution x 6x 0 0 ) - ) 4) -. If the sum of two oots of the eqution k is -48 ) 6 ) 48 4) 4. If the poduct of two oots of 4 ) -4 ) 4) - 4. If one oot of is

More information

Let's start with an example:

Let's start with an example: Finite Automt Let's strt with n exmple: Here you see leled circles tht re sttes, nd leled rrows tht re trnsitions. One of the sttes is mrked "strt". One of the sttes hs doule circle; this is terminl stte

More information

1 Probability Density Functions

1 Probability Density Functions Lis Yn CS 9 Continuous Distributions Lecture Notes #9 July 6, 28 Bsed on chpter by Chris Piech So fr, ll rndom vribles we hve seen hve been discrete. In ll the cses we hve seen in CS 9, this ment tht our

More information

We partition C into n small arcs by forming a partition of [a, b] by picking s i as follows: a = s 0 < s 1 < < s n = b.

We partition C into n small arcs by forming a partition of [a, b] by picking s i as follows: a = s 0 < s 1 < < s n = b. Mth 255 - Vector lculus II Notes 4.2 Pth nd Line Integrls We begin with discussion of pth integrls (the book clls them sclr line integrls). We will do this for function of two vribles, but these ides cn

More information

Lecture 08: Feb. 08, 2019

Lecture 08: Feb. 08, 2019 4CS4-6:Theory of Computtion(Closure on Reg. Lngs., regex to NDFA, DFA to regex) Prof. K.R. Chowdhry Lecture 08: Fe. 08, 2019 : Professor of CS Disclimer: These notes hve not een sujected to the usul scrutiny

More information

Andersen s Algorithm. CS 701 Final Exam (Reminder) Friday, December 12, 4:00 6:00 P.M., 1289 Computer Science.

Andersen s Algorithm. CS 701 Final Exam (Reminder) Friday, December 12, 4:00 6:00 P.M., 1289 Computer Science. CS 701 Finl Exm (Reminde) Fidy, Deeme 12, 4:00 6:00 P.M., 1289 Comute Siene. Andesen s Algoithm An lgoithm to uild oints-to gh fo C ogm is esented in: Pogm Anlysis nd Seiliztion fo the C ogmming Lnguge,

More information

n f(x i ) x. i=1 In section 4.2, we defined the definite integral of f from x = a to x = b as n f(x i ) x; f(x) dx = lim i=1

n f(x i ) x. i=1 In section 4.2, we defined the definite integral of f from x = a to x = b as n f(x i ) x; f(x) dx = lim i=1 The Fundmentl Theorem of Clculus As we continue to study the re problem, let s think bck to wht we know bout computing res of regions enclosed by curves. If we wnt to find the re of the region below the

More information

Chapter 3. Vector Spaces

Chapter 3. Vector Spaces 3.4 Liner Trnsformtions 1 Chpter 3. Vector Spces 3.4 Liner Trnsformtions Note. We hve lredy studied liner trnsformtions from R n into R m. Now we look t liner trnsformtions from one generl vector spce

More information

Review of Mathematical Concepts

Review of Mathematical Concepts ENEE 322: Signls nd Systems view of Mthemticl Concepts This hndout contins ief eview of mthemticl concepts which e vitlly impotnt to ENEE 322: Signls nd Systems. Since this mteil is coveed in vious couses

More information

Regular Language. Nonregular Languages The Pumping Lemma. The pumping lemma. Regular Language. The pumping lemma. Infinitely long words 3/17/15

Regular Language. Nonregular Languages The Pumping Lemma. The pumping lemma. Regular Language. The pumping lemma. Infinitely long words 3/17/15 Regulr Lnguge Nonregulr Lnguges The Pumping Lemm Models of Comput=on Chpter 10 Recll, tht ny lnguge tht cn e descried y regulr expression is clled regulr lnguge In this lecture we will prove tht not ll

More information

Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem 2/16/15

Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem 2/16/15 Models of Comput:on Lecture #8 Chpter 7 con:nued Any lnguge tht e defined y regulr expression, finite utomton, or trnsi:on grph cn e defined y ll three methods We prove this y showing tht ny lnguge defined

More information

Bases for Vector Spaces

Bases for Vector Spaces Bses for Vector Spces 2-26-25 A set is independent if, roughly speking, there is no redundncy in the set: You cn t uild ny vector in the set s liner comintion of the others A set spns if you cn uild everything

More information

10 m, so the distance from the Sun to the Moon during a solar eclipse is. The mass of the Sun, Earth, and Moon are = =

10 m, so the distance from the Sun to the Moon during a solar eclipse is. The mass of the Sun, Earth, and Moon are = = Chpte 1 nivesl Gvittion 11 *P1. () The un-th distnce is 1.4 nd the th-moon 8 distnce is.84, so the distnce fom the un to the Moon duing sol eclipse is 11 8 11 1.4.84 = 1.4 The mss of the un, th, nd Moon

More information