Professional Documents
Culture Documents
Evaluation
o Evaluation is all about determining if a solution is
You can think of abstraction in terms of layers of good according to some standards
information o Evaluation is the concept of determining if a
- As we go lower, more information is solution is actually a good solution
revealed - But what makes a solution “good”?
- As we go higher, less information is Beecher (2017) mentions we can ask the
retained following questions:
- Is it correct?
Does it actually solve the problem you set
out to solve?
- Is it efficient? - All four concepts can be applied at any
Does it use resources reasonably? phase in the problem solving process and
- Is it elegant? can be applied together
Is it simple yet effective? In relation to the previous point, the concept of
- Is it usable? Evaluation can be performed even during
Does it provide a satisfactory way for the decomposition
target audience to use it? - Evaluation is recognizing that a solution is
Evaluation is heavily dependent on the framing of just a plan and that any plan can be
the problem evaluated -- even w/o concrete
- Each task should be traced back to which implementation.
subproblem they solve Abstraction is one of the hardest concepts out of
- Each subproblem should eventually trace the four.
back to the main problem being solved - Too abstract a concept might lead to loss of
information, while too little abstract might
Recap lead to an overwhelming amount of
We defined our own definition of Computational information.
because there’s no standard definition - In relation to our attempt at looking the
CT defined as “…a mindset that anyone can use many other concepts, abstraction is closely
for solving any problem and that involves related to pattern recognition and
framing these problems and their solutions generalization.
guided by concepts core to computer science.” - Abstraction requires exposure and practice
Framing problems and creating solutions must be to recognizing patterns and performing
guided by certain Computational Thinking generalizations (hence, their close
concepts: association with each other)
- Decomposition is the idea of breakdown - Pattern recognition is the idea of looking for
down big problems into smaller easier to similarities among data
solve problems - This might include recognizing patterns
- Abstraction is the idea of highlighting among solutions to different sub problems or
important information and removing recognizing important characteristics of a
irrelevant information given situation.
- Algorithmic Thinking is the idea that - Once identified, patterns can generalized
solutions should be defined and have into single concept, which usually makes a
proper sequence solution simpler or aids in coming up with
- Evaluation is the idea of determining how solutions to similar problems.
good a solution is
Source: Computational Thinking... with Jump Shots?
Source: Core Concepts of Computational Thinking
Recap
Clarifications We tackled the problem taking good jump shots
These four concepts help further define the using the computational thinking mindset
identify of Computational Thinking We identified the main problem and broke it down
- I.e. Computational Thinking is a mindset that until we had tasks to perform (instead of
anyone can use for solving any problem and problems to wonder how to solve)
that involves framing these problems and We then saw how abstraction can help in
their solutions guided by decomposition, understanding a motion tracking (which is what
abstraction, algorithmic thinking, and we need to predict the peak of a jump)
evaluations. (woah mega evaluation right We evaluated both our manual approach and the
here) computational approach by briefly looking at the
The four concepts of Computational Thinking are capabilities and limitations of each
not meant to be done in steps. Lastly, algorithmic thinking is observed not in the
- I.e. Its not a step by step process creation of an algorithm, but in adhering to what
an algorithm should be (having clear and defined 9. One aspect that Algorithmic Thinking advocates
instructions) for is that solutions need to have a clear start;
however, solutions -- in the form of algorithms --
Short Quiz 1 do not need a clear ending.
1. Is a CT concept that highlights that a problem - False
(regardless of size) can be broken down into 10. The question of "Is it correct?" is something that
smaller problems. In turn, these problems can be is asked when looking to evaluate a solution.
broken down further and as these problems are - True
broken down, they may resemble tasks.
- Decomposition Module 2: Decomposition
2. Is a CT concept that deals with understanding the
correctness of a solution and if it addresses the Source: Decomposition for Problem Solving
problem at hand. It also deals with knowing
whether a solution is efficient (i.e. smartly uses "If you can't solve a problem, then there is an easier
resources), elegant (i.e. simplicity over problem you can solve: find it." - George Polya
complexity), and usable (i.e. can be used by the
user and can be implemented by the problem Decomposition is an approach that seeks to
solver). break a big, complex problem into smaller, easier
- Evaluation to solve problems.
3. Is a CT concept that deals with understanding These simpler problems or parts may either be
that any process or solution can be represented interrelated or complete independent of each
in the manner of an algorithm -- something that is other.
defined and sequential. To perform decomposition, one needs to properly
- Algorithmic Thinking frame the problem and identify the "main
4. Is a CT concept that deals with suppressing problem”, and then look at parts and pieces of
information while still retaining relevant the problem (sub problems). If sub-problems are
information to the task at hand. still complex to solve, we continue the process
- Abstraction (recursively)of breaking down each of these sub-
5. In general, there are only four (4) concepts that problems into sub-sub-problems until each sub-
make up Computational Thinking. problem are just simple tasks to do.
- False
6. Computational Thinking -- as a problem solving
mindset -- is only meant to be used by computing
professionals.
- False
7. The Computational Thinking four concepts we'll
highlight in class are meant to executed in the
following order:
Decomposition
Abstraction
Algorithmic Thinking
Evaluation
- False
8. The definition that we came up with for In most cases, problem solving can be framed as
Computational Thinking -- "...is a mindset that input-process-output.
anyone can use for solving any problem and that - The input could be some data that we need
involves framing these problems and their to process or the available resources that
solutions guided by concepts core to computer can be used to solve the problem.
science." -- was derived from other definitions - The process is the solution to be done in
and may not be the only way to define CT. order to solve a given problem.
- True
- The output is equivalent to our goal or following computation (Assume that the scores for all the
desired outcome that would prove that the items are out of 100 points):
given problem has been solved.
Say you are given the problem below and you are asked to
give a Python program as a solution.
Given the scores for the two departmental quizzes, two 4) Determine the manner of processing that must be
projects, final exam, and class participation, write a done on the input data to come up with the
program that will compute for the final grade based on the desired output (i.e., determine what formulas are
needed to manipulate the given data)
them inside a circle to resemble a face".
Having generalized the pattern of all faces,
when someone says "draw a face", typically
we know what they mean. The details of the
Setting up an algorithm
face have been suppressed.
1) Get quiz1 and quiz2 scores.
2) Get proj1 and proj2 scores.
Importance of Abstraction
3) Get finalE score.
"The essence of abstractions is preserving
4) Get classP score.
information that is relevant in a given context,
5) Calculate the final grade using the formula below
and forgetting information that is irrelevant in that
context." - (Guttag, 2013)
6) Display the final grade finalGrade. Abstraction is essential to computer scientists.
This is because the real world is quite complex,
Coding and since computer scientists solve problems by
creating solutions using programs, they simply
cannot represent all the details and complexities
of the real world as information on their
computers, so they tend to suppress information
that is unnecessary to the problem at hand.
As we have discussed prior to this, just because
this concept is used extensively by computer
scientists does not mean it is exclusive to them.
Abstraction is also an essential skill in day to day
problem solving, because, like computers, our
brains cannot store an infinite amount of
information at any given moment. It is oftentimes
easier to only retain necessary information when
problem solving.
Layers of abstraction
e.g. email applications
The highest level of abstraction is the user
interface level. For users of the app, all they need
to know is that to send an email, they type in their
message and the recipient, and click send.
The next level of abstraction is the application
level. This is where the software developers lie.
They need to know how the emails are
(We used float() to convert our input to a floating point represented in memory (what data types), as well
since grades usually have decimals.) as the recipient. They also need to interface with
the network so that the data can be sent to the
Module 3: Abstraction appropriate recipient.
The next level of abstraction is the network or
Source: Abstraction for Problem Solving hardware layer. This is how the bytes of data are
actually routed and transferred across the
Abstraction is the suppression of information that is internet to the recipient.
unnecessary to solving a specific problem. The question now is which level of abstraction is
- Most of the time, when someone would tell necessary? The answer is: it depends. The context of use
you to draw this kind of illustration, they determines the level of abstraction necessary. For the
would just say "can you draw a face?" users of the app, the interface level is the only level of
instead of having to cite all the details like abstraction applicable. For the application development
"please draw two eyes, a smile, and place
team, the application level is the only one they need to It is possible that your solution is only applicable
know. The lowest level of abstraction is for the network for a certain scenario, but it does not work for
engineers to know. Context is everything in selecting a other scenarios.
level of abstraction. Different contexts require different
information.
Source: Abstraction in Games
Sometimes, you also don't need to wait for a finished What is a program?
solution, you can ask people what they think of your plan Looking up the definition of a program, we find it
so you can fix the problems sooner. is described as…
- A set of instructions that a computer follows
Module 5A: Algorithmic Thinking 1 - Intro to Algorithms and in order to perform a particular task
Programming So… is a program an algorithm?
- Yes!
Source: What is an Algorithm? - A program is a more specific algorithm that
is meant to be run by a computer
Algorithm A program will strictly flow its instructions step by
An algorithm is a sequence of instructions that step
adheres tto two main principles: - Unlike a human interpreting statements in
- Steps must be clearly defined and an algorithm, programs don’t question your
unambiguous (Defined) instructions
- Steps must be with clear start and end - However, if there's an error in a program its
points (Sequential) either…
Definiteness (1) The code is typed wrong
Are road signs algorithms? (2) The logic of the code is wrong
- No! name = input("Hi! What's your name? ")
- However, they are defined rules to follow. print("Hello %s! Nice to meet you" % name)
- When encountering a road sign driving from Hence, programmers need to carefully
point A to point B, one needs to recognize understand the “language” or instructions we can
use to “talk” to computers
- Which is similar when you’re… - Input – The values you want processed (i.e.
(1) Learning an actual (human) language data)
or… - Process – The processing you do with the
(2) Learning the meaning of road signs cells (formulas, functions, etc.)
or… - Output – The resulting processed values /
(3) Learning how to interpret notes on a charts
music sheet
Lightbot
Is a simple game that helps in learning about
programming constructs
Source: Introduction to Programming
Summary
What is an algorithm?
- A set of instructions that are clearly defined
and have sequence Or
What is a program?
- A set of instructions meant to be run by a
computer through some programming
language
We can also frame problems using the Input ->
Process -> Output
Programming Concepts (in Python)
- Developer's environment (REPL / IDLE)
- Output statement
- Variables Data Types
- Input statement 1. Strings
Refers to text data
Module 5B: Algorithmic Thinking 1 - Variables, Data Types - Can be composed of a string of letters,
and Operators numerals (figures that denote a number),
and other special characters
Source: Working with Data (Data Types and Operators) - Example: the name of a game you bought
during a Steam sale
Recall When writing Strings literally into code,
Output statement: print(“Hello world”) they are enclosed in quotation marks
Assignment statement: x = 2 - x = "The quick brown fox jumped over the
Input statement: name = input(“Enter name: ”) lazy dog"
2. Integers
Refer to whole numbers
- They are usually used to denote counts of
objects
- Example: the number of games you bought
during the Steam sale
When written into code, simply write
Data Types the numerals that denote the value of
Our issue here is that we have an improper data the desired whole number
type - No decimal point
In certain cases, you’d have to tell Python what - x=4
type of data a specific value is 3. Floats
We need to tell Python to convert the type of our Floating point numbers refer to decimal
input to a number numbers
- They are usually used to denote measures
or data that requires precision
- Example: how much money did you spend
during the Steam sale
When written into code, write the
numerals that denote the value of the
Or desired decimal number with the
decimal point
- x = 50.5 ; x = 1.0
4. Boolean
Refers to data that can only either be
true or false
- Unlike Strings or numbers with infinite
possible values
- These are often used to denote whether a
state is or is not
- Example: having enough money to buy all
the games you want during the Steam sale
When written into code, boolean values
are written as True or False Integer division (nearest whole number)
- Note the capitalization!
Operators in Python