Computational Thinking, Computer Science, and Coding
Computational Thinking, Computer Science, and Coding
Leen-Kiat Soh
Department of Computer Science and Engineering
University of Nebraska, Lincoln, NE
E-mail: [email protected]
Computational Thinking,
Computer Science, and Coding
http://img2.wikia.nocookie.net/__cb20130510160248/despicableme/images/e/e9/Despicable-Me-Minions_thumb10.jpg
Hmm ….
What is
computational
thinking?
http://www.picturescraze.com/movies/1528/despicable+me+minion.html
What is Computational Thinking?
• A way of thinking for logically and methodically
solving problems
– E.g., purposeful, describable, replicable
• Includes skills such as
– Decomposition
– Pattern Recognition
– Abstraction
– Generalization
– Algorithm Design
– Evaluation
Decomposition
• Breaking down a process into a set of smaller
sub-processes to allow us to describe,
understand, or execute the process better
– Dividing a task into a sequence of subtasks
– Identifying elements or parts of a complex system
Decomposition
Examples of Decomposition
• When we taste an unfamiliar dish and identify several
ingredients based on the flavor, we are decomposing
that dish into its individual ingredients
• When we give someone directions to our house, we are
decomposing the process of getting from one place to
another (e.g., city, interstate, etc.)
• When we break a course project into several steps, we
are decomposing the task into smaller, more
manageable subtasks
• In mathematics, we can decompose a number such as
256.37 as follows: 2*102+5*101+6*100+3*10-1+7*10-2
Pattern Recognition
• Noticing or identifying similarities or common
differences that will help us make predictions or
lead us to shortcuts
– We look for patterns when we play games to decide
when to do certain things
– Based on experience, we develop shortcuts
mapping problem characteristics to solution
Pattern Recognition
Examples of Pattern Recognition
• We look for patterns when choosing a registrar when we
checkout
• Drivers look for patterns in traffic to decide whether and
when to switch lanes
• People look for patterns in stock prices to decide when
to buy and sell
• Scientists look for patterns in data to derive theories and
models
• We look for patterns and learn from them to avoid
repeating the same mistake
– “Last time we did this, it was … let’s try something different …”
Abstraction
• Preserving information that is relevant in a
context, and forgetting or suppressing
information that is irrelevant in that context to
solve a problem
– We use abstraction to organize things:
• A human is a mammal, a mammal is an animal, and so on
– A “big picture” so we can reason without thinking
about the details
– Transfer learning or learning by analogy
Guttag, John V. (2013-01-18). Introduction to Computation and Programming Using Python (Spring 2013 edition ed.). Cambridge,
Massachusetts: The MIT Press. ISBN 9780262519632.
Abstraction
Examples of Abstraction
• A world map is an abstraction of the earth in terms
of longitude and latitude, helping us describe the
location and geography of a place
• A sign of an aisle in a store—e.g., Walmart—is an
abstraction of the items available in that aisle
• When we write a book report, we summarize and
discuss only the theme or key aspects of the book,
it is abstraction
• When we tell a story or describe a movie to our
friends, why don’t we describe every single detail of
the story or movie?
Generalization
• Identifying common or shared characteristics
between two domains or problems such that
models or solutions of one could be adapted or
applied to the other
– Mammals are warm blooded, give live birth, have hair,
and so on. An elephant is a mammal. Therefore, it is
warm blooded, give live birth, have hair …
– Group project A successful because of good teamwork
strategy. Apply same good teamwork strategy to group
project B should work too.
– Deals with trends, norms, outliers, scalability
Generalization
Examples of Generalization
• Facebook tries to recommend ads to users based on
what they generalize from what our friends like
• Google search identifies popular keywords in different
regions at different times and suggests those keywords
(in autocomplete and also correction) using a
generalization-like process
• Amazon.com and Netflix model and categorize their
customers, use generalization—inferencing—to predict
what their customers are interested in, and make
recommendations accordingly
• When we don’t have complete information, we resort to
generalization to make decisions (sometimes incorrectly)
– Think about: biases, stereotypes, superstitions
Algorithm Design
• Developing a step-by-step strategy for solving a
problem
– An algorithm is a sequence of steps that solves a
problem
• Input à output
• Effective
– Algorithmic thinking involves both creation and
execution of an algorithm
Algorithm Design
Examples of Algorithm Design
• When a cook writes a recipe for a dish, he or she is
creating an algorithm that others can follow to replicate
the dish
• When your friend writes down the instruction to get to
her house, he or she is specifying a sequence of steps—
that is, an algorithm—for you to follow (See Google
maps!)
• When a teacher gives a set of instructions to carry out an
experiment, he or she is specifying an algorithm for you
to follow to collect and analyze data
• When you follow an installation manual to assemble a
bookshelf, you are executing an algorithm
Evaluation
• Checking to see whether a solution is good
– Algorithm correctness
– Requirements (meeting constraints, design
principles, etc.)
– Performance (usability, efficiency, speed,
complexity, reliability, etc.)
Evaluation
https://medium.com/@FreeCodeCamp/coding-explained-in-25-profound-comics-8847ea03819c
Examples of Evaluation
• When we cook, we taste our dishes and then adjust
flavoring accordingly
• When we fold a paper airplane, we test its flight, and
then revise either the design or the “execution” to make
it fly better
• When we jog or bike, we keep track of our breathing,
joints, etc., and decide whether to stop, go slower, or go
faster
• When we carry out a physics experiment, say, to find the
relationship between temperature and pressure, we
check our data, investigate why it does not match the
theory, redo our experimental setup, and recollect data
points …
So, Computational Thinking is …
Wait a minute …
These are things
• Decomposition that we already are
• Pattern capable of doing!!!
Recognition
• Abstraction
• Generalization
• Algorithm
Design
• Evaluation
http://www.wallpapersax.com/wallpaper/cartoons-despicable-me-minion.html
What is Computer Science?
http://www.zastavki.com/eng/Cartoons/wallpaper-51616.htm
https://www.pinterest.com/pin/357332551655575856/
What is Computer Programming?
• A process that leads from an original
formulation of a computing problem to
executable programs
CODE … CODE …
CODE …
http://www.beyondhollywood.com/despicable-me-2-teaser-trailer-now-with-more-minion-abuse/
http://en.wikipedia.org/wiki/Computer_programming
Code.org
http://code.org
30
CS Unplugged
http://csunplugged.org
Created by Tim Bell, Ian H. Witten, and Mike Fellows, and illustrated
by Matt Powell
go
31
CS Unplugged
As NCWIT’s Computer Science-in-a-Box: Unplug Your Curriculum
(http://www.ncwit.org/resources/computer-science-box-unplug-your-curriculum)
• Examples
– Magic card show – error detection
– Treasure island – finite state machines
– Sorting game – sorting networks
32
Finally …
“Computational thinking is a fundamental
skill for everyone, not just for computer
scientists. To reading, writing, and
arithmetic, we should add computational
thinking to every child’s analytical ability.” –
Jeannette Wing, CACM 2006
Finally … Computational Thinking is …
• Conceptualizing, not programming
– Computer Science is not just computer programming
• Fundamental, not rote skill
– A skill needed by everyone to function
• A way that humans, not computers, think
– Humans are clever and creative; computers take
instructions from humans
• Ideas, not artifacts
– Ideas give birth to artifacts
• It’s for everyone
– Not just for computer scientist; but for everyone
34
Special Bond:
Computational Thinking and CS
36
Denning, P. (2017). Remaining Trouble Spots with Computational Thinking, Communications of the ACM, 60(6):33-39.
References
• http://www.google.com/edu/computational-thinking
• Paul Curzon’s “So What is Computational Thinking”
• Jeannette M. Wing’s “Computational Thinking”,
Communications of the ACM, March 2006, pp. 33-35
• https://en.wikipedia.org/wiki/Computer_science
“It's an energy field created
by all living things. It surrounds us and
penetrates us; it binds the galaxy
together.”
https://images-na.ssl-images-amazon.com/images/G/01/aplusautomation/vendorimages/65fa961e-8f22-4fe6-a420-
3c3c26dd2953.jpg._CB289161999__SL300__.jpg