ebook img

Computational Thinking: A Perspective on Computer Science PDF

338 Pages·2021·9.019 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Computational Thinking: A Perspective on Computer Science

Zhiwei Xu · Jialin Zhang Computational Thinking: A Perspective on Computer Science Computational Thinking: A Perspective on Computer Science (cid:129) Zhiwei Xu Jialin Zhang Computational Thinking: A Perspective on Computer Science ZhiweiXu JialinZhang UniversityofChineseAcademy UniversityofChineseAcademy ofSciences ofSciences Beijing,China Beijing,China ISBN978-981-16-3847-3 ISBN978-981-16-3848-0 (eBook) https://doi.org/10.1007/978-981-16-3848-0 ©TheEditor(s)(ifapplicable)andTheAuthor(s),underexclusivelicensetoSpringerNatureSingapore PteLtd.2021 Thisworkissubjecttocopyright.AllrightsaresolelyandexclusivelylicensedbythePublisher,whether thewholeorpartofthematerialisconcerned,specificallytherightsoftranslation,reprinting,reuseof illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similarordissimilarmethodologynowknownorhereafterdeveloped. Theuseofgeneraldescriptivenames,registerednames,trademarks,servicemarks,etc.inthispublication doesnotimply,evenintheabsenceofaspecificstatement,thatsuchnamesareexemptfromtherelevant protectivelawsandregulationsandthereforefreeforgeneraluse. The publisher, the authors, and the editorsare safeto assume that the adviceand informationin this bookarebelievedtobetrueandaccurateatthedateofpublication.Neitherthepublishernortheauthorsor theeditorsgiveawarranty,expressedorimplied,withrespecttothematerialcontainedhereinorforany errorsoromissionsthatmayhavebeenmade.Thepublisherremainsneutralwithregardtojurisdictional claimsinpublishedmapsandinstitutionalaffiliations. ThisSpringerimprintispublishedbytheregisteredcompanySpringerNatureSingaporePteLtd. The registered company address is: 152 Beach Road, #21-01/04 Gateway East, Singapore 189721, Singapore To Hao, for continuous inspiration and support Zhiwei To my husband and little son, with love Jialin Preface This book provides an introduction to computer science from the computational thinking perspective. It explains the way of thinking in computer science through chapters of logic thinking, algorithmic thinking, systems thinking, and network thinking.Itispurposelydesignedasatextbookforthefirstcomputersciencecourse servingundergraduatesfromalldisciplines. Thebookfocusesonelementaryknowledgesuchthatallmaterialcanbecovered inaone-semestercourseofIntroductiontoComputerScience.Itisdesignedforall students, assuming no prior programming experience. At the same time, students withpriorprogrammingexperienceshouldnotfindthecourseboring. Thebookpracticesanactivelearningmethod,utilizingrecentadvicebyDonald Knuth:“TheultimatetestofwhetherIunderstandsomethingisifIcanexplainittoa computer.”Thebookisdesignedtoenablestudentstorisefromthebasementlevel of remembering to the top level of creating in Bloom’s taxonomy of education objectives.Morethan200hands-onexercises,thoughtexperiments,andprojectsare includedtoencouragestudentstocreate.Examplesofcreativetasksinclude: (cid:129) DesignaTuringmachinetodon-bitaddition,wherencouldbearbitrarilylarge. Thiscouldbeastudent’sfirstdesignofanabstractcomputer. (cid:129) Designateamcomputertodoquicksort.Thiscouldbeastudent’sfirstdesignofa realcomputer,includingitsinstructionsetandmachineorganization. (cid:129) Develop a computer application (a steganography computer program) to hide a textfilehamlet.txtinapicturefileAutumn.bmp. (cid:129) Design a smart algorithm and a program to compute Fibonacci numbers F(n), wherencouldbeaslargeasonemillionorevenonebillion. (cid:129) Create a dynamic webpage of creative expression for a Kitty Band, which can playapieceofmusicgivenaninputstringofmusicscores. ThematerialofthebookhasbeenusedintheUniversityofChineseAcademyof Sciencessince2014,servingarequiredcourseforfreshmenfromallschools.Itwas vii viii Preface also used in summer schools organized by China Computer Federation, to train universityandhigh-schoolinstructorsonteachingaComputerFundamentalscourse utilizingcomputationalthinking. Supplementarymaterialisprovidedatcs101.ucas.edu.cn. Beijing,China ZhiweiXu October2021 JialinZhang Introduction Thistextbookisforaone-semestercourseofIntroductiontoComputerScience(e.g., CS101),targetingundergraduatestudentsfromalldisciplines.Itisaself-contained book with no prerequisites. The little prior knowledge and notations needed are explainedalongthewayandsummarizedinAppendices. The book is designed to introduce elementary knowledge of computer science andthefield’swayofthinking.Ithasthefollowingfourobjectivesandfeatures: (cid:129) Embodyingcomputationalthinking.Thewayofthinkingincomputerscienceis characterized by three features without and eight understandings within. Intro- ductory bodies of knowledge are organized into chapters of logic thinking, algorithmicthinking,systemsthinking,andnetworkthinking. (cid:129) AimingatupperlevelsofBloom’staxonomy,withasignificantportionoflearning material going from “remember” to “create,” as shown in Fig. 1. The learning methodusesKnuth’sTest:“TheultimatetestofwhetherIunderstandsomething is if I can explain it to a computer.” More than 200 hands-on exercises and thoughtexperimentsareincludedtoencouragestudentstocreate. (cid:129) Focusing on elementary knowledge without dumbing down. An explicit goal is that all material should be coverablein one semester, for a class of hundreds of students of all disciplines, assuming no prior programming experiences. At the sametime,experiencedstudentsshouldnotfindthecourseboring. (cid:129) Learning froma decade ofeducational experience. We spent 4 years designing the course and 6 years teaching the material. The contents have gone through three major revisions. For instance, version 1 has no programming. Version 2 includes Go language programming contents. Version 3 (the current version) requires a student to write roughly 300 lines of Go code and 100 lines of Web code,wheremoststudentscanlearnWebprogrammingbythemselves. ix x Introduction y e, z Bloom’s Taxonom Produce new or original workDesign, assemble, consturct, conjecture, develop, formulate, author, investigate Justify a stand or decisionappraise, argue, defend, judge, select, support, value, critique, weigh Draw connections among ideasdifferentiate, organize, relate, compare, contrast, distinguish, examine,experiment, question, test Use information in new situationsexecute, implement, solve, use, demonstrate, interpret, operate,schedule, sketch Explain ideas or conceptsclassify, describe, discuss, explain, identify, locate, recognireport, select, translate Recall facts and basic conceptsdefine, duplicate, list, memorize, repeat, state Vanderbilt University Center for Teaching ’eshowingBloomstaxonomybyVandyCFTislicensedunderCCBY2.0) d r gur create evaluate analyze apply nderstan emembe objectives.(Fi u r al n o ati c u d e of y m o n o x a t s ’m o o Bl 1 g. Fi Introduction xi Problem-Solving Examples Computerscienceisasubjectstudyingcomputationalprocessesinproblem-solving and creative expression. This textbook includes over 200 problems as examples, exercises, and hands-on projects. They provide a glimpse of how computers work andwhatkindsofproblem-solvingandcreativeexpressionareenabledbycomputer scienceandcomputationalthinking. Thebookshowshowtosolvesuchproblems.Indoingso,itintroduceselemen- tary knowledge on not only how to use a computer but also how to design a computer. We demonstrate that computer science is intellectually interesting, by heeding Donald Knuth’s advice: “In most of life, you can bluff, but not with computers.”Wetakespecialcaretoavoidunderestimatingthepotentialsofstudents anddumbingdownthecoursematerial. SixrepresentativeproblemsareshownbelowandillustratedinFig.2. (cid:129) DesignaTuringmachinetodon-bitaddition,wherencouldbearbitrarilylarge, such as n ¼ 23 ¼ 8, n ¼ 210 ¼ 1024, or n ¼ 220 ¼ 1048576. This could be a student’sfirstabstractcomputer. (cid:129) Design a human-computer to do quicksort. A student is asked to design a team computer to successfully rearrange a group of students ordered by students’ names to another group ordered by students’ heights, as shown in Fig. 2a. This could be a student’s first design of a working real computer, complete with its instructionsetandmachineorganizationofessentialcomponents. (cid:129) Compute the area of a panda. Computer science offers new abilities to solve problems beyondordinary school math, suchas computing theirregular area of the panda picture in Fig. 2b. The same computer application idea extends to irregular shapes ofmultiple dimensions,and “area”can be replaced byvolume, mass,energy,numberofparticles,etc. (cid:129) ComputeFibonaccinumbersF(n),wherencouldbeaslargeasonebillion.This problem reveals how smart algorithms, together with systems support, can drasticallyreducecomputingtime,from2ntonorevenlogn. (cid:129) Prove a problem belonging to P or NP, intuitively. Students are asked to prove whetherasimpleproblembelongstoPorNP.Forsuchalgorithmiccomplexity materialtobeincludedinanintroductorycourse,theproblemandtheproofmust beintuitivelysimple,involvingonlyelementarymathematicsandashortreason- ing sequence. A sample problem is the following: decide if 2n numbers can be divided into two groups, each having n numbers, such that the sums of the two groupsareequal. (cid:129) CreateKittyBand.Studentsareaskedtocreateadynamicwebpageshowingtheir personalartifacts.AnexampleisprovidedbyMissSiyueLioftheUniversityof Chinese Academy of Sciences, who created the Kitty Band work of creative expression,asshowninFig.2c.Thiswittybandcanplayapieceofmusicgiven aninputstringofmusicscores.AsafreshmanofPhysicsmajor,shefinishedthis projectin3days.Halfofhertimewasspentonthinking,designing,andmaking. Codinganddebuggingaccountedfornomorethan50%ofthetime.

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.