Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Lecture1: RegularLanguages
FiniteAutomata
AreasintheTheoryofComputation
CSE2243Lecture1
Complexity
Howcomputationallyhardaproblemis Problem1:Arrangingalistofnumbersinascendingorder
Evenasmallcomputercansortamillionnumbersratherquickly
Muchharder!Iftherearethousandclasses,findingthebestschedulemaytake centuries,evenonasupercomputer
Whatmakessomeproblemscomputationallyhardandotherseasy? Classifyproblemsaseasyorhard
CSE2243Lecture1
Computability
Certainbasicproblemscannotbesolvedby computers
Classifyproblemsasthosewhichcanbesolved andthosewhichcannot
CSE2243Lecture1
Automata
Practicewithformaldefinitionsofcomputation
CSE2243Lecture1 5
RegularLanguages
FiniteAutomata
CSE2243Lecture1
AutomaticDoorExample
Twostatesofthecontrollerrepresentingthecondition ofthedoor:
Fourpossibleinputconditions
AutomaticDoorStateDiagram
StateDiagram:
StateTransitionTable:
StateDiagram:
DFAM1(1)
DFAM1(2)
HowdoestheFAcompute?
Processing:
Afterreadingasymbol,M1movesfromcurrentstatetoanewstateby followingthetransitionlabeledwiththeinputsymbol
Afteritprocessesthelastsymbol,M1producesanoutput
AcceptifM1isnowinanacceptstate,otherwisereject
CSE2243Lecture1 11
DFAM1(3)
HowdoesM1compute?
On1101?
Answer:Itvisits(inorder)q1,q2,q2,q3,q2Accept
On01? On101000?
DoesM1acceptorreject:0?1?100?01?10?Anystring thatendsin1?
CSE2243Lecture1 12
FormalDefinitionofDFA(1)
CSE2243Lecture1
13
FormalDefinitionofDFA(2)
ADFAisa5tuple(Q,,,q0,F),where
Qxisthesetofpairs(a,b)whereaQandb
FormalDefinitionofM1
M1=(Q,,,q1,F)
q1isthestartstate F={q2}
CSE2243Lecture1 15
LanguageofaMachineM
IfAisthesetofallstringsthatmachineMaccepts,then wesay:
LanguageofM1
WhatisthelanguageofM1?
Answer:L(M1)=A,where
ExampleM2
WhatistheformaldescriptionofM2?
WhatisthelanguageofM2?
CSE2243Lecture1
18
ExampleM3
WhatisthelanguageofM3?
CSE2243Lecture1
19
ExampleM4
WhatisthelanguageofM4?
CSE2243Lecture1 20
FormalDefinitionofComputation
DesigningDFAs(1)
HowtodesignaDFAtodoaspecifictask?
Exercise
CSE2243Lecture1
22
DesigningDFAs(2)
Twostates:
qeven:evennumberof1s qodd:oddnumberof1s
Notethecountingideainthisexample
CSE2243Lecture1 23
DesigningDFAs(3)
Exercise
Supposethealphabetis{0,1}andthelanguageisthe setofallstringsthatcontain001asthesubstring
DesignaDFAtorecognizethislanguage
Notethesubstringideainthisexample
CSE2243Lecture1 24
RegularLanguagesandRegular Operations
Definition:
LanguageLisregularifL=L(M)forsomeDFAM GiveaDFAforit
Onewaytoshowalanguageisregular:
Atoolforshowingalanguageisregular:regular operations
RegularOperationsContext
Inarithmetic:
Intheoryofcomputation:
RegularOperationsDefinition
LetAandBbelanguages Wedefineregularoperationsasfollows:
CSE2243Lecture1
27
RegularOperationsExample
Letthealphabetbe{a,b,z} IfA={good,bad}andB={boy,girl},then
CSE2243Lecture1
28
RegularOperationsClosure
ProvingtheClosureTheorem
Theorem:theclassofregularlanguagesis closedunder
The3proofsarebyconstruction
CSE2243Lecture1
30
Proofv/sTheorem
Aproofofamathematicalstatementisanargumentthat convincesthereaderthatthestatementistrue.
Differentreadersimplydifferentproofs
Atheoremisamathematicalstatementthathasbeen provedtrue.
CSE2243Lecture1
31
TypesofProofs
Proofbycontradiction
Proofbyconstruction
Proofbyinduction
Theorem:Theclassofregular languagesisclosedunderunion
Thatis:
IfA1andA2areregularlanguages,thensoisA1 A2 Proofidea
WeknowthatA1andA2areregular
So,thereisanM1whichrecognizesA1andanM2whichrecognizesA2
WeconstructanMfromM1andM2thatrecognizesA1 A2 MsimulatesbothM1andM2andacceptsifeitheraccepts
CSE2243Lecture1
33
IfA1andA2areregularlanguages,
MsimulatesbothM1andM2andacceptsifeitheraccepts
thensoisA1 A2
CSE2243Lecture1
34
IfA1andA2areregularlanguages,
Proof
thensoisA1 A2
Q={(r1,r2)|r1Q1andr2Q2}
isthesameasthelanguagesforM1andM2 isdefinedasfollows:Foreach(r1,r2)Qandeachain,let
((r1,r2),a)=(1(r1,a),2(r2,a))