CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf ·...
Transcript of CS3000: Algorithms & Data Paul Handkhoury.northeastern.edu/.../cs3000-spring-2019/day1.pdf ·...
CS3000:Algorithms&Data PaulHand
Day1:• CourseOverview• WarmupExercise(Induction,Asymptotics,Fun)
Jan7,2019
• Name:PaulHand• CallmePaul• NEUsinceFall2018• Office:523Lake• OfficeHours:Mon1:15-2:45
• Research:• MachineLearning,ArtificialIntelligence,ComputerVision• Algorithmsareatthecoreofallofthese!
Instructor
Discussion: Whatimpressivethingscancomputersnowdo(butcouldn’twhenyouwereborn)?
Whatdoyouthinkcomputerswillbeabletodoin10yearsthattheycan’ttoday?
Discussion:
Whatwouldyousayisdrivingcomputationaladvances?
• Whatisanalgorithm?
• Essentiallyallcomputerprograms(andmore)arealgorithmsforsomecomputationalproblem.
Algorithms
Anexplicit,precise,unambiguous,mechanically-executablesequenceofelementaryinstructionsforsolvingacomputationalproblem.
-JeffErickson
• WhatisAlgorithms?
• Abstractandformalizecomputationalproblems
• Identifybroadlyusefulalgorithmdesignprinciplesforsolvingcomputationalproblems
• Rigorouslyanalyzepropertiesofalgorithms• correctness,runningtime,spaceusage
Algorithms
Thestudyofhowtosolvecomputationalproblems.
Moore’sLaw
• Eachofyou:Determinehowmanyotherpeopleinthisroomhavethesamefirstnameasyou.
Acomputationalproblem
• Sometimesyourfirstinstinctapproachisreasonable.• Sometimesyourfirstinstinctisnot.
Therearemultiplewaystosolveproblems
Exampleproblemswewilllookat
ClosestPairofPoints SequenceAlignment
IntervalScheduling Findingtheshortestpath
Othergoodproblems(wewontsee)
PlantedClique TravelingSalesmanProblem
• WhatisCS3000:Algorithms&Data?
• Proofsareaboutunderstandingandcommunication,notaboutformalityorcertainty• Differentemphasisfromcoursesonlogic
• We’lltalkalotaboutprooftechniquesandwhatmakesacorrectandconvincingproof
Algorithms
Thestudyofhowtosolvecomputationalproblems.Howtorigorouslyprovepropertiesofalgorithms.
• Thatsoundshard.WhywouldIwanttodothat?
• BuildIntuition:• How/whydoalgorithmsreallywork?• Howtoattacknewproblems?• Whichdesigntechniquesworkwell?• Howtocomparedifferentsolutions?• Howtoknowifasolutionisthebestpossible?
Algorithms
• Thatsoundshard.WhywouldIwanttodothat?
• ImproveCommunication:• Howtoexplainsolutions?• Howtoconvincesomeonethatasolutioniscorrect?• Howtoconvincesomeonethatasolutionisbest?
Algorithms
• Thatsoundshard.WhywouldIwanttodothat?
• GetRich:• Manyoftheworld’smostsuccessfulcompanies(eg.Google)beganwithalgorithms.
• Manyjobinterviewshavealgorithmquestions
• Understandthenaturalworld:• Brains,cells,networks,etc.oftenviewedasalgorithms.
• Fun:• Yes,seriously,fun.
Algorithms
CourseStructureEnd4/17
FinalTBD
Start1/7
MidtermI2/20
MidtermII3/27
• HW=45%• Exams=55%• MidtermI=15%• MidtermII=15%• Final=25%
CourseStructureEnd4/17
Start1/7
DivideandConquer
DynamicProgramming
Graphs NetworkFlow
Textbook:AlgorithmDesignbyKleinbergandTardos
Moreresourcesonthecoursewebsite
FinalTBD
MidtermI2/20
MidtermII3/27
• TBD• OfficeHours:TBD• Location:TBD
• TBD• OfficeHours:TBD• Location:TBD
• TBD• OfficeHours:TBD• Location:TBD
TheTATeam
• WeeklyHWAssignments(45%ofgrade)• DueWednesdaysby2:50pm• HW1outonWednesday!DueWed1/16• Noextensions,nolatework• LowestHWscorewillbedroppedfromyourgrade
• Amixofmathematicalandalgorithmicquestions
Homework
• HomeworkmustbetypesetinLaTeX!• Manyresourcesavailable• Manygoodeditorsavailable(TexShop,TexStudio)• IwillprovideHWsource
HomeworkPolicies
• HomeworkwillbesubmittedonGradescope!• MoredetailsonWednesday
HomeworkPolicies
• Youareencouragedtoworkwithyourclassmatesonthehomeworkproblems.• Youmaynotusetheinternet• Youmaynotusestudents/peopleoutsideoftheclass
• CollaborationPolicy:• Youmustwriteallsolutionsbyyourself• Youmaynotshareanywrittensolutions• Youmuststateallofyourcollaborators• Wereservetherighttoaskyoutoexplainanysolution
HomeworkPolicies
• WewillusePiazzafordiscussions• Askquestionsandhelpyourclassmates• Pleaseuseprivatemessagessparingly
• MoredetailsonWednesday!
DiscussionForum
CourseWebsite
http://www.ccs.neu.edu/home/hand/teaching/cs3000-spring-2018/
• Prof.Schnyderteachesanothersection• Noformalrelationshipwithmysection• Willcoververysimilartopicsandsharesomematerials• Willbeoutofsync• YoushouldnotgotoOHforProf.Schnyder’sTAs
WhatAbouttheOtherSections?
Illustration:Let’scounthowmany studentsareinthisclass
• 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)
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
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?
ProofsbyInduction
• Claim:Foreverynumberofstudents
• Intermsofn,
RunningTime-ProofbyInduction
n = 2m
T (2m) = 3m+ 1
T (n) ⇡ 3 log2 n+ 1