SlideShare a Scribd company logo
Mathematical Preliminaries Hw (p.13) 1, 4, 7, 8, 9, 13,  23, 26, 30, 32
Mathematical Preliminaries Sets  Functions Relations Graphs Proof Techniques
A set is a collection of elements SETS We write 1  is a member (or element) of set  A ship  is not a member (or element) of set  B Membership of a given set
Set Representations C = { a, b, c, d, e, f, g, h, i, j, k } C = { a, b, …, k } S = { 2, 4, 6, … } S = { j : j > 0, and j = 2k for some integer k > 0 } S = { j : j is nonnegative and even } finite set infinite set
A = { 1, 2, 3, 4, 5 } Universal Set :  all possible elements  U = { 1 , … , 10 } 1 2 3 4 5 A U 6 7 8 9 10
Set Operations A = { 1, 2, 3 }  B = { 2, 3, 4, 5} Union   A U B = { 1, 2, 3, 4, 5 }  Intersection A  B = { 2, 3 } Difference   A - B = { 1 } B - A = { 4, 5 } U 2 3 1 4 5 2 3 1 Venn diagrams A B
A Complement Universal set = {1, …, 7}  A = { 1, 2, 3 }  A = { 4, 5, 6, 7} 1 2 3 4 5 6 7 A A = A
0 2 4 6 1 3 5 7 even { even integers }  =  { odd integers } odd Integers
DeMorgan’s Laws A U B = A  B U A  B = A U B U
Empty, Null Set: = { } S U  = S S  =  S -  = S - S = U = Universal Set
Subset A = { 1, 2, 3}  B = { 1, 2, 3, 4, 5 } Proper Subset: A B A  B U A  B U
Disjoint Sets A = { 1, 2, 3 }  B = { 5, 6}  A B A  B =  U
Set Cardinality For finite sets A = { 2, 5, 7 } |A| = 3 (set size)
Powersets A powerset is a set of subsets Powerset of S = the set of all the subsets of S S = { a, b, c } 2 S  = {  , {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c} } Observation:   | 2 S  | = 2 |S|   ( 8 = 2 3  )
Cartesian Product A = { 2, 4 }  B = { 2, 3, 5 } A X B = { (2, 2), (2, 3), (2, 5), ( 4, 2), (4, 3), (4, 5) } A X B  is an  ordered  set, i.e.  A X B ≠ B X A |A X B| = |A|·|B| Generalizes to more than two sets A X B X … X Z
Relation from sets A to B Ex., A = { 1, 2, …, 7 }, B={ 1, 2, …, 50} {(x, y): x  A, y  B, and y= x 2 }  {(x, y): x  A, y  B, and x < y} Are relations from  A to B. A relation  on set A Equivalence relation a partition on set A
FUNCTIONS domain 1 2 3 a b c range f : A -> B  A B If A = domain  then f is a total function otherwise f is a partial function  f(1) = a 4 5 In general, we mean this.
GRAPHS A directed graph Nodes (Vertices)   V = { a, b, c, d, e } Edges (Ordered pairs) E = { (a,b), (b,c), (b,e),(c,a), (c,e), (d,c), (e,b), (e,d) } node edge a b c d e
Labeled Graph a b c d e 1 3 5 6 2 6 2
Walk Walk is a sequence of  adjacent  edges (e, d), (d, c), (c, a)  is a walk from  e  to  a  of length 3  (or denoted as  e-d-c-a  ) Length = # of edges a b c d e
Path a b c d e Path  is a walk where no edge is repeated Simple path : no node is repeated
Path a b c d e Path  is a walk where no edge is repeated Simple path : no node is repeated (e, b), (b, e), (e, d), (d, c), (c, a) is a path from  e  to  a  but it is not a simple path.
Cycle a b c d e 1 2 3 Cycle :   a walk from a node (base) to itself without  repeated edges Simple cycle :   only the base node is repeated   Loop:  an edge from a node to itself base
Find All  Simple Paths  starting from c  a b c d e origin The longest simple path has at most length 4. Since every vertex can only be visited at most once, and there are 4 other vertices.
(c, a) (c, e) Step 1 a b c d e origin Starting from vertex c, list all outgoing edges as long as they do not lead to any vertex already used in the path. At this point, we have all paths of length one starting at  c .  For all vertices  a , e  reached by  c , we list all outgoing edges originating at  a  or  e  according the same way we did before.
(c, a) (c, a), (a, b) (c, e) (c, e), (e, b) (c, e), (e, d) Step 2 a b c d e origin
Step 3 a b c d e origin (c, a) (c, a), (a, b) (c, a), (a, b), (b, e) (c, e) (c, e), (e, b) (c, e), (e, d)
Step 4 a b c d e origin (c, a) (c, a), (a, b) (c, a), (a, b), (b, e) (c, a), (a, b), (b, e), (e,d) (c, e) (c, e), (e, b) (c, e), (e, d)
Trees are connected directed graphs without cycles such that there is a special vertex called “root” having exactly one path to every other vertices. root leaf parent child
root leaf Level 0 Level 1 Level 2 Level 3 Height 3 The  level  associated with each vertex is the number of edges in the path form the root to the vertex. The  height  of the tree is the largest level number of any vertex.
Binary Trees A  binary tree  is a tree in which no parent can have more than two children. A  binary tree  is a tree in which no parent can have more than two children. (p.10) Example 1.5.  Prove that a binary tree of height n has at most 2 n  leaves.
PROOF TECHNIQUES Proof by induction Proof by contradiction
Induction We have statements   P 1 , P 2 , P 3 , …  If we know for some m that P 1 , P 2 , …, P m  are true for any k >= m that P 1 , P 2 , …, P k   imply  P k+1 Then   Every  P i   is true
Proof by Induction Inductive basis Find P 1 , P 2 , …, P m  which are true Inductive hypothesis Let’s assume P 1 , P 2 , …, P k  are true,  for any k >= m Inductive step Show that P k+1  is true
Example Theorem:   A binary tree of height  n has at most  2 n   leaves.  (p.10) We want to show:   L(n)  ≦  2 n   for n = 0, 1, 2,….   Proof by induction:   let  L(i)  be the maximum number of  leaves of any subtree at height  i
We want to show:   L(n)  ≦  2 n  for n = 0, 1, 2,….   Inductive basis  L(0) =1  ≦  2 0   (the root node  : height=0) Inductive hypothesis Let’s assume L(i)  ≦  2 i  for all i = 0, 1, …, k Induction step we need to show that L(k + 1)  ≦  2 k+1  ,   k ≧0
Induction Step From Inductive hypothesis: height k k+1 Let’s assume L(i)  ≦  2 i  for all i = 0, 1, …, k need to show that L(k + 1)  ≦  2 k+1 0 … L(k)  ≦  2 k
L(k)  ≦  2 k L(k+1)  ≦  2 · L(k)  ≦  2· 2 k   =  2 k+1 Induction Step height k k+1 (we add at most two nodes for every leaf of level k) … need to show that L(k + 1)  ≦  2 k+1 To get a binary tree of height  k+1  from one of height  k , we can create  at most 2 leaves  in place of  each previous one
Remark Recursion is another thing Example of recursive function: f(n) = f(n-1) + f(n-2) f(0) = 1,  f(1) = 1
Proof by Contradiction We want to prove that a statement P is true we assume that P is false then we arrive at an incorrect conclusion therefore, statement P must be true
Example Theorem:   is not rational Proof: Assume by contradiction that it is rational =  n/m  n, m are nonzero integers and without common factors We will show that this is impossible
= n/m  2 m 2  = n 2   Therefore,  n 2   is even n is even n = 2 k 2 m 2  = 4k 2 m 2  = 2k 2 m is even m = 2 p Thus, m and n have a common factor 2 Contradiction!
Languages
A language is a set of  strings String:   A sequence of letters Examples:  “cat”, “dog”, “house”, … Defined over an alphabet: Non-empty and finite
Alphabets and Strings We will use small alphabets: Strings
Empty String A string with no letters
String Operations Concatenation w    = ?    w  = ?
Empty String Observations:
Reverse
String Length Length: Examples: |    | = ?
Length of Concatenation Example:
Example 1.8  (p.17)   | uv | = | u | + | v |   A recursive definition of the length of a string: |  a  | =1, |  wa  | = |  w  | + 1 For all  a  ,  w  is any string from     Fix the string  u   and consider all possible strings   v   (  the length of  v  can be 1, 2, …. ( 0 is trivial) ) The proof is done by induction on the length of  v   ( for any given  u  )
Example 1.8  (p.17)   | uv | = | u | + | v | For a string  u ,  consider the length of  uv , concatenation of  u  with a string  v  Basis   Inductive Step   Induction Assumption
Substring Substring of string:  a subsequence of  consecutive letters String  Substring
Prefix and Suffix Prefixes  Suffixes prefix suffix
Another Operation Example:
Another Operation Definitions:
The * Operation : the set of all possible strings from alphabet   Example:  =  {  a, b }   then  =  ?
The  +  Operation : the set of all possible strings from alphabet  except
Languages Fall 2008 Automata
Note that: Sets Set size Set size String length
Another Example An infinite language
Operations on Languages The usual set operations Complement: ??
When we talk about a  language , we must know what ground does this language stands on ….. Languages We should know the  ALPHABETS  that constitute the language
Complement Example The complement of Universal Set?
Reverse Definition: Examples:
Reverse Hw # 10 (a) Prove or Disprove:  i.e.,  w R    L     w     L R
Concatenation Definition: Example:
Concatenation Hw 8. Prove
Another Operation Definition: Special case:
More Examples
Star-Closure (Kleene *) Definition: Example:
Positive Closure Definition: If   L then L +    L* - {  } It is  not  necessary that
True or False
True or False How to prove your answer?
Try Hw#  9 & 10(b) on p.28 What does  w  L 2  mean? What does  w  L * mean?
More Examples Consider a language on   = { a, b } What is  L 2   ?   L * ? e.g.
Grammars
Another Example Grammar: Derivation of sentence  :
Grammar: Derivation of sentence  :
Other derivations for  Grammar:
Language of the grammar
More Notation Grammar   Set of variables Set of terminal symbols Start variable Set of Production rules p.21
Example Grammar   :
More Notation Sentential Form: A sentence that contains  variables Example: sentence Sentential Forms
We write: Instead of:
In general we write: If:
By default:
Example Grammar Derivations
Another Grammar Example Grammar  : Derivations: From  A   aAb   and  A    , we know A   ,   ab ,  aabb ,  aaabbb , …  * * * *
Language defined by a Grammar For a grammar  with start variable  :  String of terminals
Example For grammar  : Since Pf: show L(G)   {a n b n+1 }  &  L(G)    {a n b n+1 }  from A   aAb we get A  a n Ab n  when it is applied n times. Together with A   , we get A  a n b n  for  n = 0, 1, 2, ….  :  w   L(G), i.e. S  * w
A Convenient Notation In general, we need to give a proof that a given language indeed generated by a certain grammar. Back to last Example
Example For grammar  : To  show Pf: show L(G)   {a n b n+1 }  &  L(G)    {a n b n+1 }  from A   aAb we get A  a n Ab n  when it is applied n times. Together with A   , we get A  a n b n  for  n = 0, 1, 2, ….  :  w   L(G), i.e. S  * w L ( G )     L &  L ( G )     L   Need to show
More Examples on Grammars Find grammars for  L  on { a, b } and give brief arguments to explain why they work. L  contains all strings with exactly one  a L  contains all strings with at least one  a L 3 At Least:  S   BaB; B  aB | bB |  
1. Problems on p.27  You should be able to do 2 ~ 17, 21 Hand in:  9, 10, 11c, 14ef, 15c, 17  2. Read  P. 37~ 41 , and try to describe  L ( M )   in Fig. 2.6.  Homework for next week.

More Related Content

PPT
Ch 2 lattice & boolean algebra
PDF
Theory of computation
PPTX
CMSC 56 | Lecture 9: Functions Representations
PPTX
CMSC 56 | Lecture 12: Recursive Definition & Algorithms, and Program Correctness
PDF
Regular language and Regular expression
PDF
End semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
PDF
Steiner Tree Parameterized by Treewidth
Ch 2 lattice & boolean algebra
Theory of computation
CMSC 56 | Lecture 9: Functions Representations
CMSC 56 | Lecture 12: Recursive Definition & Algorithms, and Program Correctness
Regular language and Regular expression
End semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Steiner Tree Parameterized by Treewidth

What's hot (20)

PDF
Cut and Count
PPT
Regular expression with DFA
PPT
Math task 3
PPT
Task 4
PPT
Blackbox task 2
PDF
Imc2020 day1&amp;2 problems&amp;solutions
PPT
3.1 intro toautomatatheory h1
PPT
PDF
Data Complexity in EL Family of Description Logics
PDF
Lex analysis
PPTX
REGULAR EXPRESSION TO N.F.A
PPTX
Introduction to automaton ppt
PPTX
Formal language
PPTX
2 integration and the substitution methods x
PPT
Top school in noida
PPT
SPLITTING FIELD.ppt
PDF
Predicate Logic
PPT
1.4 the basic language of functions
PDF
Chapter2CDpdf__2021_11_26_09_19_08.pdf
PPTX
Theory of automata and formal language
Cut and Count
Regular expression with DFA
Math task 3
Task 4
Blackbox task 2
Imc2020 day1&amp;2 problems&amp;solutions
3.1 intro toautomatatheory h1
Data Complexity in EL Family of Description Logics
Lex analysis
REGULAR EXPRESSION TO N.F.A
Introduction to automaton ppt
Formal language
2 integration and the substitution methods x
Top school in noida
SPLITTING FIELD.ppt
Predicate Logic
1.4 the basic language of functions
Chapter2CDpdf__2021_11_26_09_19_08.pdf
Theory of automata and formal language
Ad

Similar to Class1 (20)

PDF
Chapter 3 REGULAR EXPRESSION.pdf
PDF
Automata
PDF
Automata
PPTX
LEC 3 by oral patholgy peroio dv fr juiv.pptx
PPT
Lecture in Sets, Sequences and Summations
PPT
Finite automata intro
PDF
Answers Of Discrete Mathematics
PDF
G03201034038
PPTX
Mod 2_RegularExpressions.pptx
PPTX
CMSC 56 | Lecture 6: Sets & Set Operations
PDF
Prin digcommselectedsoln
PDF
Chapter1 Formal Language and Automata Theory
DOCX
PDF
Scribed lec8
DOCX
Cs6660 compiler design november december 2016 Answer key
PDF
Unit i
PPT
4898850.ppt
PDF
Set and Set operations, UITM KPPIM DUNGUN
PPT
Ch1 sets and_logic(1)
Chapter 3 REGULAR EXPRESSION.pdf
Automata
Automata
LEC 3 by oral patholgy peroio dv fr juiv.pptx
Lecture in Sets, Sequences and Summations
Finite automata intro
Answers Of Discrete Mathematics
G03201034038
Mod 2_RegularExpressions.pptx
CMSC 56 | Lecture 6: Sets & Set Operations
Prin digcommselectedsoln
Chapter1 Formal Language and Automata Theory
Scribed lec8
Cs6660 compiler design november december 2016 Answer key
Unit i
4898850.ppt
Set and Set operations, UITM KPPIM DUNGUN
Ch1 sets and_logic(1)
Ad

More from issbp (20)

PPT
Ch11 input output systems
PPT
Os10 2
PPT
Os10
PPT
Os9 2
PPT
Os9
PPT
Os8 2
PPT
Os8
PPT
Os7 2
PPT
Os7
PPT
Os6 2
PPT
Os6
PPT
Os5 2
PPT
Os5
PPT
Os4 2
PPT
Os4
PPT
Os3 2
PPT
Os3
PPT
Os2 2
PPT
Os2
PPT
Class9
Ch11 input output systems
Os10 2
Os10
Os9 2
Os9
Os8 2
Os8
Os7 2
Os7
Os6 2
Os6
Os5 2
Os5
Os4 2
Os4
Os3 2
Os3
Os2 2
Os2
Class9

Class1

  • 1. Mathematical Preliminaries Hw (p.13) 1, 4, 7, 8, 9, 13, 23, 26, 30, 32
  • 2. Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques
  • 3. A set is a collection of elements SETS We write 1 is a member (or element) of set A ship is not a member (or element) of set B Membership of a given set
  • 4. Set Representations C = { a, b, c, d, e, f, g, h, i, j, k } C = { a, b, …, k } S = { 2, 4, 6, … } S = { j : j > 0, and j = 2k for some integer k > 0 } S = { j : j is nonnegative and even } finite set infinite set
  • 5. A = { 1, 2, 3, 4, 5 } Universal Set : all possible elements U = { 1 , … , 10 } 1 2 3 4 5 A U 6 7 8 9 10
  • 6. Set Operations A = { 1, 2, 3 } B = { 2, 3, 4, 5} Union A U B = { 1, 2, 3, 4, 5 } Intersection A B = { 2, 3 } Difference A - B = { 1 } B - A = { 4, 5 } U 2 3 1 4 5 2 3 1 Venn diagrams A B
  • 7. A Complement Universal set = {1, …, 7} A = { 1, 2, 3 } A = { 4, 5, 6, 7} 1 2 3 4 5 6 7 A A = A
  • 8. 0 2 4 6 1 3 5 7 even { even integers } = { odd integers } odd Integers
  • 9. DeMorgan’s Laws A U B = A B U A B = A U B U
  • 10. Empty, Null Set: = { } S U = S S = S - = S - S = U = Universal Set
  • 11. Subset A = { 1, 2, 3} B = { 1, 2, 3, 4, 5 } Proper Subset: A B A B U A B U
  • 12. Disjoint Sets A = { 1, 2, 3 } B = { 5, 6} A B A B = U
  • 13. Set Cardinality For finite sets A = { 2, 5, 7 } |A| = 3 (set size)
  • 14. Powersets A powerset is a set of subsets Powerset of S = the set of all the subsets of S S = { a, b, c } 2 S = { , {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c} } Observation: | 2 S | = 2 |S| ( 8 = 2 3 )
  • 15. Cartesian Product A = { 2, 4 } B = { 2, 3, 5 } A X B = { (2, 2), (2, 3), (2, 5), ( 4, 2), (4, 3), (4, 5) } A X B is an ordered set, i.e. A X B ≠ B X A |A X B| = |A|·|B| Generalizes to more than two sets A X B X … X Z
  • 16. Relation from sets A to B Ex., A = { 1, 2, …, 7 }, B={ 1, 2, …, 50} {(x, y): x  A, y  B, and y= x 2 } {(x, y): x  A, y  B, and x < y} Are relations from A to B. A relation on set A Equivalence relation a partition on set A
  • 17. FUNCTIONS domain 1 2 3 a b c range f : A -> B A B If A = domain then f is a total function otherwise f is a partial function f(1) = a 4 5 In general, we mean this.
  • 18. GRAPHS A directed graph Nodes (Vertices) V = { a, b, c, d, e } Edges (Ordered pairs) E = { (a,b), (b,c), (b,e),(c,a), (c,e), (d,c), (e,b), (e,d) } node edge a b c d e
  • 19. Labeled Graph a b c d e 1 3 5 6 2 6 2
  • 20. Walk Walk is a sequence of adjacent edges (e, d), (d, c), (c, a) is a walk from e to a of length 3 (or denoted as e-d-c-a ) Length = # of edges a b c d e
  • 21. Path a b c d e Path is a walk where no edge is repeated Simple path : no node is repeated
  • 22. Path a b c d e Path is a walk where no edge is repeated Simple path : no node is repeated (e, b), (b, e), (e, d), (d, c), (c, a) is a path from e to a but it is not a simple path.
  • 23. Cycle a b c d e 1 2 3 Cycle : a walk from a node (base) to itself without repeated edges Simple cycle : only the base node is repeated Loop: an edge from a node to itself base
  • 24. Find All Simple Paths starting from c a b c d e origin The longest simple path has at most length 4. Since every vertex can only be visited at most once, and there are 4 other vertices.
  • 25. (c, a) (c, e) Step 1 a b c d e origin Starting from vertex c, list all outgoing edges as long as they do not lead to any vertex already used in the path. At this point, we have all paths of length one starting at c . For all vertices a , e reached by c , we list all outgoing edges originating at a or e according the same way we did before.
  • 26. (c, a) (c, a), (a, b) (c, e) (c, e), (e, b) (c, e), (e, d) Step 2 a b c d e origin
  • 27. Step 3 a b c d e origin (c, a) (c, a), (a, b) (c, a), (a, b), (b, e) (c, e) (c, e), (e, b) (c, e), (e, d)
  • 28. Step 4 a b c d e origin (c, a) (c, a), (a, b) (c, a), (a, b), (b, e) (c, a), (a, b), (b, e), (e,d) (c, e) (c, e), (e, b) (c, e), (e, d)
  • 29. Trees are connected directed graphs without cycles such that there is a special vertex called “root” having exactly one path to every other vertices. root leaf parent child
  • 30. root leaf Level 0 Level 1 Level 2 Level 3 Height 3 The level associated with each vertex is the number of edges in the path form the root to the vertex. The height of the tree is the largest level number of any vertex.
  • 31. Binary Trees A binary tree is a tree in which no parent can have more than two children. A binary tree is a tree in which no parent can have more than two children. (p.10) Example 1.5. Prove that a binary tree of height n has at most 2 n leaves.
  • 32. PROOF TECHNIQUES Proof by induction Proof by contradiction
  • 33. Induction We have statements P 1 , P 2 , P 3 , … If we know for some m that P 1 , P 2 , …, P m are true for any k >= m that P 1 , P 2 , …, P k imply P k+1 Then Every P i is true
  • 34. Proof by Induction Inductive basis Find P 1 , P 2 , …, P m which are true Inductive hypothesis Let’s assume P 1 , P 2 , …, P k are true, for any k >= m Inductive step Show that P k+1 is true
  • 35. Example Theorem: A binary tree of height n has at most 2 n leaves. (p.10) We want to show: L(n) ≦ 2 n for n = 0, 1, 2,…. Proof by induction: let L(i) be the maximum number of leaves of any subtree at height i
  • 36. We want to show: L(n) ≦ 2 n for n = 0, 1, 2,…. Inductive basis L(0) =1 ≦ 2 0 (the root node : height=0) Inductive hypothesis Let’s assume L(i) ≦ 2 i for all i = 0, 1, …, k Induction step we need to show that L(k + 1) ≦ 2 k+1 , k ≧0
  • 37. Induction Step From Inductive hypothesis: height k k+1 Let’s assume L(i) ≦ 2 i for all i = 0, 1, …, k need to show that L(k + 1) ≦ 2 k+1 0 … L(k) ≦ 2 k
  • 38. L(k) ≦ 2 k L(k+1) ≦ 2 · L(k) ≦ 2· 2 k = 2 k+1 Induction Step height k k+1 (we add at most two nodes for every leaf of level k) … need to show that L(k + 1) ≦ 2 k+1 To get a binary tree of height k+1 from one of height k , we can create at most 2 leaves in place of each previous one
  • 39. Remark Recursion is another thing Example of recursive function: f(n) = f(n-1) + f(n-2) f(0) = 1, f(1) = 1
  • 40. Proof by Contradiction We want to prove that a statement P is true we assume that P is false then we arrive at an incorrect conclusion therefore, statement P must be true
  • 41. Example Theorem: is not rational Proof: Assume by contradiction that it is rational = n/m n, m are nonzero integers and without common factors We will show that this is impossible
  • 42. = n/m 2 m 2 = n 2 Therefore, n 2 is even n is even n = 2 k 2 m 2 = 4k 2 m 2 = 2k 2 m is even m = 2 p Thus, m and n have a common factor 2 Contradiction!
  • 44. A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet: Non-empty and finite
  • 45. Alphabets and Strings We will use small alphabets: Strings
  • 46. Empty String A string with no letters
  • 47. String Operations Concatenation w  = ?  w = ?
  • 50. String Length Length: Examples: |  | = ?
  • 52. Example 1.8 (p.17) | uv | = | u | + | v | A recursive definition of the length of a string: | a | =1, | wa | = | w | + 1 For all a  , w is any string from  Fix the string u and consider all possible strings v ( the length of v can be 1, 2, …. ( 0 is trivial) ) The proof is done by induction on the length of v ( for any given u )
  • 53. Example 1.8 (p.17) | uv | = | u | + | v | For a string u , consider the length of uv , concatenation of u with a string v Basis Inductive Step Induction Assumption
  • 54. Substring Substring of string: a subsequence of consecutive letters String Substring
  • 55. Prefix and Suffix Prefixes Suffixes prefix suffix
  • 58. The * Operation : the set of all possible strings from alphabet Example: = { a, b } then = ?
  • 59. The + Operation : the set of all possible strings from alphabet except
  • 61. Note that: Sets Set size Set size String length
  • 62. Another Example An infinite language
  • 63. Operations on Languages The usual set operations Complement: ??
  • 64. When we talk about a language , we must know what ground does this language stands on ….. Languages We should know the ALPHABETS that constitute the language
  • 65. Complement Example The complement of Universal Set?
  • 67. Reverse Hw # 10 (a) Prove or Disprove: i.e., w R  L  w  L R
  • 72. Star-Closure (Kleene *) Definition: Example:
  • 73. Positive Closure Definition: If  L then L +  L* - {  } It is not necessary that
  • 75. True or False How to prove your answer?
  • 76. Try Hw# 9 & 10(b) on p.28 What does w  L 2 mean? What does w  L * mean?
  • 77. More Examples Consider a language on  = { a, b } What is L 2 ? L * ? e.g.
  • 79. Another Example Grammar: Derivation of sentence :
  • 82. Language of the grammar
  • 83. More Notation Grammar Set of variables Set of terminal symbols Start variable Set of Production rules p.21
  • 85. More Notation Sentential Form: A sentence that contains variables Example: sentence Sentential Forms
  • 87. In general we write: If:
  • 90. Another Grammar Example Grammar : Derivations: From A  aAb and A   , we know A   , ab , aabb , aaabbb , … * * * *
  • 91. Language defined by a Grammar For a grammar with start variable : String of terminals
  • 92. Example For grammar : Since Pf: show L(G)  {a n b n+1 } & L(G)  {a n b n+1 } from A  aAb we get A  a n Ab n when it is applied n times. Together with A   , we get A  a n b n for n = 0, 1, 2, ….  : w  L(G), i.e. S  * w
  • 93. A Convenient Notation In general, we need to give a proof that a given language indeed generated by a certain grammar. Back to last Example
  • 94. Example For grammar : To show Pf: show L(G)  {a n b n+1 } & L(G)  {a n b n+1 } from A  aAb we get A  a n Ab n when it is applied n times. Together with A   , we get A  a n b n for n = 0, 1, 2, ….  : w  L(G), i.e. S  * w L ( G )  L & L ( G )  L Need to show
  • 95. More Examples on Grammars Find grammars for L on { a, b } and give brief arguments to explain why they work. L contains all strings with exactly one a L contains all strings with at least one a L 3 At Least: S  BaB; B  aB | bB | 
  • 96. 1. Problems on p.27 You should be able to do 2 ~ 17, 21 Hand in: 9, 10, 11c, 14ef, 15c, 17 2. Read P. 37~ 41 , and try to describe L ( M ) in Fig. 2.6. Homework for next week.

Editor's Notes

  • #2: Fall 2008 Automata
  • #25: Fall 2008 Automata
  • #26: Fall 2008 Automata
  • #31: Fall 2008 Automata
  • #32: Fall 2008 Automata
  • #44: Fall 2008 Automata
  • #74: Fall 2008 Automata
  • #79: Fall 2008 Automata
  • #91: Fall 2008 Automata
  • #93: Fall 2008 Automata
  • #95: Fall 2008 Automata
  • #96: Fall 2008 Automata