computational thinking, computer science, and...

40
Computational Thinking, Computer Science, and Coding http://img2.wikia.nocookie.net/__cb20130510160248/despicableme/images/e/e9/Despicable-Me-Minions_thumb10.jpg Professor Leen-Kiat Soh Department of Computer Science and Engineering University of Nebraska, Lincoln, NE E-mail: [email protected]

Upload: others

Post on 19-Jun-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

ComputationalThinking,ComputerScience,andCoding

http://img2.wikia.nocookie.net/__cb20130510160248/despicableme/images/e/e9/Despicable-Me-Minions_thumb10.jpg

ProfessorLeen-Kiat SohDepartmentofComputerScienceandEngineeringUniversityofNebraska,Lincoln,NEE-mail:[email protected]

Page 2: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

Hmm….

Whatiscomputational

thinking?

http://www.picturescraze.com/movies/1528/despicable+me+minion.html

Page 3: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

WhatisComputationalThinking?

• A wayofthinkingforlogically andmethodicallysolvingproblems– E.g.,purposeful,describable,replicable

• Includesskills suchas– Decomposition– PatternRecognition– Abstraction– Generalization– AlgorithmDesign– Evaluation

Page 4: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

Decomposition

• Breakingdownaprocessintoasetofsmallersub-processestoallowustodescribe,understand,orexecutetheprocessbetter– Dividingataskintoasequenceofsubtasks– Identifyingelementsorpartsofacomplexsystem

Page 5: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

Decomposition

Page 6: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

ExamplesofDecomposition

• Whenwetasteanunfamiliardishandidentifyseveralingredientsbasedontheflavor,wearedecomposingthatdishintoitsindividualingredients

• Whenwegivesomeonedirectionstoourhouse,wearedecomposing theprocessofgettingfromoneplacetoanother(e.g.,city,interstate,etc.)

• Whenwebreakacourseprojectintoseveralsteps,wearedecomposingthetaskintosmaller,moremanageablesubtasks

• Inmathematics,wecandecompose anumbersuchas256.37 asfollows:2*102+5*101+6*100+3*10-1+7*10-2

Page 7: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

PatternRecognition

• Noticingoridentifyingsimilaritiesorcommondifferencesthatwillhelpusmakepredictionsorleadustoshortcuts–Welookforpatterns whenweplaygamestodecidewhentodocertainthings

– Basedonexperience,wedevelopshortcutsmappingproblemcharacteristicstosolution

Page 8: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

PatternRecognition

Page 9: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

ExamplesofPatternRecognition

• Welookforpatternswhenchoosingaregistrarwhenwecheckout

• Driverslookforpatternsintraffictodecidewhetherandwhentoswitchlanes

• Peoplelookforpatternsinstockpricestodecidewhentobuyandsell

• Scientistslookforpatternsindatatoderivetheoriesandmodels

• Welookforpatternsandlearnfromthemtoavoidrepeatingthesamemistake– “Lasttimewedidthis,itwas…let’strysomethingdifferent…”

Page 10: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

Abstraction

• Preservinginformationthatisrelevantinacontext,andforgettingorsuppressinginformationthatisirrelevantinthatcontexttosolveaproblem–Weuseabstractiontoorganize things:• Ahumanisamammal,amammalisananimal,andsoon

– A “bigpicture”sowecanreasonwithoutthinkingaboutthedetails

– Transferlearningorlearningbyanalogy

Guttag,JohnV.(2013-01-18).IntroductiontoComputationandProgrammingUsingPython(Spring2013editioned.).Cambridge,Massachusetts:TheMITPress.ISBN9780262519632.

Page 11: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

Abstraction

Page 12: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

ExamplesofAbstraction

• Aworldmapisanabstraction oftheearthintermsoflongitudeandlatitude,helpingusdescribethelocationandgeographyofaplace

• Asignofanaisleinastore—e.g.,Walmart—isanabstraction oftheitemsavailableinthataisle

• Whenwewriteabookreport,wesummarizeanddiscussonlythethemeorkeyaspectsofthebook,itisabstraction

• Whenwetellastoryordescribeamovietoourfriends,whydon’twedescribeeverysingledetailofthestoryormovie?

Page 13: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

Generalization

• Identifyingcommonorsharedcharacteristicsbetweentwodomainsorproblemssuchthatmodelsorsolutionsofonecouldbeadaptedorappliedtotheother– Mammalsarewarmblooded,givelivebirth,havehair,andsoon.Anelephantisamammal.Therefore,itiswarmblooded,givelivebirth,havehair…

– GroupprojectAsuccessfulbecauseofgoodteamworkstrategy.ApplysamegoodteamworkstrategytogroupprojectBshouldworktoo.

– Dealswithtrends,norms,outliers,scalability

Page 14: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

Generalization

Page 15: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

ExamplesofGeneralization

• Facebooktriestorecommendadstousersbasedonwhattheygeneralizefromwhatourfriendslike

• Googlesearchidentifiespopularkeywordsindifferentregionsatdifferenttimesandsuggeststhosekeywords(inautocompleteandalsocorrection)usingageneralization-likeprocess

• Amazon.com andNetflixmodelandcategorizetheircustomers,usegeneralization—inferencing—topredictwhattheircustomersareinterestedin,andmakerecommendationsaccordingly

• Whenwedon’thavecompleteinformation,weresorttogeneralizationtomakedecisions(sometimesincorrectly)– Thinkabout:biases,stereotypes,superstitions

Page 16: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

AlgorithmDesign

• Developingastep-by-stepstrategyforsolvingaproblem– Analgorithmisasequenceofstepsthatsolvesaproblem• Inputà output• Effective

– Algorithmicthinkinginvolvesbothcreation andexecution ofanalgorithm

Page 17: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

AlgorithmDesign

Page 18: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged
Page 19: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

ExamplesofAlgorithmDesign

• Whenacookwritesarecipeforadish,heorsheiscreatinganalgorithmthatotherscanfollowtoreplicatethedish

• Whenyourfriendwritesdowntheinstructiontogettoherhouse,heorsheisspecifyingasequenceofsteps—thatis,analgorithm—foryoutofollow(SeeGooglemaps!)

• Whenateachergivesasetofinstructionstocarryoutanexperiment,heorsheisspecifyinganalgorithmforyoutofollowtocollectandanalyzedata

• Whenyoufollowaninstallationmanualtoassembleabookshelf,youareexecutinganalgorithm

Page 20: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

Evaluation

• Checkingtoseewhetherasolutionisgood– Algorithmcorrectness– Requirements(meetingconstraints,designprinciples,etc.)

– Performance(usability,efficiency,speed,complexity,reliability,etc.)

Page 21: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

Evaluation

Page 22: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

https://medium.com/@FreeCodeCamp/coding-explained-in-25-profound-comics-8847ea03819c

Page 23: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

ExamplesofEvaluation

• Whenwecook,wetasteourdishesandthenadjustflavoringaccordingly

• Whenwefoldapaperairplane,wetestitsflight,andthenreviseeitherthedesignorthe“execution”tomakeitflybetter

• Whenwejogorbike,wekeeptrackofourbreathing,joints,etc.,anddecidewhethertostop,goslower,orgofaster

• Whenwecarryoutaphysicsexperiment,say,tofindtherelationshipbetweentemperatureandpressure,wecheckourdata,investigatewhyitdoesnotmatchthetheory,redoourexperimentalsetup,andrecollectdatapoints…

Page 24: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

So,ComputationalThinkingis…

• Decomposition• PatternRecognition

• Abstraction• Generalization• AlgorithmDesign

• Evaluation

Waitaminute…Thesearethings

thatwealreadyarecapableofdoing!!!

http://www.wallpapersax.com/wallpaper/cartoons-despicable-me-minion.html

Page 25: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

WhatisComputerScience?

• Therearemanydefinitions.ComputerSciencehelpsuspracticeourcomputationalthinkingbetter,faster,withlargerandmorecomplexproblems… …

Page 26: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

WhatisComputerScience?

Science:Welearn,model,anddescribehowhumansthink,makedecisions,andsolveproblems……

http://www.zastavki.com/eng/Cartoons/wallpaper-51616.htmhttps://www.pinterest.com/pin/357332551655575856/

Engineering:Webuildcomputersolutionstosupportandautomate

humanthinking,decisionmaking,problemsolving

...

Page 27: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

WhatisComputerProgramming?

• Aprocessthatleadsfromanoriginalformulationofacomputingproblemtoexecutableprograms

CODE…

http://en.wikipedia.org/wiki/Computer_programminghttp://www.beyondhollywood.com/despicable-me-2-teaser-trailer-now-with-more-minion-abuse/

CODE…CODE…

Page 28: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

Code.orghttp://code.org

GotoVideoFromcode.org

Page 29: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

Resources• ManyCS&ComputationalThinkingeducation/outreachresourcesavailableonline• NationalCenterforWomen&InformationTechnology(NCWIT)“in-a-box”kitshttp://ncwit.org

• Ensemble,aPortalforComputingEducatorshttp://www.computingportal.org

• CSEducationWeekhttp://www.csedweek.org• Google’sComputerScienceforHighSchool(CS4HS)

http://cs4hs.com

• Google’sExploringComputationalThinkinghttps://edu.google.com/resources/programs/exploring-computational-thinking/

• Code.orghttp://code.org• …

Page 30: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

• “CSUnpluggedisacollectionoffreelearningactivitiesthatteachComputerSciencethroughengaginggamesandpuzzlesthatusecards,string,crayonsandlotsofrunningaround.”

30

“Theactivitiesintroducestudentstounderlyingconceptssuchasbinarynumbers,algorithmsanddatacompression,separatedfromthedistractionsandtechnicaldetailsweusuallyseewithcomputers.”

“CSUnpluggedissuitableforpeopleofallages,fromelementaryschooltoseniors,andfrommanycountriesandbackgrounds.Unpluggedhasbeenusedaroundtheworldforoverfifteenyears,inclassrooms,sciencecenters,homes,andevenforholidayeventsinapark!”

CSUnpluggedhttp://csunplugged.org

Page 31: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

31

go

CSUnpluggedhttp://csunplugged.org

CreatedbyTimBell,IanH.Witten,andMikeFellows,andillustratedbyMattPowell

Page 32: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

32

CSUnpluggedAsNCWIT’sComputerScience-in-a-Box:UnplugYourCurriculum

(http://www.ncwit.org/resources/computer-science-box-unplug-your-curriculum)

• Examples– Magiccardshow– errordetection– Treasureisland– finitestatemachines– Sortinggame– sortingnetworks

Page 33: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

Finally…

“Computationalthinkingisafundamentalskillforeveryone,notjustforcomputer

scientists.Toreading,writing,andarithmetic,weshouldaddcomputational

thinkingtoeverychild’sanalyticalability.”–JeannetteWing,CACM 2006

Page 34: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

34

Finally…ComputationalThinkingis…

• Conceptualizing,notprogramming– ComputerScienceisnot just computerprogramming

• Fundamental,notroteskill– Askillneededbyeveryonetofunction

• Awaythathumans,notcomputers,think– Humansarecleverandcreative;computerstakeinstructionsfromhumans

• Ideas,notartifacts– Ideasgivebirthtoartifacts

• It’sforeveryone– Notjustforcomputerscientist;butforeveryone

Page 35: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

35

SpecialBond:ComputationalThinkingandCS

• Articulationofcomputationalthinkingskillsandprocessesintoreusablecomputerprograms(e.g.,instructingmachinestodopatternrecognition)viacodingmakesusmoreawareandattentiveofcomputationalthinking

• … andmore efficientandeffectiveinpracticingcomputationalthinkinginlearning,problemsolving,etc.

Page 36: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

36

Flavorsof ComputationalThinking…

Denning,P.(2017).RemainingTroubleSpotswithComputationalThinking,CommunicationsoftheACM,60(6):33-39.

Page 37: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

References

• http://www.google.com/edu/computational-thinking• PaulCurzon’s“SoWhatisComputationalThinking”• JeannetteM.Wing’s“ComputationalThinking”,CommunicationsoftheACM,March2006,pp.33-35

• https://en.wikipedia.org/wiki/Computer_science

Page 38: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

“It'sanenergyfieldcreatedby all livingthings.Itsurrounds us and

penetrates us;itbindsthe galaxytogether.”

Obi-WanKenobiintroducedLukeSkywalkerandmostof us to theForce for the firsttimeinStarWars:ANewHope

Page 39: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

“It'saskill practiced by all livingthings.Itsurrounds us and

penetrates us;itbindsproblemsolving(andlearning,discovery,…)

together.”

Leen-Kiat Soh onthefundamentalityofComputationalThinking.

Page 40: Computational Thinking, Computer Science, and Codingcse.unl.edu/~lksoh/Classes/CSCE100_Fall18/handouts/... · Computational Thinking, Computer Science, and Coding ... • “CS Unplugged

“Maycomputationalthinkingbewithyou.”

https://images-na.ssl-images-amazon.com/images/G/01/aplusautomation/vendorimages/65fa961e-8f22-4fe6-a420-3c3c26dd2953.jpg._CB289161999__SL300__.jpg