![Page 1: CS1010: Theory of Computation - Brown Universitycs.brown.edu/courses/csci1010/files/doc/fall2020/Lecture... · 2020. 9. 10. · theory of computation: –Automata and Languages –Computability](https://reader035.vdocument.in/reader035/viewer/2022081602/61472cd4f4263007b135a6b9/html5/thumbnails/1.jpg)
CS1010:TheoryofComputation
LorenzoDeStefaniFall2020
Lecture0a:Introduction
![Page 2: CS1010: Theory of Computation - Brown Universitycs.brown.edu/courses/csci1010/files/doc/fall2020/Lecture... · 2020. 9. 10. · theory of computation: –Automata and Languages –Computability](https://reader035.vdocument.in/reader035/viewer/2022081602/61472cd4f4263007b135a6b9/html5/thumbnails/2.jpg)
Whatisthiscourseabout?
• Canwedefinecomputationwithoutreferringtoamoderncomputer?
• Canwedefineacomputermathematically?– YesàTuringmachines
• Iscomputation definableindependentofpresent-dayengineeringlimitations,understandingofphysics,etc.?
• Canacomputersolveanyproblem,givenenoughtimeanddisk-space?
• Oraretherefundamentallimitstocomputability?
Whatis“Computation”?
9/10/20 Theory of Computation - Fall'20 Lorenzo De Stefani 1
![Page 3: CS1010: Theory of Computation - Brown Universitycs.brown.edu/courses/csci1010/files/doc/fall2020/Lecture... · 2020. 9. 10. · theory of computation: –Automata and Languages –Computability](https://reader035.vdocument.in/reader035/viewer/2022081602/61472cd4f4263007b135a6b9/html5/thumbnails/3.jpg)
Whatisthiscourseabout?
Thiscoursecovers3areas,whichmakeupthetheoryofcomputation:– AutomataandLanguages– ComputabilityTheory– ComplexityTheory
Thiscourseisaboutthefundamentalcapabilitiesandlimitationsofcomputers/computation
9/10/20 Theory of Computation - Fall'20 Lorenzo De Stefani 2
![Page 4: CS1010: Theory of Computation - Brown Universitycs.brown.edu/courses/csci1010/files/doc/fall2020/Lecture... · 2020. 9. 10. · theory of computation: –Automata and Languages –Computability](https://reader035.vdocument.in/reader035/viewer/2022081602/61472cd4f4263007b135a6b9/html5/thumbnails/4.jpg)
AreasofTheoryofComputation
• Whatcanbecomputed?• Canacomputersolveanyproblem,
givenenoughtimeanddisk-space?
• Howfastcanwesolveaproblem?• Howlittledisk-spacecanweuseto
solveaproblem
• Whatproblemscanwesolvegivenreallyverylittle(constant)space?
COMPUTABILITY
AUTOMATA
COMPLEXITY
9/10/20 Theory of Computation - Fall'20 Lorenzo De Stefani 3
![Page 5: CS1010: Theory of Computation - Brown Universitycs.brown.edu/courses/csci1010/files/doc/fall2020/Lecture... · 2020. 9. 10. · theory of computation: –Automata and Languages –Computability](https://reader035.vdocument.in/reader035/viewer/2022081602/61472cd4f4263007b135a6b9/html5/thumbnails/5.jpg)
AreasofTheoryofComputation
• Notallproblems!!!• Eg.GivenaC-program,wecannotcheckifitwillnoteventuallycrash
• Verificationofcorrectnessofprogramsishenceimpossible!
COMPUTABILITY
AUTOMATA
COMPLEXITY
Whatproblemscanacomputersolve?
9/10/20 Theory of Computation - Fall'20 Lorenzo De Stefani 4
![Page 6: CS1010: Theory of Computation - Brown Universitycs.brown.edu/courses/csci1010/files/doc/fall2020/Lecture... · 2020. 9. 10. · theory of computation: –Automata and Languages –Computability](https://reader035.vdocument.in/reader035/viewer/2022081602/61472cd4f4263007b135a6b9/html5/thumbnails/6.jpg)
AreasofTheoryofComputation
• EvencheckingwhetheraC-programwillhalt/terminate isnotpossible!
Program(n)Inputintegern>1while(n!=1)
if(niseven)returnProgram(n/2)
elsereturnProgram(3n+1)
E.g.,forinputn=34:17,52,26,13,40,20,10,5,16,8,4,2,1.
COMPUTABILITY
AUTOMATA
COMPLEXITY
Whatproblemscanacomputersolve?
Impossibletodecidewhetherthisprogramterminatesforallpossibleinputvalues
9/10/20 Theory of Computation - Fall'20 Lorenzo De Stefani 5
![Page 7: CS1010: Theory of Computation - Brown Universitycs.brown.edu/courses/csci1010/files/doc/fall2020/Lecture... · 2020. 9. 10. · theory of computation: –Automata and Languages –Computability](https://reader035.vdocument.in/reader035/viewer/2022081602/61472cd4f4263007b135a6b9/html5/thumbnails/7.jpg)
AreasofTheoryofComputation
• Certainproblemscannotbesolvedbycomputers– I.e.,theyhavenoalgorithmicsolution
• ATuringmachine,asimplemodelforacomputer,candoeverythingthatacomputercando(Church-Turingthesis)
• WecanuseaTuringmachinetodeterminewhatacomputercanandcan’tdo(i.e.,compute)
COMPUTABILITY
AUTOMATA
COMPLEXITY
Whatproblemscanacomputersolve?
9/10/20 Theory of Computation - Fall'20 Lorenzo De Stefani 6
![Page 8: CS1010: Theory of Computation - Brown Universitycs.brown.edu/courses/csci1010/files/doc/fall2020/Lecture... · 2020. 9. 10. · theory of computation: –Automata and Languages –Computability](https://reader035.vdocument.in/reader035/viewer/2022081602/61472cd4f4263007b135a6b9/html5/thumbnails/8.jpg)
AreasofTheoryofComputation
• Polynomialtimecomputable• Non-det PolyTime(NP)• Approximation,Randomization
Functionsthatcannotbecomputedfast:• Applicationstosecurity• Encryptfast,decryptioncannotbedonefast
– RSAcryptography– webapplications
COMPUTABILITY
AUTOMATA
COMPLEXITY
Howfastcanwecomputeafunction?Howmuchmemoryspacedowerequire?
9/10/20 Theory of Computation - Fall'20 Lorenzo De Stefani 7
![Page 9: CS1010: Theory of Computation - Brown Universitycs.brown.edu/courses/csci1010/files/doc/fall2020/Lecture... · 2020. 9. 10. · theory of computation: –Automata and Languages –Computability](https://reader035.vdocument.in/reader035/viewer/2022081602/61472cd4f4263007b135a6b9/html5/thumbnails/9.jpg)
AreasofTheoryofComputation
• Examples:– trafficsignals,– vendingmachines– hardwarecircuits– …
• Applications:– patternmatching,– modeling,– verificationofhardware,– …
COMPUTABILITY
AUTOMATA
COMPLEXITY
Whatcanwedowithmachinewithfinitememoryspace?
9/10/20 Theory of Computation - Fall'20 Lorenzo De Stefani 8
![Page 10: CS1010: Theory of Computation - Brown Universitycs.brown.edu/courses/csci1010/files/doc/fall2020/Lecture... · 2020. 9. 10. · theory of computation: –Automata and Languages –Computability](https://reader035.vdocument.in/reader035/viewer/2022081602/61472cd4f4263007b135a6b9/html5/thumbnails/10.jpg)
Models
• Automata:– DFA/NFA– Foundationsofcomputing– Mathematicalmethodsofargument– Simplesetting
TURINGMACHINES
AUTOMATA
CONTEX-FREELANGUAGES
9/10/20 Theory of Computation - Fall'20 Lorenzo De Stefani 9
![Page 11: CS1010: Theory of Computation - Brown Universitycs.brown.edu/courses/csci1010/files/doc/fall2020/Lecture... · 2020. 9. 10. · theory of computation: –Automata and Languages –Computability](https://reader035.vdocument.in/reader035/viewer/2022081602/61472cd4f4263007b135a6b9/html5/thumbnails/11.jpg)
Models
• Context-freelanguages– Grammars,parsing– Finitestatemachineswithrecursion(orstack)
– Stillasimplesettingbutinfinitespace
TURINGMACHINES
AUTOMATA
CONTEX-FREELANGUAGES
9/10/20 Theory of Computation - Fall'20 Lorenzo De Stefani 10
![Page 12: CS1010: Theory of Computation - Brown Universitycs.brown.edu/courses/csci1010/files/doc/fall2020/Lecture... · 2020. 9. 10. · theory of computation: –Automata and Languages –Computability](https://reader035.vdocument.in/reader035/viewer/2022081602/61472cd4f4263007b135a6b9/html5/thumbnails/12.jpg)
Models
• Turingmachines(1940s):– Themostgeneralnotionofcomputing
– TheChurch-Turingthesis
• Allowtostudylimitsofcomputability– Canwesolveanymathematicalquestionmethodically?
– Gödel’sTheorem:NO!!!– “Eventhemostpowerfulmachinescannotsolvesomeproblems”
TURINGMACHINES
AUTOMATA
CONTEX-FREELANGUAGES
9/10/20 Theory of Computation - Fall'20 Lorenzo De Stefani 11
![Page 13: CS1010: Theory of Computation - Brown Universitycs.brown.edu/courses/csci1010/files/doc/fall2020/Lecture... · 2020. 9. 10. · theory of computation: –Automata and Languages –Computability](https://reader035.vdocument.in/reader035/viewer/2022081602/61472cd4f4263007b135a6b9/html5/thumbnails/13.jpg)
Models• AlanTuring
– “OnComputableNumbers,withan ApplicationtotheEntscheidungs problem”(1936)
– Proveduncomputable functions exist(“haltingproblem”)
– Church-Turingthesis– CryptanalysisworkbreakingEnigmainWW2
• NoamChomsky– “LogicalStructureofLinguisticTheory”(1957)– Introducedthenotionofformallanguagesarguing
generativegrammarsareatthebaseofnaturallanguages
– Hierarchyofformallanguagesthatcoincideswithcomputation
• RabinandScott– “Finiteautomataandtheirdecisionproblems”(1959)– Introducednon-deterministicautomataandthe
formalismwestillusetoday
TURINGMACHINES
AUTOMATA
CONTEX-FREELANGUAGES
COMPLEXITY
FORMALIZATION
9/10/20 Theory of Computation - Fall'20 Lorenzo De Stefani 12
![Page 14: CS1010: Theory of Computation - Brown Universitycs.brown.edu/courses/csci1010/files/doc/fall2020/Lecture... · 2020. 9. 10. · theory of computation: –Automata and Languages –Computability](https://reader035.vdocument.in/reader035/viewer/2022081602/61472cd4f4263007b135a6b9/html5/thumbnails/14.jpg)
AboutthisCourse
• TheoryofComputationtraditionallyconsideredchallenging– Iexpect(andhope)thatyouwillfindthistobetrue=)
• Averydifferentkindofcourse– Inmanyways,apuretheorycourse
• Butverygrounded(themodelsofcomputationarenotabstractatall)– Proofsareanintegralpartofthecourse,althoughIandthetextbothrely
oninformalproofs• Butthereasoningmuststillbeclear
• Theonlywaytolearnthismaterialisbydoingproblems– Youshouldexpecttospendseveralhoursperweekonhomework– Youshouldexpecttoreadpartsofthetext2-3times– Donotgiveupafter5minutesifyouarestumpedbyaproblem!
9/10/20 Theory of Computation - Fall'20 Lorenzo De Stefani 13
![Page 15: CS1010: Theory of Computation - Brown Universitycs.brown.edu/courses/csci1010/files/doc/fall2020/Lecture... · 2020. 9. 10. · theory of computation: –Automata and Languages –Computability](https://reader035.vdocument.in/reader035/viewer/2022081602/61472cd4f4263007b135a6b9/html5/thumbnails/15.jpg)
CourseStaff
9/10/20 Theory of Computation - Fall'20 Lorenzo De Stefani 14
http://cs.brown.edu/courses/csci1010/index.html
![Page 16: CS1010: Theory of Computation - Brown Universitycs.brown.edu/courses/csci1010/files/doc/fall2020/Lecture... · 2020. 9. 10. · theory of computation: –Automata and Languages –Computability](https://reader035.vdocument.in/reader035/viewer/2022081602/61472cd4f4263007b135a6b9/html5/thumbnails/16.jpg)
Textbookandcoursematerials• Textbook:MichaelSipserIntroductiontoTheoryofComputation(2nd ed.recommended;1st ed maybeok)
• Coursewebsite:https://cs.brown.edu/courses/csci1010/– UsethecourseSyllabusforreference– LectureSlidesavailableonthewebsiteafterclass– Homeworkassignmentspublishedonthewebsite– Solutionswillbeposted2daysafterthedeadlines
• Lectures:– ZoomlinkstolikelecturesandvideosonCanvas(dodistribute
them)
• Piazza:
– GreatwaytointeractwithTAsandpeers!Useitalot!
9/10/20 Theory of Computation - Fall'20 Lorenzo De Stefani 15
![Page 17: CS1010: Theory of Computation - Brown Universitycs.brown.edu/courses/csci1010/files/doc/fall2020/Lecture... · 2020. 9. 10. · theory of computation: –Automata and Languages –Computability](https://reader035.vdocument.in/reader035/viewer/2022081602/61472cd4f4263007b135a6b9/html5/thumbnails/17.jpg)
HomeworkandMidterms
9/10/20 CS1570 - Fall'20 Lorenzo De Stefani 16
• Homework(ormidterm)everyweek:Postingdatesandhand-backdatespostedonthewebsite.Oneweektotaltimeforeachhomework.– Workinagroup,butthinkandtrytosolveeachproblemyourself!
– Listyoucollaboratorsonyoursubmission– Alwayswriteyourownsolutions– Donot“distributetheproblemswithinthegroup”– Usepiazza
• 2take-homeMidtermseachcoveringthefirst(resp.,second)partoftheclass.– Oneweekforeachmidtermassignment– Nocollaborationisallowed!– TAswillonlyanswerquestionsregardingclarificationsontheassignments– QuestionsshouldbeaskedprivatelyonPiazza
![Page 18: CS1010: Theory of Computation - Brown Universitycs.brown.edu/courses/csci1010/files/doc/fall2020/Lecture... · 2020. 9. 10. · theory of computation: –Automata and Languages –Computability](https://reader035.vdocument.in/reader035/viewer/2022081602/61472cd4f4263007b135a6b9/html5/thumbnails/18.jpg)
HomeworkandMidterms
9/10/20 CS1570 - Fall'20 Lorenzo De Stefani 17
• AssignmentssubmittedusingGradescope.• Berigorousbutnotexcessivelyverbose• Simplelatepolicy:
– A “budget”of4totaldays,– Youcanuseupto2daysforanassignments– Requestsforextensiondueatleast24hoursbeforedeadlineusing
Googleformavailableonline(https://docs.google.com/forms/d/e/1FAIpQLScBRrM_B4HjJMp5m-rq9Ud9vRa9JU-y5i8ylMgOma3SudWYLw/viewform)
• Atthebeginningofthecourse,allstudentsarerequiredtosubscribetothecollaborationpolicy(https://forms.gle/1KzmBgLqGxWZ4gv86)
![Page 19: CS1010: Theory of Computation - Brown Universitycs.brown.edu/courses/csci1010/files/doc/fall2020/Lecture... · 2020. 9. 10. · theory of computation: –Automata and Languages –Computability](https://reader035.vdocument.in/reader035/viewer/2022081602/61472cd4f4263007b135a6b9/html5/thumbnails/19.jpg)
Howtodowell• Youmustunderstandtheconceptswell!
– Ifyoudonot,thereisalmostnochanceofsuccess=(• Ifyoudounderstandtheconcepts,thereisverylittleelsetolearn!
– Youcandoreallywell=D• Youmustdoproblems.There’snoreplacementforthis.
– Discussproblemsandsolutionsingroupbutalwayswriteyourownsolutions• Attendinglecturesishighlyadvised!• Don’tpostponelearning;youwillnotbeableto“makeup”later.
– Startthehomeworkearlyon!• Topicsgethardquickly.• Cometoofficehours!• Participateinclass!!!
9/10/20 Theory of Computation - Fall'20 Lorenzo De Stefani 18