SlideShare una empresa de Scribd logo
1 de 96
Mathematical Preliminaries Hw (p.13) 1, 4, 7, 8, 9, 13,  23, 26, 30, 32
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
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
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],finite set infinite set
A = { 1, 2, 3, 4, 5 } Universal Set :  all possible elements  ,[object Object],1 2 3 4 5 A U 6 7 8 9 10
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],U 2 3 1 4 5 2 3 1 Venn diagrams A B
A ,[object Object],[object Object],[object Object],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 ,[object Object],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 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
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 ,[object Object],[object Object],[object Object],[object Object],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 ,[object Object],[object Object]
Induction We have statements   P 1 , P 2 , P 3 , …  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Proof by Induction ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
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
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
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 ,[object Object],[object Object],[object Object],[object Object]
Proof by Contradiction ,[object Object],[object Object],[object Object],[object Object]
Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
= 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
[object Object],[object Object],[object Object],[object Object],Non-empty and finite
Alphabets and Strings ,[object Object],[object Object]
Empty String ,[object Object]
String Operations Concatenation w    = ?    w  = ?
Empty String ,[object Object]
Reverse
String Length ,[object Object],[object Object],|    | = ?
Length of Concatenation ,[object Object]
Example 1.8  (p.17)   | uv | = | u | + | v |   ,[object Object],|  a  | =1, |  wa  | = |  w  | + 1 For all  a  ,  w  is any string from     ,[object Object],[object Object]
Example 1.8  (p.17)   | uv | = | u | + | v | ,[object Object],[object Object],[object Object],[object Object]
Substring ,[object Object],[object Object]
Prefix and Suffix ,[object Object],prefix suffix
Another Operation ,[object Object]
Another Operation ,[object Object]
The * Operation ,[object Object],[object Object],[object Object]
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 ,[object Object]
Operations on Languages ,[object Object],[object Object]
[object Object],Languages We should know the  ALPHABETS  that constitute the language
Complement Example ,[object Object],Universal Set?
Reverse ,[object Object],[object Object]
Reverse Hw # 10 (a) Prove or Disprove:  i.e.,  w R    L     w     L R
Concatenation ,[object Object],[object Object]
Concatenation Hw 8. Prove
Another Operation ,[object Object],[object Object]
More Examples
Star-Closure (Kleene *) ,[object Object],[object Object]
Positive Closure ,[object Object],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 ,[object Object],What is  L 2   ?   L * ? e.g.
Grammars
Another Example ,[object Object],[object Object]
[object Object],[object Object]
[object Object],Grammar:
[object Object]
More Notation ,[object Object],Set of variables Set of terminal symbols Start variable Set of Production rules p.21
Example ,[object Object]
More Notation ,[object Object],[object Object],[object Object],[object Object],sentence Sentential Forms
[object Object],[object Object]
[object Object],[object Object]
[object Object]
Example Grammar Derivations
Another Grammar Example ,[object Object],Derivations: From  A   aAb   and  A    , we know A   ,   ab ,  aabb ,  aaabbb , …  * * * *
Language defined by a Grammar ,[object Object],[object Object],String of terminals
Example ,[object Object],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 ,[object Object],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 ,[object Object],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  ,[object Object],[object Object],[object Object],2. Read  P. 37~ 41 , and try to describe  L ( M )   in Fig. 2.6.  Homework for next week.

Más contenido relacionado

La actualidad más candente

Cut and Count
Cut and CountCut and Count
Cut and CountASPAK2014
 
Regular expression with DFA
Regular expression with DFARegular expression with DFA
Regular expression with DFAMaulik Togadiya
 
Imc2020 day1&2 problems&solutions
Imc2020 day1&2 problems&solutionsImc2020 day1&2 problems&solutions
Imc2020 day1&2 problems&solutionsChristos Loizos
 
3.1 intro toautomatatheory h1
3.1 intro toautomatatheory  h13.1 intro toautomatatheory  h1
3.1 intro toautomatatheory h1Rajendran
 
Data Complexity in EL Family of Description Logics
Data Complexity in EL Family of Description LogicsData Complexity in EL Family of Description Logics
Data Complexity in EL Family of Description LogicsAdila Krisnadhi
 
REGULAR EXPRESSION TO N.F.A
REGULAR EXPRESSION TO N.F.AREGULAR EXPRESSION TO N.F.A
REGULAR EXPRESSION TO N.F.ADev Ashish
 
Introduction to automaton ppt
Introduction to automaton pptIntroduction to automaton ppt
Introduction to automaton pptShiela Rani
 
Formal language
Formal languageFormal language
Formal languageRajendran
 
2 integration and the substitution methods x
2 integration and the substitution methods x2 integration and the substitution methods x
2 integration and the substitution methods xmath266
 
Top school in noida
Top school in noidaTop school in noida
Top school in noidaEdhole.com
 
1.4 the basic language of functions
1.4 the basic language of functions1.4 the basic language of functions
1.4 the basic language of functionsmath123c
 
Chapter2CDpdf__2021_11_26_09_19_08.pdf
Chapter2CDpdf__2021_11_26_09_19_08.pdfChapter2CDpdf__2021_11_26_09_19_08.pdf
Chapter2CDpdf__2021_11_26_09_19_08.pdfDrIsikoIsaac
 
Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal languageRabia Khalid
 

La actualidad más candente (20)

Cut and Count
Cut and CountCut and Count
Cut and Count
 
Regular expression with DFA
Regular expression with DFARegular expression with DFA
Regular expression with DFA
 
Math task 3
Math task 3Math task 3
Math task 3
 
Task 4
Task 4Task 4
Task 4
 
Blackbox task 2
Blackbox task 2Blackbox task 2
Blackbox task 2
 
Imc2020 day1&2 problems&solutions
Imc2020 day1&2 problems&solutionsImc2020 day1&2 problems&solutions
Imc2020 day1&2 problems&solutions
 
3.1 intro toautomatatheory h1
3.1 intro toautomatatheory  h13.1 intro toautomatatheory  h1
3.1 intro toautomatatheory h1
 
Flat
FlatFlat
Flat
 
Data Complexity in EL Family of Description Logics
Data Complexity in EL Family of Description LogicsData Complexity in EL Family of Description Logics
Data Complexity in EL Family of Description Logics
 
Lex analysis
Lex analysisLex analysis
Lex analysis
 
REGULAR EXPRESSION TO N.F.A
REGULAR EXPRESSION TO N.F.AREGULAR EXPRESSION TO N.F.A
REGULAR EXPRESSION TO N.F.A
 
Introduction to automaton ppt
Introduction to automaton pptIntroduction to automaton ppt
Introduction to automaton ppt
 
Formal language
Formal languageFormal language
Formal language
 
2 integration and the substitution methods x
2 integration and the substitution methods x2 integration and the substitution methods x
2 integration and the substitution methods x
 
Top school in noida
Top school in noidaTop school in noida
Top school in noida
 
SPLITTING FIELD.ppt
SPLITTING FIELD.pptSPLITTING FIELD.ppt
SPLITTING FIELD.ppt
 
Predicate Logic
Predicate LogicPredicate Logic
Predicate Logic
 
1.4 the basic language of functions
1.4 the basic language of functions1.4 the basic language of functions
1.4 the basic language of functions
 
Chapter2CDpdf__2021_11_26_09_19_08.pdf
Chapter2CDpdf__2021_11_26_09_19_08.pdfChapter2CDpdf__2021_11_26_09_19_08.pdf
Chapter2CDpdf__2021_11_26_09_19_08.pdf
 
Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal language
 

Similar a Mathematical Preliminaries Hw (p.13) Sets Functions Relations Graphs

Chapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdfChapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdfdawod yimer
 
Automata
AutomataAutomata
AutomataGaditek
 
Automata
AutomataAutomata
AutomataGaditek
 
Finite automata intro
Finite automata introFinite automata intro
Finite automata introlavishka_anuj
 
Answers Of Discrete Mathematics
Answers Of Discrete MathematicsAnswers Of Discrete Mathematics
Answers Of Discrete MathematicsSabrina Green
 
Mod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptxMod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptxRaviAr5
 
CMSC 56 | Lecture 6: Sets & Set Operations
CMSC 56 | Lecture 6: Sets & Set OperationsCMSC 56 | Lecture 6: Sets & Set Operations
CMSC 56 | Lecture 6: Sets & Set Operationsallyn joy calcaben
 
Prin digcommselectedsoln
Prin digcommselectedsolnPrin digcommselectedsoln
Prin digcommselectedsolnAhmed Alshomi
 
Chapter1 Formal Language and Automata Theory
Chapter1 Formal Language and Automata TheoryChapter1 Formal Language and Automata Theory
Chapter1 Formal Language and Automata TheoryTsegazeab Asgedom
 
Cs6660 compiler design november december 2016 Answer key
Cs6660 compiler design november december 2016 Answer keyCs6660 compiler design november december 2016 Answer key
Cs6660 compiler design november december 2016 Answer keyappasami
 
Set and Set operations, UITM KPPIM DUNGUN
Set and Set operations, UITM KPPIM DUNGUNSet and Set operations, UITM KPPIM DUNGUN
Set and Set operations, UITM KPPIM DUNGUNbaberexha
 
Ch1 sets and_logic(1)
Ch1 sets and_logic(1)Ch1 sets and_logic(1)
Ch1 sets and_logic(1)Kwonpyo Ko
 
Mid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Mid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurMid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Mid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurVivekananda Samiti
 
Design and Analysis of Algorithms Exam Help
Design and Analysis of Algorithms Exam HelpDesign and Analysis of Algorithms Exam Help
Design and Analysis of Algorithms Exam HelpProgramming Exam Help
 

Similar a Mathematical Preliminaries Hw (p.13) Sets Functions Relations Graphs (20)

Chapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdfChapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdf
 
Automata
AutomataAutomata
Automata
 
Automata
AutomataAutomata
Automata
 
Finite automata intro
Finite automata introFinite automata intro
Finite automata intro
 
Answers Of Discrete Mathematics
Answers Of Discrete MathematicsAnswers Of Discrete Mathematics
Answers Of Discrete Mathematics
 
G03201034038
G03201034038G03201034038
G03201034038
 
Mod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptxMod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptx
 
CMSC 56 | Lecture 6: Sets & Set Operations
CMSC 56 | Lecture 6: Sets & Set OperationsCMSC 56 | Lecture 6: Sets & Set Operations
CMSC 56 | Lecture 6: Sets & Set Operations
 
Prin digcommselectedsoln
Prin digcommselectedsolnPrin digcommselectedsoln
Prin digcommselectedsoln
 
Chapter1 Formal Language and Automata Theory
Chapter1 Formal Language and Automata TheoryChapter1 Formal Language and Automata Theory
Chapter1 Formal Language and Automata Theory
 
Math
MathMath
Math
 
Scribed lec8
Scribed lec8Scribed lec8
Scribed lec8
 
Cs6660 compiler design november december 2016 Answer key
Cs6660 compiler design november december 2016 Answer keyCs6660 compiler design november december 2016 Answer key
Cs6660 compiler design november december 2016 Answer key
 
Hay hay
Hay hayHay hay
Hay hay
 
Unit i
Unit iUnit i
Unit i
 
4898850.ppt
4898850.ppt4898850.ppt
4898850.ppt
 
Set and Set operations, UITM KPPIM DUNGUN
Set and Set operations, UITM KPPIM DUNGUNSet and Set operations, UITM KPPIM DUNGUN
Set and Set operations, UITM KPPIM DUNGUN
 
Ch1 sets and_logic(1)
Ch1 sets and_logic(1)Ch1 sets and_logic(1)
Ch1 sets and_logic(1)
 
Mid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Mid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurMid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Mid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
 
Design and Analysis of Algorithms Exam Help
Design and Analysis of Algorithms Exam HelpDesign and Analysis of Algorithms Exam Help
Design and Analysis of Algorithms Exam Help
 

Más de issbp

Ch11 input output systems
Ch11 input output systemsCh11 input output systems
Ch11 input output systemsissbp
 
Os10 2
Os10 2Os10 2
Os10 2issbp
 
Os10
Os10Os10
Os10issbp
 
Os9 2
Os9 2Os9 2
Os9 2issbp
 
Os8 2
Os8 2Os8 2
Os8 2issbp
 
Os7 2
Os7 2Os7 2
Os7 2issbp
 
Os6 2
Os6 2Os6 2
Os6 2issbp
 
Os5 2
Os5 2Os5 2
Os5 2issbp
 
Os4 2
Os4 2Os4 2
Os4 2issbp
 
Os3 2
Os3 2Os3 2
Os3 2issbp
 
Os2 2
Os2 2Os2 2
Os2 2issbp
 
Class9
 Class9 Class9
Class9issbp
 

Más de issbp (20)

Ch11 input output systems
Ch11 input output systemsCh11 input output systems
Ch11 input output systems
 
Os10 2
Os10 2Os10 2
Os10 2
 
Os10
Os10Os10
Os10
 
Os9 2
Os9 2Os9 2
Os9 2
 
Os9
Os9Os9
Os9
 
Os8 2
Os8 2Os8 2
Os8 2
 
Os8
Os8Os8
Os8
 
Os7 2
Os7 2Os7 2
Os7 2
 
Os7
Os7Os7
Os7
 
Os6 2
Os6 2Os6 2
Os6 2
 
Os6
Os6Os6
Os6
 
Os5 2
Os5 2Os5 2
Os5 2
 
Os5
Os5Os5
Os5
 
Os4 2
Os4 2Os4 2
Os4 2
 
Os4
Os4Os4
Os4
 
Os3 2
Os3 2Os3 2
Os3 2
 
Os3
Os3Os3
Os3
 
Os2 2
Os2 2Os2 2
Os2 2
 
Os2
Os2Os2
Os2
 
Class9
 Class9 Class9
Class9
 

Mathematical Preliminaries Hw (p.13) Sets Functions Relations Graphs

  • 1. Mathematical Preliminaries Hw (p.13) 1, 4, 7, 8, 9, 13, 23, 26, 30, 32
  • 2.
  • 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.
  • 5.
  • 6.
  • 7.
  • 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.
  • 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.
  • 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.
  • 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.
  • 33.
  • 34.
  • 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.
  • 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.
  • 40.
  • 41.
  • 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.
  • 45.
  • 46.
  • 47. String Operations Concatenation w  = ?  w = ?
  • 48.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59. The + Operation : the set of all possible strings from alphabet except
  • 61. Note that: Sets Set size Set size String length
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67. Reverse Hw # 10 (a) Prove or Disprove: i.e., w R  L  w  L R
  • 68.
  • 70.
  • 72.
  • 73.
  • 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.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87.
  • 88.
  • 90.
  • 91.
  • 92.
  • 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.
  • 95.
  • 96.

Notas del editor

  1. Fall 2008 Automata
  2. Fall 2008 Automata
  3. Fall 2008 Automata
  4. Fall 2008 Automata
  5. Fall 2008 Automata
  6. Fall 2008 Automata
  7. Fall 2008 Automata
  8. Fall 2008 Automata
  9. Fall 2008 Automata
  10. Fall 2008 Automata
  11. Fall 2008 Automata
  12. Fall 2008 Automata