Search: The Core of Planning

Size: px
Start display at page:

Download "Search: The Core of Planning"

Transcription

1 Serch: The Core of Plnning Dr. Neil T. Dntm CSCI-498/598 RPM, Colordo School of Mines Spring 208 Dntm (Mines CSCI, RPM) Serch Spring 208 / 75

2 Outline Plnning nd Serch Problems Bsic Serch Depth-First Serch Bredth-First Serch Properties of Serch nd Plnning More Serch Vritions Itertive-Deepening Serch Bckwrd Serch Bidirectionl Serch Dntm (Mines CSCI, RPM) Serch Spring / 75

3 Plnning nd Serch Problems Outline Plnning nd Serch Problems Bsic Serch Depth-First Serch Bredth-First Serch Properties of Serch nd Plnning More Serch Vritions Itertive-Deepening Serch Bckwrd Serch Bidirectionl Serch Dntm (Mines CSCI, RPM) Serch Spring / 75

4 Plnning nd Serch Problems The Plnning / Serch Problem Given:. Stte spce: Q 2. Trnsition function δ : Q P (Q) 3. Strt stte: q 0 Q 4. Gol set: A Q Find: Pth p = (p 0,..., p n ) from strt to gol such tht: p 0 = q 0 is the strt stte p n A is gol stte Subsequent sttes re vlid trnsitions: p k+ δ(p k ) Dntm (Mines CSCI, RPM) Serch Spring / 75

5 Plnning nd Serch Problems Serch Trees Stte Spce: Q = {, b, c, d, e, f, g, h, i, j, k, l, m} Trnsition Function: δ() = {b, c, d} δ(b) = {e, f, g} δ(c) = {h, i, j} δ(d) = {k, l, m} Explore / construct serch tree until finding the gol Dntm (Mines CSCI, RPM) Serch Spring / 75

6 Plnning nd Serch Problems Exmple Domin 0: Gridworld Crtoon Grph Symbols 2 y 0 0 x 2 0, 2 0, 0, 0 strt, 2,, 0 2,22 2, 2, 0 Stte Spce: Q = {(0, 0), (0, ), (0, 2) (, 0), (, ), (, 2) (2, 0), (2, ), (2, 2)} Trnsitions: δ((0, 0)) = {(0, ), (, 0)} δ((, 0)) = {(0, 0), (, ), (2, 0)} δ((2, 0)) = {(, 0), (2, )}... Strt: q 0 = (0, 0) Gol: A = {(2, 2)} Dntm (Mines CSCI, RPM) Serch Spring / 75

7 Plnning nd Serch Problems Exmple Domin : Towers of Hnoi Strt Gol b c b c. Only one disk cn be moved t time. 2. Ech move consists of tking the upper disk from one of the stcks nd plcing it on top of nother stck. 3. No disk my be plced on top of smller disk. Dntm (Mines CSCI, RPM) Serch Spring / 75

8 Plnning nd Serch Problems Exmple Domin : Towers of Hnoi Trnsition Function Grph b (b), (), () b (), (b), () (), (), (b) b b (, b), (), () b (), (, b), () (), (), (, b) b b (b), (), () b (), (b), () (), (), (b) b Dntm (Mines CSCI, RPM) Serch Spring / 75

9 Plnning nd Serch Problems Exmple Domin : Towers of Hnoi Symbolic Trnsition Function b (, b), (), () b (b), (), () b (b), (), () Trnsition Function: ( ) { } δ (, b), (), () = (b), (), (), (b), (), () ( δ (b), (), () ) { = (b), (), (), (), (), (b), (b), (), () } ( δ (b), (), () ) { = (b), (), (), (b), (), (), (), (b), () }... Strt: q 0 = (, b), (), () { } Gol: A = (), (), (, b) Dntm (Mines CSCI, RPM) Serch Spring / 75

10 Plnning nd Serch Problems Exercise Domin 2: Auto Nvigtion Dntm (Mines CSCI, RPM) Serch Spring / 75

11 Plnning nd Serch Problems Exercise Domin 2: Auto Nvigtion Dntm (Mines CSCI, RPM) Serch Spring 208 / 75

12 Plnning nd Serch Problems Exercise Domin 2: Auto Nvigtion Dntm (Mines CSCI, RPM) Serch Spring / 75

13 Bsic Serch Outline Plnning nd Serch Problems Bsic Serch Depth-First Serch Bredth-First Serch Properties of Serch nd Plnning More Serch Vritions Itertive-Deepening Serch Bckwrd Serch Bidirectionl Serch Dntm (Mines CSCI, RPM) Serch Spring / 75

14 Bsic Serch Depth-First Serch Depth-First Serch Step 0 W = () Step W = (b, c, d) Step 2 W = (e, f, g, c, d) Step 3 W = (f, g, c, d) Dntm (Mines CSCI, RPM) Serch Spring / 75

15 Bsic Serch Depth-First Serch Depth-First Serch continued Step 4 W = (g, c, d) Step 5 W = (c, d) Step 6 W = (h, i, j, d) Step 7 W = (i, j, d) Dntm (Mines CSCI, RPM) Serch Spring / 75

16 Bsic Serch Depth-First Serch Depth-First Serch continued 2 Step 8 W = (j, d) Step 9 W = (d) Step 0 W = (k, l, m) Step W = (l, m) Dntm (Mines CSCI, RPM) Serch Spring / 75

17 Bsic Serch Depth-First Serch Depth-First Serch continued 3 Step 2 W = (m) Step 3 W = () Dntm (Mines CSCI, RPM) Serch Spring / 75

18 Bsic Serch Depth-First Serch DFS Outline Recursive Procedurl Trck serch progress vi function cll stck:. Visit node x. Visit ech neighbor of node x.2 Return Trck serch progress vi stck dt structure:. Pop node x from stck 2. Push ll neighbors of x onto stck 3. Repet Dntm (Mines CSCI, RPM) Serch Spring / 75

19 Bsic Serch Depth-First Serch DFS Algorithm Recursive Procedure dfs(q 0, δ, A) T [q 0 ] nil ; // Serch Tree 2 function visit(q) is 3 if q A then 4 return tree-pth (T, q); 5 else 6 forech q δ(q) do 7 if contins(t,q ) then 8 T [q ] q; 9 let p = visit (q ) in 0 if p then return p ; return nil; 2 return visit (q 0 ); Dntm (Mines CSCI, RPM) Serch Spring / 75

20 Bsic Serch Depth-First Serch Tree-Pth Procedure tree-pth(t, q) function rec(q,pth) is 2 if q then // Recursive Cse prent of q {}}{ 3 return rec T [q], cons (q, pth) ; 4 else // Bse Cse: t the root 5 return pth; 6 return rec (q, nil);. rec(m, ()) 2. rec(d, (m)) 3. rec(, (d, m)) 4. rec(nil, (, d, m)) 5. (, d, m) Dntm (Mines CSCI, RPM) Serch Spring / 75

21 Bsic Serch Depth-First Serch DFS Algorithm Procedurl Procedure dfs(q 0, δ, A) W (q 0 ) ; // Stck 2 T [q 0 ] nil ; // Serch Tree 3 while W do 4 let q = pop(w) in 5 if q A then 6 return tree-pth (T, q); 7 else 8 forech q δ(q) do 9 if contins(t,q ) then 0 T [q ] q; W push (q, W ); 2 return nil; Dntm (Mines CSCI, RPM) Serch Spring / 75

22 Bsic Serch Bredth-First Serch Bredth-First Serch Step 0 W = () Step W = (b, c, d) Step 2 W = (c, d, e, f, g) Step 3 W = (d, e, f, g, h, i) Dntm (Mines CSCI, RPM) Serch Spring / 75

23 Bsic Serch Bredth-First Serch Bredth-First Serch continued Step 4 W = (e, f, g, h, i, j, k, l, m) Step 5 W = (f, g, h, i, j, k, l, m) Step 6 W = (g, h, i, j, k, l, m) Step 7 W = (h, i, j, k, l, m) Dntm (Mines CSCI, RPM) Serch Spring / 75

24 Bsic Serch Bredth-First Serch Bredth-First Serch continued 2 Step 8 W = (i, j, k, l, m) Step 9 W = (j, k, l, m) Step 0 W = (k, l, m) Step W = (l, m) Dntm (Mines CSCI, RPM) Serch Spring / 75

25 Bsic Serch Bredth-First Serch Bredth-First Serch continued 3 Step 2 W = (m) Step 3 W = () Dntm (Mines CSCI, RPM) Serch Spring / 75

26 Bsic Serch Bredth-First Serch BFS Outline Procedurl Trck serch progress vi queue:. Dequeue node q from queue 2. Enqueue ll neighbors of q 3. Repet Dntm (Mines CSCI, RPM) Serch Spring / 75

27 Bsic Serch Bredth-First Serch BFS Algorithm Procedurl Procedure bfs(q 0, δ, A) W (q 0 ); // Queue 2 T [q 0 ] nil; // Serch Tree 3 while W do 4 let q = dequeue (W ) in 5 if q A then 6 return tree-pth (T, q); 7 else 8 forech q δ(q) do 9 if contins(t,q ) then 0 T [q ] q; W enqueue (q, W ); 2 return nil; Dntm (Mines CSCI, RPM) Serch Spring / 75

28 Properties of Serch nd Plnning Outline Plnning nd Serch Problems Bsic Serch Depth-First Serch Bredth-First Serch Properties of Serch nd Plnning More Serch Vritions Itertive-Deepening Serch Bckwrd Serch Bidirectionl Serch Dntm (Mines CSCI, RPM) Serch Spring / 75

29 Properties of Serch nd Plnning Plnning Properties Correctness: Do we get right nswer? Completeness: Do we lwys get n nswer? Optimlity: Do we get the best nswer? Dntm (Mines CSCI, RPM) Serch Spring / 75

30 Properties of Serch nd Plnning Correctness Definition (Correctness) A plnning lgorithm is correct if every pln it produces is vlid. Given q 0, δ, A: If P(q 0, δ, A) = (p 0,..., p n ), then: p 0 = q 0 p n A For ll p i, p i δ(p i ) Dntm (Mines CSCI, RPM) Serch Spring / 75

31 Properties of Serch nd Plnning Completeness Definition (Completeness) A plnning lgorithm is complete if: When solution exists, the plnner lwys returns solution, nd when solution does not exists, the plner returns flse. Given q 0, δ, A: Solution Exists There exists solution (p 0,..., p n ) where p 0 = q 0 p n A For ll p i, p i δ(p i ) Then P(q 0, δ, A) returns such. No Solution Exists Does not exist (p 0,..., p n ) where p 0 = q 0 p n A For ll p i, p i δ(p i ) Then P(q 0, δ, A) returns flse. Dntm (Mines CSCI, RPM) Serch Spring / 75

32 Properties of Serch nd Plnning Optimlity Definition (Optimlity) A plnning lgorithm is optiml if it produces the highest rewrd (/ lowest cost) pln. Given p 0, δ, A, stte rewrd function {}}{ V : Q R : pth rewrd ({}}{ n ) P(q 0, δ, A) = rgmx V (p i ) p 0,...,p n i=0 Dntm (Mines CSCI, RPM) Serch Spring / 75

33 Properties of Serch nd Plnning Trde-offs Why ren t we lwys Correct, Complete, nd Optiml? Computtion: Time Spce Incomplete informtion / model limittions Infinite Spces Dntm (Mines CSCI, RPM) Serch Spring / 75

34 More Serch Vritions Outline Plnning nd Serch Problems Bsic Serch Depth-First Serch Bredth-First Serch Properties of Serch nd Plnning More Serch Vritions Itertive-Deepening Serch Bckwrd Serch Bidirectionl Serch Dntm (Mines CSCI, RPM) Serch Spring / 75

35 More Serch Vritions Itertive-Deepening Serch Brnching Fctor Definition (Brnching Fctor) Number of outgoing edges from node of the serch tree.... n i,j n i+,0 n i+,... n i+,b n i+,b Dntm (Mines CSCI, RPM) Serch Spring / 75

36 More Serch Vritions Itertive-Deepening Serch BFS Memory Use b: brnching fctor d: current depth W b d W = (j, k, l, m, n, o.p, q, r, s, t, u, b, w, x, y, z, α, β) n o p q r s t u v w x y z α β γ δ ɛ ζ θ ι κ λ µ ν ξ π Memory use dominted by queued next level. Dntm (Mines CSCI, RPM) Serch Spring / 75

37 More Serch Vritions Itertive-Deepening Serch DFS Memory Use b: brnching fctor d: current depth W b d W = (z, α, β, j, d) n o p q r s t u v w x y z α β γ δ ɛ ζ θ ι κ λ µ ν ξ π Smll work list (still hve visited set) Dntm (Mines CSCI, RPM) Serch Spring / 75

38 More Serch Vritions Itertive-Deepening Serch DFS vs. BFS DFS BFS Pro: Compct work list (liner) Con: Not optiml Pro: Optiml (for equl step cost) Con: Exponentil work list Dntm (Mines CSCI, RPM) Serch Spring / 75

39 More Serch Vritions Itertive-Deepening Serch Itertive-Deepening Serch (IDS) Overview. Set depth limit to 0 2. Run depth-first serch up to depth-limit 2. If gol found, return 2.2 Otherwise, increment depth limit nd repet Dntm (Mines CSCI, RPM) Serch Spring / 75

40 More Serch Vritions Itertive-Deepening Serch Itertive-Deepening Serch Strt with depth limit 0 Step 0 W = () Step W = () Dntm (Mines CSCI, RPM) Serch Spring / 75

41 More Serch Vritions Itertive-Deepening Serch Itertive-Deepening Serch Retry with depth limit Step 2 W = () Step 3 W = (b, c, d) Step 4 W = (c, d) Step 5 W = (d) Dntm (Mines CSCI, RPM) Serch Spring / 75

42 More Serch Vritions Itertive-Deepening Serch Itertive-Deepening Serch Retry with depth limit continued Step 6 W = () Dntm (Mines CSCI, RPM) Serch Spring / 75

43 More Serch Vritions Itertive-Deepening Serch Itertive-Deepening Serch Retry with depth limit 2 Step 0 W = () Step W = (b, c, d) Step 2 W = (e, f, g, c, d) Step 3 W = (f, g, c, d) Dntm (Mines CSCI, RPM) Serch Spring / 75

44 More Serch Vritions Itertive-Deepening Serch Itertive-Deepening Serch Retry with depth limit 2 continued Step 4 W = (g, c, d) Step 5 W = (c, d) Step 6 W = (h, i, j, d) Step 7 W = (i, j, d) Dntm (Mines CSCI, RPM) Serch Spring / 75

45 More Serch Vritions Itertive-Deepening Serch Itertive-Deepening Serch Retry with depth limit 2 continued 2 Step 8 W = (j, d) Step 9 W = (d) Step 0 W = (k, l, m) Step W = (l, m) Dntm (Mines CSCI, RPM) Serch Spring / 75

46 More Serch Vritions Itertive-Deepening Serch Itertive-Deepening Serch Retry with depth limit 2 continued 3 Step 2 W = (m) Step 3 W = () Dntm (Mines CSCI, RPM) Serch Spring / 75

47 More Serch Vritions Itertive-Deepening Serch Depth-Limited Serch Algorithm Procedure dls(q 0, δ, A, d mx ) T [q 0 ] nil ; // Serch Tree 2 function visit(q, d) is 3 if q A then return tree-pth (T, q) ; 4 if (d 0) then return nil; 5 else 6 forech q δ(q) do 7 if contins(t,q ) then 8 T [q ] q; 9 let p = visit (q, d ) in 0 if p then return p ; return nil 2 return (visit (q 0, d mx ), T ); Dntm (Mines CSCI, RPM) Serch Spring / 75

48 More Serch Vritions Itertive-Deepening Serch Itertive-Deepening Serch Algorithm Procedure ids(q 0, δ, A) d 0; 2 repet 3 (p, T ) dls (q 0, δ, A, d); 4 d d + ; 5 until p is non-empty or T contins ll nodes; 6 return p Dntm (Mines CSCI, RPM) Serch Spring / 75

49 More Serch Vritions Itertive-Deepening Serch Exmple: IDS Gridworld Depth limit 0 Step 0 W=(0,0) Step W=() 2 2 0, Dntm (Mines CSCI, RPM) Serch Spring / 75

50 More Serch Vritions Itertive-Deepening Serch Exmple: IDS Gridworld Depth limit Step 2 W=(0,0) Step 3 W=((,0),(0,)) 2 2 0, Step 4 W=((0,)) Step 5 W=() 2 0,0 2 0,0,0,0 0, Dntm (Mines CSCI, RPM) Serch Spring / 75

51 More Serch Vritions Itertive-Deepening Serch Exmple: IDS Gridworld Depth limit 2 Step 6 W=(0,0) Step 7 W=((,0),(0,)) 2 2 0, Step 8 W=((2,0),(,),(0,)) Step 9 W=((,),(0,)) 2 0,0,0 2 0,0, ,0 Dntm (Mines CSCI, RPM) Serch Spring / 75

52 More Serch Vritions Itertive-Deepening Serch Exmple: IDS Gridworld Depth limit 2, continued Step 0 W=((0,)) Step W=((0,2)) 2 0,0 2 0,0,0,0 0, ,0, 0 2 2,0, 2 0 Step W=() 0,0,0 0, 2,0, 0,2 Dntm (Mines CSCI, RPM) Serch Spring / 75

53 More Serch Vritions Itertive-Deepening Serch Exmple: IDS Gridworld Depth limit 3 Step 3 W=(0,0) Step 4 W=((,0),(0,)) 2 2 0, Step 5 W=((2,0),(,),(0,)) Step 6 W=((2,),(,),(0,)) 2 0,0,0 2 0,0, ,0 Dntm (Mines CSCI, RPM) Serch Spring / 75

54 More Serch Vritions Itertive-Deepening Serch Exmple: IDS Gridworld Depth limit 3, continued Step 7 W=((,),(0,)) Step 8 W=((,2),(0,)) 2 0,0,0 2 0,0, , ,0, 2, 2, Step 9 W=((0,)) Step 20 W=((0,2)) 2 0,0 2 0,0,0,0 0, ,0, 0 2 2,0, 2,,2 2,,2 Dntm (Mines CSCI, RPM) Serch Spring / 75

55 More Serch Vritions Itertive-Deepening Serch Exmple: IDS Gridworld Depth limit 3, continued 2 Step 2 W=() 2 0, ,0,0, 0, 0,2 2,,2 Dntm (Mines CSCI, RPM) Serch Spring / 75

56 More Serch Vritions Itertive-Deepening Serch Exmple: IDS Gridworld Depth limit 4 Step 22 W=(0,0) Step 23 W=((,0),(0,)) 2 2 0, Step 24 W=((2,0),(,),(0,)) Step 25 W=((2,),(,),(0,)) 2 0,0,0 2 0,0, ,0 Dntm (Mines CSCI, RPM) Serch Spring / 75

57 More Serch Vritions Itertive-Deepening Serch Exmple: IDS Gridworld Depth limit 4, continued Step 26 W=((2,2),(,),(0,)) Step 27 W=((,),(0,)) 2 0,0,0 2 0,0, , ,0 2, 2, 2,2 Dntm (Mines CSCI, RPM) Serch Spring / 75

58 More Serch Vritions Itertive-Deepening Serch Hnoi Grph b (b), (), () b (), (b), () (), (), (b) b (b), (), () (), (b), () (), (), (b) b (, b), (), () b (), (, b), () (), (), (, b) b (b), (), () (), (, b), () (), (), (, b) (b), (), () (), (b), () (), (), (b) b (b), (), () b (), (b), () (), (), (b) b Dntm (Mines CSCI, RPM) Serch Spring / 75

59 More Serch Vritions Itertive-Deepening Serch Exercise: IDS Hnoi Depth limit 0 Dntm (Mines CSCI, RPM) Serch Spring / 75

60 More Serch Vritions Itertive-Deepening Serch Exercise: IDS Hnoi Depth limit Dntm (Mines CSCI, RPM) Serch Spring / 75

61 More Serch Vritions Itertive-Deepening Serch Exercise: IDS Hnoi Depth limit 2 Dntm (Mines CSCI, RPM) Serch Spring / 75

62 More Serch Vritions Itertive-Deepening Serch Exercise: IDS Hnoi Depth limit 2, continued Dntm (Mines CSCI, RPM) Serch Spring / 75

63 More Serch Vritions Itertive-Deepening Serch Exercise: IDS Hnoi Depth limit 3 Dntm (Mines CSCI, RPM) Serch Spring / 75

64 More Serch Vritions Itertive-Deepening Serch Exercise: IDS Hnoi Depth limit 3, continued Dntm (Mines CSCI, RPM) Serch Spring / 75

65 More Serch Vritions Bckwrd Serch Bckwrd Serch Outline. Strt from gol set 2. Follow trnsitions bckwrd to strt 3. End t strt stte Dntm (Mines CSCI, RPM) Serch Spring / 75

66 More Serch Vritions Bckwrd Serch Bckwrd Serch Algorithm Procedure bck-bfs(q 0, δ b, A) forech q A do 2 W b enqueue (q, W b ); // Queue 3 T b [q] nil; // Tree 4 while W b do 5 let q = dequeue (W b ) in 6 if q = q 0 then 7 return reverse-tree-pth (T b, q); 8 else 9 forech q δ b (q) do 0 if contins (T, q ) then T b [q ] q; 2 W b enqueue (q, W b ); 3 return nil; Dntm (Mines CSCI, RPM) Serch Spring / 75

67 More Serch Vritions Bckwrd Serch Reverse-Tree-Pth Procedure reverse-tree-pth(t, q) function rec(q) is 2 if q then // Recursive Cse 3 return cons(q, rec (T [q])) 4 else // Bse Cse: t the root 5 return nil 6 return rec (q);. rec(m) 2. cons(m, rec(d)) 3. cons(m, cons(d, rec())) 4. cons(m, cons(d, cons(, rec(nil)))) 5. cons(m, cons(d, cons(, nil))) 6. (m, d, ) Dntm (Mines CSCI, RPM) Serch Spring / 75

68 More Serch Vritions Bidirectionl Serch Bidirectionl Serch Bredth-First Serch e f g h i j k l m n o p q r s t u v w x y z α β γ δ ɛ ζ θ ι κ λ µ ν ξ π forwrd Bidirectionl Serch bckwrd π m ν ξ Dntm (Mines CSCI, RPM) Serch Spring / 75

69 More Serch Vritions Bidirectionl Serch Bredth-First vs Bidirectionl Serch Trees Bredth-First b d Bidirectionl 2b d/2 Dntm (Mines CSCI, RPM) Serch Spring / 75

70 More Serch Vritions Bidirectionl Serch BDS Algorithm Procedure bds(q 0, δ f, δ b, A) W f (q 0 ); // Init Forwrd Queue 2 T f [q] nil; // Init Forwrd Tree 3 forech q A do // Init Bckwrds 4 W b enqueue (q, W b ); // Bckwrd Queue 5 T b [q] nil; // Bckwrd Tree 6 while W f W b do /* Forwrd Step */ 7 (q, W f ) grow-bds (W f, T f, T b, δ f ) ; 8 if q then return bds-result (T f, T b, q) ; /* Bckwrd Step */ 9 (q, W b ) grow-bds (W b, T b, T f, δ b ) ; 0 if q then return bds-result (T f, T b, q) ; return nil; Dntm (Mines CSCI, RPM) Serch Spring / 75

71 More Serch Vritions Bidirectionl Serch BDS Algorithm Subroutines Procedure bds-grow(w, T, T o, δ) let q = dequeue (W ) in 2 forech q δ(q) do 3 if contins(t,q ) then 4 T [q ] q; 5 if contins(t o,q ) then // Found shred node 6 return (q,w); 7 else 8 W enqueue (q, W ) Procedure bds-result(t f, T b, q) /* Pth from root to q */ p f tree-pth (T f, q); /* Pth from q+ to gol */ 2 p b reverse-tree-pth (T b, T b [q]); 3 return ppend (p f, p b ); 9 return (nil,w); Dntm (Mines CSCI, RPM) Serch Spring / 75

72 More Serch Vritions Bidirectionl Serch Exmple: BDS Gridworld 2 0 Step 0 W f = ((0, 0)) W b = ((2, 2)) 0,0 2, Step W f = ((, 0), (0, )) W b = ((2, 2)) 0,0 2,2,0 0, 0 2 Step 2 W f = ((, 0), (0, )) Step 3 W f = ((0, ), (2, 0), (, )) 2 W b = ((, 2), (2, )) 0,0 2,2 2 W b = ((, 2), (2, )) 0,0 2, ,0 0,,2 2, 0 0,0 2 2,0, 0,,2 2, Dntm (Mines CSCI, RPM) Serch Spring / 75

73 More Serch Vritions Bidirectionl Serch Exmple: BDS Gridworld 2 0 Step 4 W f = ((0, ), (2, 0), (, )) W b = ((, 2), (2, )) 0,0 2,2,0 0,,2 2, 0 2 2,0, Dntm (Mines CSCI, RPM) Serch Spring / 75

74 More Serch Vritions Bidirectionl Serch Exercise: BDS Hnoi Dntm (Mines CSCI, RPM) Serch Spring / 75

75 More Serch Vritions Bidirectionl Serch Summry Plnning nd Serch Problems Bsic Serch Depth-First Serch Bredth-First Serch Properties of Serch nd Plnning More Serch Vritions Itertive-Deepening Serch Bckwrd Serch Bidirectionl Serch Dntm (Mines CSCI, RPM) Serch Spring / 75

CS 188: Artificial Intelligence Spring 2007

CS 188: Artificial Intelligence Spring 2007 CS 188: Artificil Intelligence Spring 2007 Lecture 3: Queue-Bsed Serch 1/23/2007 Srini Nrynn UC Berkeley Mny slides over the course dpted from Dn Klein, Sturt Russell or Andrew Moore Announcements Assignment

More information

DATA Search I 魏忠钰. 复旦大学大数据学院 School of Data Science, Fudan University. March 7 th, 2018

DATA Search I 魏忠钰. 复旦大学大数据学院 School of Data Science, Fudan University. March 7 th, 2018 DATA620006 魏忠钰 Serch I Mrch 7 th, 2018 Outline Serch Problems Uninformed Serch Depth-First Serch Bredth-First Serch Uniform-Cost Serch Rel world tsk - Pc-mn Serch problems A serch problem consists of:

More information

Uninformed Search Lecture 4

Uninformed Search Lecture 4 Lecture 4 Wht re common serch strtegies tht operte given only serch problem? How do they compre? 1 Agend A quick refresher DFS, BFS, ID-DFS, UCS Unifiction! 2 Serch Problem Formlism Defined vi the following

More information

Closure Properties of Regular Languages

Closure Properties of Regular Languages of Regulr Lnguges Dr. Neil T. Dntm CSCI-561, Colordo School of Mines Fll 2018 Dntm (Mines CSCI-561) Closure Properties of Regulr Lnguges Fll 2018 1 / 50 Outline Introduction Closure Properties Stte Minimiztion

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

Bellman Optimality Equation for V*

Bellman Optimality Equation for V* Bellmn Optimlity Eqution for V* The vlue of stte under n optiml policy must equl the expected return for the best ction from tht stte: V (s) mx Q (s,) A(s) mx A(s) mx A(s) Er t 1 V (s t 1 ) s t s, t s

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

19 Optimal behavior: Game theory

19 Optimal behavior: Game theory Intro. to Artificil Intelligence: Dle Schuurmns, Relu Ptrscu 1 19 Optiml behvior: Gme theory Adversril stte dynmics hve to ccount for worst cse Compute policy π : S A tht mximizes minimum rewrd Let S (,

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Finite Automt Theory nd Forml Lnguges TMV027/DIT321 LP4 2018 Lecture 10 An Bove April 23rd 2018 Recp: Regulr Lnguges We cn convert between FA nd RE; Hence both FA nd RE ccept/generte regulr lnguges; More

More information

Module 6 Value Iteration. CS 886 Sequential Decision Making and Reinforcement Learning University of Waterloo

Module 6 Value Iteration. CS 886 Sequential Decision Making and Reinforcement Learning University of Waterloo Module 6 Vlue Itertion CS 886 Sequentil Decision Mking nd Reinforcement Lerning University of Wterloo Mrkov Decision Process Definition Set of sttes: S Set of ctions (i.e., decisions): A Trnsition model:

More information

KNOWLEDGE-BASED AGENTS INFERENCE

KNOWLEDGE-BASED AGENTS INFERENCE AGENTS THAT REASON LOGICALLY KNOWLEDGE-BASED AGENTS Two components: knowledge bse, nd n inference engine. Declrtive pproch to building n gent. We tell it wht it needs to know, nd It cn sk itself wht to

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

Administrivia CSE 190: Reinforcement Learning: An Introduction

Administrivia CSE 190: Reinforcement Learning: An Introduction Administrivi CSE 190: Reinforcement Lerning: An Introduction Any emil sent to me bout the course should hve CSE 190 in the subject line! Chpter 4: Dynmic Progrmming Acknowledgment: A good number of these

More information

Minimal DFA. minimal DFA for L starting from any other

Minimal DFA. minimal DFA for L starting from any other Miniml DFA Among the mny DFAs ccepting the sme regulr lnguge L, there is exctly one (up to renming of sttes) which hs the smllest possile numer of sttes. Moreover, it is possile to otin tht miniml DFA

More information

Exercises Chapter 1. Exercise 1.1. Let Σ be an alphabet. Prove wv = w + v for all strings w and v.

Exercises Chapter 1. Exercise 1.1. Let Σ be an alphabet. Prove wv = w + v for all strings w and v. 1 Exercises Chpter 1 Exercise 1.1. Let Σ e n lphet. Prove wv = w + v for ll strings w nd v. Prove # (wv) = # (w)+# (v) for every symol Σ nd every string w,v Σ. Exercise 1.2. Let w 1,w 2,...,w k e k strings,

More information

Module 9: Tries and String Matching

Module 9: Tries and String Matching Module 9: Tries nd String Mtching CS 240 - Dt Structures nd Dt Mngement Sjed Hque Veronik Irvine Tylor Smith Bsed on lecture notes by mny previous cs240 instructors Dvid R. Cheriton School of Computer

More information

Module 9: Tries and String Matching

Module 9: Tries and String Matching Module 9: Tries nd String Mtching CS 240 - Dt Structures nd Dt Mngement Sjed Hque Veronik Irvine Tylor Smith Bsed on lecture notes by mny previous cs240 instructors Dvid R. Cheriton School of Computer

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

1.4 Nonregular Languages

1.4 Nonregular Languages 74 1.4 Nonregulr Lnguges The number of forml lnguges over ny lphbet (= decision/recognition problems) is uncountble On the other hnd, the number of regulr expressions (= strings) is countble Hence, ll

More information

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!)

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!) CMSC 330: Orgniztion of Progrmming Lnguges DFAs, nd NFAs, nd Regexps (Oh my!) CMSC330 Spring 2018 Types of Finite Automt Deterministic Finite Automt (DFA) Exctly one sequence of steps for ech string All

More information

Faster Regular Expression Matching. Philip Bille Mikkel Thorup

Faster Regular Expression Matching. Philip Bille Mikkel Thorup Fster Regulr Expression Mtching Philip Bille Mikkel Thorup Outline Definition Applictions History tour of regulr expression mtching Thompson s lgorithm Myers lgorithm New lgorithm Results nd extensions

More information

Regular expressions, Finite Automata, transition graphs are all the same!!

Regular expressions, Finite Automata, transition graphs are all the same!! CSI 3104 /Winter 2011: Introduction to Forml Lnguges Chpter 7: Kleene s Theorem Chpter 7: Kleene s Theorem Regulr expressions, Finite Automt, trnsition grphs re ll the sme!! Dr. Neji Zgui CSI3104-W11 1

More information

CS:4330 Theory of Computation Spring Regular Languages. Equivalences between Finite automata and REs. Haniel Barbosa

CS:4330 Theory of Computation Spring Regular Languages. Equivalences between Finite automata and REs. Haniel Barbosa CS:4330 Theory of Computtion Spring 208 Regulr Lnguges Equivlences between Finite utomt nd REs Hniel Brbos Redings for this lecture Chpter of [Sipser 996], 3rd edition. Section.3. Finite utomt nd regulr

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

Finite-State Automata: Recap

Finite-State Automata: Recap Finite-Stte Automt: Recp Deepk D Souz Deprtment of Computer Science nd Automtion Indin Institute of Science, Bnglore. 09 August 2016 Outline 1 Introduction 2 Forml Definitions nd Nottion 3 Closure under

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

Deterministic Finite Automata

Deterministic Finite Automata Finite Automt Deterministic Finite Automt H. Geuvers nd J. Rot Institute for Computing nd Informtion Sciences Version: fll 2016 J. Rot Version: fll 2016 Tlen en Automten 1 / 21 Outline Finite Automt Finite

More information

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true. York University CSE 2 Unit 3. DFA Clsses Converting etween DFA, NFA, Regulr Expressions, nd Extended Regulr Expressions Instructor: Jeff Edmonds Don t chet y looking t these nswers premturely.. For ech

More information

Chapter 5 Plan-Space Planning

Chapter 5 Plan-Space Planning Lecture slides for Automted Plnning: Theory nd Prctice Chpter 5 Pln-Spce Plnning Dn S. Nu CMSC 722, AI Plnning University of Mrylnd, Spring 2008 1 Stte-Spce Plnning Motivtion g 1 1 g 4 4 s 0 g 5 5 g 2

More information

Section: Other Models of Turing Machines. Definition: Two automata are equivalent if they accept the same language.

Section: Other Models of Turing Machines. Definition: Two automata are equivalent if they accept the same language. Section: Other Models of Turing Mchines Definition: Two utomt re equivlent if they ccept the sme lnguge. Turing Mchines with Sty Option Modify δ, Theorem Clss of stndrd TM s is equivlent to clss of TM

More information

Where did dynamic programming come from?

Where did dynamic programming come from? Where did dynmic progrmming come from? String lgorithms Dvid Kuchk cs302 Spring 2012 Richrd ellmn On the irth of Dynmic Progrmming Sturt Dreyfus http://www.eng.tu.c.il/~mi/cd/ or50/1526-5463-2002-50-01-0048.pdf

More information

Reinforcement Learning

Reinforcement Learning Reinforcement Lerning Tom Mitchell, Mchine Lerning, chpter 13 Outline Introduction Comprison with inductive lerning Mrkov Decision Processes: the model Optiml policy: The tsk Q Lerning: Q function Algorithm

More information

Chapter 4 State-Space Planning

Chapter 4 State-Space Planning Leture slides for Automted Plnning: Theory nd Prtie Chpter 4 Stte-Spe Plnning Dn S. Nu CMSC 722, AI Plnning University of Mrylnd, Spring 2008 1 Motivtion Nerly ll plnning proedures re serh proedures Different

More information

CSE : Exam 3-ANSWERS, Spring 2011 Time: 50 minutes

CSE : Exam 3-ANSWERS, Spring 2011 Time: 50 minutes CSE 260-002: Exm 3-ANSWERS, Spring 20 ime: 50 minutes Nme: his exm hs 4 pges nd 0 prolems totling 00 points. his exm is closed ook nd closed notes.. Wrshll s lgorithm for trnsitive closure computtion is

More information

We will see what is meant by standard form very shortly

We will see what is meant by standard form very shortly THEOREM: For fesible liner progrm in its stndrd form, the optimum vlue of the objective over its nonempty fesible region is () either unbounded or (b) is chievble t lest t one extreme point of the fesible

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

Reinforcement learning II

Reinforcement learning II CS 1675 Introduction to Mchine Lerning Lecture 26 Reinforcement lerning II Milos Huskrecht milos@cs.pitt.edu 5329 Sennott Squre Reinforcement lerning Bsics: Input x Lerner Output Reinforcement r Critic

More information

CMSC 330: Organization of Programming Languages

CMSC 330: Organization of Programming Languages CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 CMSC 330 1 Types of Finite Automt Deterministic Finite Automt (DFA) Exctly one sequence of steps for ech string All exmples so fr Nondeterministic

More information

Java II Finite Automata I

Java II Finite Automata I Jv II Finite Automt I Bernd Kiefer Bernd.Kiefer@dfki.de Deutsches Forschungszentrum für künstliche Intelligenz Finite Automt I p.1/13 Processing Regulr Expressions We lredy lerned out Jv s regulr expression

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

NFAs continued, Closure Properties of Regular Languages

NFAs continued, Closure Properties of Regular Languages Algorithms & Models of Computtion CS/ECE 374, Fll 2017 NFAs continued, Closure Properties of Regulr Lnguges Lecture 5 Tuesdy, Septemer 12, 2017 Sriel Hr-Peled (UIUC) CS374 1 Fll 2017 1 / 31 Regulr Lnguges,

More information

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb. CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt

More information

Formal Methods in Software Engineering

Formal Methods in Software Engineering Forml Methods in Softwre Engineering Lecture 09 orgniztionl issues Prof. Dr. Joel Greenyer Decemer 9, 2014 Written Exm The written exm will tke plce on Mrch 4 th, 2015 The exm will tke 60 minutes nd strt

More information

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2 CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt

More information

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University CS415 Compilers Lexicl Anlysis nd These slides re sed on slides copyrighted y Keith Cooper, Ken Kennedy & Lind Torczon t Rice University First Progrmming Project Instruction Scheduling Project hs een posted

More information

Balanced binary search trees

Balanced binary search trees 02110 Inge Li Gørtz Overview Blnced binry serch trees: Red-blck trees nd 2-3-4 trees Amortized nlysis Dynmic progrmming Network flows String mtching String indexing Computtionl geometry Introduction to

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

Formal Languages and Automata

Formal Languages and Automata Moile Computing nd Softwre Engineering p. 1/5 Forml Lnguges nd Automt Chpter 2 Finite Automt Chun-Ming Liu cmliu@csie.ntut.edu.tw Deprtment of Computer Science nd Informtion Engineering Ntionl Tipei University

More information

Bayesian Networks: Approximate Inference

Bayesian Networks: Approximate Inference pproches to inference yesin Networks: pproximte Inference xct inference Vrillimintion Join tree lgorithm pproximte inference Simplify the structure of the network to mkxct inferencfficient (vritionl methods,

More information

CS 267: Automated Verification. Lecture 8: Automata Theoretic Model Checking. Instructor: Tevfik Bultan

CS 267: Automated Verification. Lecture 8: Automata Theoretic Model Checking. Instructor: Tevfik Bultan CS 267: Automted Verifiction Lecture 8: Automt Theoretic Model Checking Instructor: Tevfik Bultn LTL Properties Büchi utomt [Vrdi nd Wolper LICS 86] Büchi utomt: Finite stte utomt tht ccept infinite strings

More information

. Double-angle formulas. Your answer should involve trig functions of θ, and not of 2θ. sin 2 (θ) =

. Double-angle formulas. Your answer should involve trig functions of θ, and not of 2θ. sin 2 (θ) = Review of some needed Trig. Identities for Integrtion. Your nswers should be n ngle in RADIANS. rccos( 1 ) = π rccos( - 1 ) = 2π 2 3 2 3 rcsin( 1 ) = π rcsin( - 1 ) = -π 2 6 2 6 Cn you do similr problems?

More information

Lexical Analysis Part III

Lexical Analysis Part III Lexicl Anlysis Prt III Chpter 3: Finite Automt Slides dpted from : Roert vn Engelen, Florid Stte University Alex Aiken, Stnford University Design of Lexicl Anlyzer Genertor Trnslte regulr expressions to

More information

First Midterm Examination

First Midterm Examination Çnky University Deprtment of Computer Engineering 203-204 Fll Semester First Midterm Exmintion ) Design DFA for ll strings over the lphet Σ = {,, c} in which there is no, no nd no cc. 2) Wht lnguge does

More information

Nondeterminism. Nondeterministic Finite Automata. Example: Moves on a Chessboard. Nondeterminism (2) Example: Chessboard (2) Formal NFA

Nondeterminism. Nondeterministic Finite Automata. Example: Moves on a Chessboard. Nondeterminism (2) Example: Chessboard (2) Formal NFA Nondeterminism Nondeterministic Finite Automt Nondeterminism Subset Construction A nondeterministic finite utomton hs the bility to be in severl sttes t once. Trnsitions from stte on n input symbol cn

More information

Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-*

Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-* Regulr Expressions (RE) Regulr Expressions (RE) Empty set F A RE denotes the empty set Opertion Nottion Lnguge UNIX Empty string A RE denotes the set {} Alterntion R +r L(r ) L(r ) r r Symol Alterntion

More information

Lecture 6 Regular Grammars

Lecture 6 Regular Grammars Lecture 6 Regulr Grmmrs COT 4420 Theory of Computtion Section 3.3 Grmmr A grmmr G is defined s qudruple G = (V, T, S, P) V is finite set of vribles T is finite set of terminl symbols S V is specil vrible

More information

Good-for-Games Automata versus Deterministic Automata.

Good-for-Games Automata versus Deterministic Automata. Good-for-Gmes Automt versus Deterministic Automt. Denis Kuperberg 1,2 Mich l Skrzypczk 1 1 University of Wrsw 2 IRIT/ONERA (Toulouse) Séminire MoVe 12/02/2015 LIF, Luminy Introduction Deterministic utomt

More information

Lecture 12: Numerical Quadrature

Lecture 12: Numerical Quadrature Lecture 12: Numericl Qudrture J.K. Ryn@tudelft.nl WI3097TU Delft Institute of Applied Mthemtics Delft University of Technology 5 December 2012 () Numericl Qudrture 5 December 2012 1 / 46 Outline 1 Review

More information

First Midterm Examination

First Midterm Examination 24-25 Fll Semester First Midterm Exmintion ) Give the stte digrm of DFA tht recognizes the lnguge A over lphet Σ = {, } where A = {w w contins or } 2) The following DFA recognizes the lnguge B over lphet

More information

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages 5//6 Grmmr Automt nd Lnguges Regulr Grmmr Context-free Grmmr Context-sensitive Grmmr Prof. Mohmed Hmd Softwre Engineering L. The University of Aizu Jpn Regulr Lnguges Context Free Lnguges Context Sensitive

More information

{ } = E! & $ " k r t +k +1

{ } = E! & $  k r t +k +1 Chpter 4: Dynmic Progrmming Objectives of this chpter: Overview of collection of clssicl solution methods for MDPs known s dynmic progrmming (DP) Show how DP cn be used to compute vlue functions, nd hence,

More information

Chapter 4: Dynamic Programming

Chapter 4: Dynamic Programming Chpter 4: Dynmic Progrmming Objectives of this chpter: Overview of collection of clssicl solution methods for MDPs known s dynmic progrmming (DP) Show how DP cn be used to compute vlue functions, nd hence,

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

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute Victor Admchik Dnny Sletor Gret Theoreticl Ides In Computer Science CS 5-25 Spring 2 Lecture 2 Mr 3, 2 Crnegie Mellon University Deterministic Finite Automt Finite Automt A mchine so simple tht you cn

More information

1 Nondeterministic Finite Automata

1 Nondeterministic Finite Automata 1 Nondeterministic Finite Automt Suppose in life, whenever you hd choice, you could try oth possiilities nd live your life. At the end, you would go ck nd choose the one tht worked out the est. Then you

More information

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages Deprtment of Computer Science, Austrlin Ntionl University COMP2600 Forml Methods for Softwre Engineering Semester 2, 206 Assignment Automt, Lnguges, nd Computility Smple Solutions Finite Stte Automt nd

More information

Decision Networks. CS 188: Artificial Intelligence Fall Example: Decision Networks. Decision Networks. Decisions as Outcome Trees

Decision Networks. CS 188: Artificial Intelligence Fall Example: Decision Networks. Decision Networks. Decisions as Outcome Trees CS 188: Artificil Intelligence Fll 2011 Decision Networks ME: choose the ction which mximizes the expected utility given the evidence mbrell Lecture 17: Decision Digrms 10/27/2011 Cn directly opertionlize

More information

Efficient Planning. R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

Efficient Planning. R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction Efficient Plnning 1 Tuesdy clss summry: Plnning: ny computtionl process tht uses model to crete or improve policy Dyn frmework: 2 Questions during clss Why use simulted experience? Cn t you directly compute

More information

On Determinisation of History-Deterministic Automata.

On Determinisation of History-Deterministic Automata. On Deterministion of History-Deterministic Automt. Denis Kupererg Mich l Skrzypczk University of Wrsw YR-ICALP 2014 Copenhgen Introduction Deterministic utomt re centrl tool in utomt theory: Polynomil

More information

NFAs continued, Closure Properties of Regular Languages

NFAs continued, Closure Properties of Regular Languages lgorithms & Models of omputtion S/EE 374, Spring 209 NFs continued, losure Properties of Regulr Lnguges Lecture 5 Tuesdy, Jnury 29, 209 Regulr Lnguges, DFs, NFs Lnguges ccepted y DFs, NFs, nd regulr expressions

More information

The Knapsack Problem. COSC 3101A - Design and Analysis of Algorithms 9. Fractional Knapsack Problem. Fractional Knapsack Problem

The Knapsack Problem. COSC 3101A - Design and Analysis of Algorithms 9. Fractional Knapsack Problem. Fractional Knapsack Problem The Knpsck Prolem COSC A - Design nd Anlsis of Algorithms Knpsck Prolem Huffmn Codes Introduction to Grphs Mn of these slides re tken from Monic Nicolescu, Univ. of Nevd, Reno, monic@cs.unr.edu The - knpsck

More information

Part 5 out of 5. Automata & languages. A primer on the Theory of Computation. Last week was all about. a superset of Regular Languages

Part 5 out of 5. Automata & languages. A primer on the Theory of Computation. Last week was all about. a superset of Regular Languages Automt & lnguges A primer on the Theory of Computtion Lurent Vnbever www.vnbever.eu Prt 5 out of 5 ETH Zürich (D-ITET) October, 19 2017 Lst week ws ll bout Context-Free Lnguges Context-Free Lnguges superset

More information

Review of Gaussian Quadrature method

Review of Gaussian Quadrature method Review of Gussin Qudrture method Nsser M. Asi Spring 006 compiled on Sundy Decemer 1, 017 t 09:1 PM 1 The prolem To find numericl vlue for the integrl of rel vlued function of rel vrile over specific rnge

More information

Introduction To Matrices MCV 4UI Assignment #1

Introduction To Matrices MCV 4UI Assignment #1 Introduction To Mtrices MCV UI Assignment # INTRODUCTION: A mtrix plurl: mtrices) is rectngulr rry of numbers rrnged in rows nd columns Exmples: ) b) c) [ ] d) Ech number ppering in the rry is sid to be

More information

Chapter 14. Matrix Representations of Linear Transformations

Chapter 14. Matrix Representations of Linear Transformations Chpter 4 Mtrix Representtions of Liner Trnsformtions When considering the Het Stte Evolution, we found tht we could describe this process using multipliction by mtrix. This ws nice becuse computers cn

More information

2D1431 Machine Learning Lab 3: Reinforcement Learning

2D1431 Machine Learning Lab 3: Reinforcement Learning 2D1431 Mchine Lerning Lb 3: Reinforcement Lerning Frnk Hoffmnn modified by Örjn Ekeberg December 7, 2004 1 Introduction In this lb you will lern bout dynmic progrmming nd reinforcement lerning. It is ssumed

More information

Math& 152 Section Integration by Parts

Math& 152 Section Integration by Parts Mth& 5 Section 7. - Integrtion by Prts Integrtion by prts is rule tht trnsforms the integrl of the product of two functions into other (idelly simpler) integrls. Recll from Clculus I tht given two differentible

More information

Uses of transformations. 3D transformations. Review of vectors. Vectors in 3D. Points vs. vectors. Homogeneous coordinates S S [ H [ S \ H \ S ] H ]

Uses of transformations. 3D transformations. Review of vectors. Vectors in 3D. Points vs. vectors. Homogeneous coordinates S S [ H [ S \ H \ S ] H ] Uses of trnsformtions 3D trnsformtions Modeling: position nd resize prts of complex model; Viewing: define nd position the virtul cmer Animtion: define how objects move/chnge with time y y Sclr (dot) product

More information

Goals: Determine how to calculate the area described by a function. Define the definite integral. Explore the relationship between the definite

Goals: Determine how to calculate the area described by a function. Define the definite integral. Explore the relationship between the definite Unit #8 : The Integrl Gols: Determine how to clculte the re described by function. Define the definite integrl. Eplore the reltionship between the definite integrl nd re. Eplore wys to estimte the definite

More information

. Double-angle formulas. Your answer should involve trig functions of θ, and not of 2θ. cos(2θ) = sin(2θ) =.

. Double-angle formulas. Your answer should involve trig functions of θ, and not of 2θ. cos(2θ) = sin(2θ) =. Review of some needed Trig Identities for Integrtion Your nswers should be n ngle in RADIANS rccos( 1 2 ) = rccos( - 1 2 ) = rcsin( 1 2 ) = rcsin( - 1 2 ) = Cn you do similr problems? Review of Bsic Concepts

More information

Can the Phase I problem be unfeasible or unbounded? -No

Can the Phase I problem be unfeasible or unbounded? -No Cn the Phse I problem be unfesible or unbounded? -No Phse I: min 1X AX + IX = b with b 0 X 1, X 0 By mnipulting constrints nd dding/subtrcting slck/surplus vribles, we cn get b 0 A fesible solution with

More information

Formal languages, automata, and theory of computation

Formal languages, automata, and theory of computation Mälrdlen University TEN1 DVA337 2015 School of Innovtion, Design nd Engineering Forml lnguges, utomt, nd theory of computtion Thursdy, Novemer 5, 14:10-18:30 Techer: Dniel Hedin, phone 021-107052 The exm

More information

Supervisory Control (4CM30)

Supervisory Control (4CM30) Supervisory Control (4CM30) Verifiction in mcrl2 Michel Reniers M.A.Reniers@tue.nl 2016-2017 Verifiction in mcrl2 M CIF = φ CIF iff M mcrl2 = φ mcrl2 1. Adpt CIF model 2. Formulte property in modl µ-clculus

More information

Concepts of Concurrent Computation Spring 2015 Lecture 9: Petri Nets

Concepts of Concurrent Computation Spring 2015 Lecture 9: Petri Nets Concepts of Concurrent Computtion Spring 205 Lecture 9: Petri Nets Sebstin Nnz Chris Poskitt Chir of Softwre Engineering Petri nets Petri nets re mthemticl models for describing systems with concurrency

More information

CSC 473 Automata, Grammars & Languages 11/9/10

CSC 473 Automata, Grammars & Languages 11/9/10 CSC 473 utomt, Grmmrs & Lnguges 11/9/10 utomt, Grmmrs nd Lnguges Discourse 06 Decidbility nd Undecidbility Decidble Problems for Regulr Lnguges Theorem 4.1: (embership/cceptnce Prob. for DFs) = {, w is

More information

Math 520 Final Exam Topic Outline Sections 1 3 (Xiao/Dumas/Liaw) Spring 2008

Math 520 Final Exam Topic Outline Sections 1 3 (Xiao/Dumas/Liaw) Spring 2008 Mth 520 Finl Exm Topic Outline Sections 1 3 (Xio/Dums/Liw) Spring 2008 The finl exm will be held on Tuesdy, My 13, 2-5pm in 117 McMilln Wht will be covered The finl exm will cover the mteril from ll of

More information

Automata and Languages

Automata and Languages Automt nd Lnguges Prof. Mohmed Hmd Softwre Engineering Lb. The University of Aizu Jpn Grmmr Regulr Grmmr Context-free Grmmr Context-sensitive Grmmr Regulr Lnguges Context Free Lnguges Context Sensitive

More information

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018 CS 301 Lecture 04 Regulr Expressions Stephen Checkowy Jnury 29, 2018 1 / 35 Review from lst time NFA N = (Q, Σ, δ, q 0, F ) where δ Q Σ P (Q) mps stte nd n lphet symol (or ) to set of sttes We run n NFA

More information

Non-deterministic Finite Automata

Non-deterministic Finite Automata Non-deterministic Finite Automt From Regulr Expressions to NFA- Eliminting non-determinism Rdoud University Nijmegen Non-deterministic Finite Automt H. Geuvers nd J. Rot Institute for Computing nd Informtion

More information

Overview HC9. Parsing: Top-Down & LL(1) Context-Free Grammars (1) Introduction. CFGs (3) Context-Free Grammars (2) Vertalerbouw HC 9: Ch.

Overview HC9. Parsing: Top-Down & LL(1) Context-Free Grammars (1) Introduction. CFGs (3) Context-Free Grammars (2) Vertalerbouw HC 9: Ch. Overview H9 Vertlerouw H 9: Prsing: op-down & LL(1) do 3 mei 2001 56 heo Ruys h. 8 - Prsing 8.1 ontext-free Grmmrs 8.2 op-down Prsing 8.3 LL(1) Grmmrs See lso [ho, Sethi & Ullmn 1986] for more thorough

More information

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1 Chpter Five: Nondeterministic Finite Automt Forml Lnguge, chpter 5, slide 1 1 A DFA hs exctly one trnsition from every stte on every symol in the lphet. By relxing this requirement we get relted ut more

More information

AM1 Mathematical Analysis 1 Oct Feb Exercises Lecture 3. sin(x + h) sin x h cos(x + h) cos x h

AM1 Mathematical Analysis 1 Oct Feb Exercises Lecture 3. sin(x + h) sin x h cos(x + h) cos x h AM Mthemticl Anlysis Oct. Feb. Dte: October Exercises Lecture Exercise.. If h, prove the following identities hold for ll x: sin(x + h) sin x h cos(x + h) cos x h = sin γ γ = sin γ γ cos(x + γ) (.) sin(x

More information

Homework 3 Solutions

Homework 3 Solutions CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 3 Solutions 1. Give NFAs with the specified numer of sttes recognizing ech of the following lnguges. In ll cses, the lphet is Σ = {,1}.

More information

CHAPTER 1 Regular Languages. Contents

CHAPTER 1 Regular Languages. Contents Finite Automt (FA or DFA) CHAPTE 1 egulr Lnguges Contents definitions, exmples, designing, regulr opertions Non-deterministic Finite Automt (NFA) definitions, euivlence of NFAs nd DFAs, closure under regulr

More information

Problem Set 3 Solutions

Problem Set 3 Solutions Chemistry 36 Dr Jen M Stndrd Problem Set 3 Solutions 1 Verify for the prticle in one-dimensionl box by explicit integrtion tht the wvefunction ψ ( x) π x is normlized To verify tht ψ ( x) is normlized,

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

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh Lnguges nd Automt Finite Automt Informtics 2A: Lecture 3 John Longley School of Informtics University of Edinburgh jrl@inf.ed.c.uk 22 September 2017 1 / 30 Lnguges nd Automt 1 Lnguges nd Automt Wht is

More information

CISC 4090 Theory of Computation

CISC 4090 Theory of Computation 9/6/28 Stereotypicl computer CISC 49 Theory of Computtion Finite stte mchines & Regulr lnguges Professor Dniel Leeds dleeds@fordhm.edu JMH 332 Centrl processing unit (CPU) performs ll the instructions

More information

Math 4310 Solutions to homework 1 Due 9/1/16

Math 4310 Solutions to homework 1 Due 9/1/16 Mth 4310 Solutions to homework 1 Due 9/1/16 1. Use the Eucliden lgorithm to find the following gretest common divisors. () gcd(252, 180) = 36 (b) gcd(513, 187) = 1 (c) gcd(7684, 4148) = 68 252 = 180 1

More information

New data structures to reduce data size and search time

New data structures to reduce data size and search time New dt structures to reduce dt size nd serch time Tsuneo Kuwbr Deprtment of Informtion Sciences, Fculty of Science, Kngw University, Hirtsuk-shi, Jpn FIT2018 1D-1, No2, pp1-4 Copyright (c)2018 by The Institute

More information