cs3000: algorithms & data paul handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf ·...
TRANSCRIPT
![Page 1: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/1.jpg)
CS3000:Algorithms&Data PaulHand
Day1:• CourseOverview• WarmupExercise(Induction,Asymptotics,Fun)
Jan7,2019
![Page 2: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/2.jpg)
• Name:PaulHand• CallmePaul• NEUsinceFall2018• Office:523Lake• OfficeHours:Mon1:15-2:45
• Research:• MachineLearning,ArtificialIntelligence,ComputerVision• Algorithmsareatthecoreofallofthese!
Instructor
![Page 3: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/3.jpg)
Discussion: Whatimpressivethingscancomputersnowdo(butcouldn’twhenyouwereborn)?
Whatdoyouthinkcomputerswillbeabletodoin10yearsthattheycan’ttoday?
![Page 4: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/4.jpg)
Discussion:
Whatwouldyousayisdrivingcomputationaladvances?
![Page 5: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/5.jpg)
• Whatisanalgorithm?
• Essentiallyallcomputerprograms(andmore)arealgorithmsforsomecomputationalproblem.
Algorithms
Anexplicit,precise,unambiguous,mechanically-executablesequenceofelementaryinstructionsforsolvingacomputationalproblem.
-JeffErickson
![Page 6: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/6.jpg)
• WhatisAlgorithms?
• Abstractandformalizecomputationalproblems
• Identifybroadlyusefulalgorithmdesignprinciplesforsolvingcomputationalproblems
• Rigorouslyanalyzepropertiesofalgorithms• correctness,runningtime,spaceusage
Algorithms
Thestudyofhowtosolvecomputationalproblems.
![Page 7: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/7.jpg)
![Page 8: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/8.jpg)
Moore’sLaw
![Page 9: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/9.jpg)
![Page 10: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/10.jpg)
• Eachofyou:Determinehowmanyotherpeopleinthisroomhavethesamefirstnameasyou.
Acomputationalproblem
![Page 11: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/11.jpg)
• Sometimesyourfirstinstinctapproachisreasonable.• Sometimesyourfirstinstinctisnot.
Therearemultiplewaystosolveproblems
![Page 12: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/12.jpg)
Exampleproblemswewilllookat
ClosestPairofPoints SequenceAlignment
IntervalScheduling Findingtheshortestpath
![Page 13: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/13.jpg)
Othergoodproblems(wewontsee)
PlantedClique TravelingSalesmanProblem
![Page 14: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/14.jpg)
• WhatisCS3000:Algorithms&Data?
• Proofsareaboutunderstandingandcommunication,notaboutformalityorcertainty• Differentemphasisfromcoursesonlogic
• We’lltalkalotaboutprooftechniquesandwhatmakesacorrectandconvincingproof
Algorithms
Thestudyofhowtosolvecomputationalproblems.Howtorigorouslyprovepropertiesofalgorithms.
![Page 15: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/15.jpg)
• Thatsoundshard.WhywouldIwanttodothat?
• BuildIntuition:• How/whydoalgorithmsreallywork?• Howtoattacknewproblems?• Whichdesigntechniquesworkwell?• Howtocomparedifferentsolutions?• Howtoknowifasolutionisthebestpossible?
Algorithms
![Page 16: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/16.jpg)
• Thatsoundshard.WhywouldIwanttodothat?
• ImproveCommunication:• Howtoexplainsolutions?• Howtoconvincesomeonethatasolutioniscorrect?• Howtoconvincesomeonethatasolutionisbest?
Algorithms
![Page 17: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/17.jpg)
• Thatsoundshard.WhywouldIwanttodothat?
• GetRich:• Manyoftheworld’smostsuccessfulcompanies(eg.Google)beganwithalgorithms.
• Manyjobinterviewshavealgorithmquestions
• Understandthenaturalworld:• Brains,cells,networks,etc.oftenviewedasalgorithms.
• Fun:• Yes,seriously,fun.
Algorithms
![Page 18: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/18.jpg)
CourseStructureEnd4/17
FinalTBD
Start1/7
MidtermI2/20
MidtermII3/27
• HW=45%• Exams=55%• MidtermI=15%• MidtermII=15%• Final=25%
![Page 19: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/19.jpg)
CourseStructureEnd4/17
Start1/7
DivideandConquer
DynamicProgramming
Graphs NetworkFlow
Textbook:AlgorithmDesignbyKleinbergandTardos
Moreresourcesonthecoursewebsite
FinalTBD
MidtermI2/20
MidtermII3/27
![Page 20: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/20.jpg)
• TBD• OfficeHours:TBD• Location:TBD
• TBD• OfficeHours:TBD• Location:TBD
• TBD• OfficeHours:TBD• Location:TBD
TheTATeam
![Page 21: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/21.jpg)
• WeeklyHWAssignments(45%ofgrade)• DueWednesdaysby2:50pm• HW1outonWednesday!DueWed1/16• Noextensions,nolatework• LowestHWscorewillbedroppedfromyourgrade
• Amixofmathematicalandalgorithmicquestions
Homework
![Page 22: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/22.jpg)
• HomeworkmustbetypesetinLaTeX!• Manyresourcesavailable• Manygoodeditorsavailable(TexShop,TexStudio)• IwillprovideHWsource
HomeworkPolicies
![Page 23: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/23.jpg)
• HomeworkwillbesubmittedonGradescope!• MoredetailsonWednesday
HomeworkPolicies
![Page 24: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/24.jpg)
• Youareencouragedtoworkwithyourclassmatesonthehomeworkproblems.• Youmaynotusetheinternet• Youmaynotusestudents/peopleoutsideoftheclass
• CollaborationPolicy:• Youmustwriteallsolutionsbyyourself• Youmaynotshareanywrittensolutions• Youmuststateallofyourcollaborators• Wereservetherighttoaskyoutoexplainanysolution
HomeworkPolicies
![Page 25: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/25.jpg)
• WewillusePiazzafordiscussions• Askquestionsandhelpyourclassmates• Pleaseuseprivatemessagessparingly
• MoredetailsonWednesday!
DiscussionForum
![Page 26: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/26.jpg)
CourseWebsite
http://www.ccs.neu.edu/home/hand/teaching/cs3000-spring-2018/
![Page 27: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/27.jpg)
• Prof.Schnyderteachesanothersection• Noformalrelationshipwithmysection• Willcoververysimilartopicsandsharesomematerials• Willbeoutofsync• YoushouldnotgotoOHforProf.Schnyder’sTAs
WhatAbouttheOtherSections?
![Page 28: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/28.jpg)
Illustration:Let’scounthowmany studentsareinthisclass
![Page 29: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/29.jpg)
• Isthiscorrect?• Howlongdoesthistakewithnstudents?
SimpleCounting
SimCount: Find first student First student says 1 Until we’re out of students: Go to next student Next student says (what last student said + 1)
![Page 30: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/30.jpg)
RecursiveCounting-DivideandConquer
RecursiveCount: If you are the only person in group:
return 1 Else:
Split your group into two subgroups of similar size (one includes you) Appoint a leader of the other subgroup Ask that leader how many are in that subgroup Determine how many are in your subgroup. return # in your subgroup + # in other subgroup
![Page 31: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/31.jpg)
RecursiveCounting-DivideandConquerRecursiveCount:
If you are the only person in group: return 1
Else: Split your group into two subgroups of similar size (one includes you) Appoint a leader of the other subgroup Ask that leader how many are in that subgroup Determine how many are in your subgroup. return # in your subgroup + # in other subgroup
• Howlongdoesthistakewithn=2mstudents?
![Page 32: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/32.jpg)
ProofsbyInduction
![Page 33: CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf · 2019-04-20 · • Machine Learning, Artificial Intelligence, Computer Vision ... •](https://reader034.vdocuments.mx/reader034/viewer/2022042810/5f98ceb248d8b767bb3363b4/html5/thumbnails/33.jpg)
• Claim:Foreverynumberofstudents
• Intermsofn,
RunningTime-ProofbyInduction
n = 2m
T (2m) = 3m+ 1
T (n) ⇡ 3 log2 n+ 1