What Is Computational Thinking?
What Is Computational Thinking?
What Is Computational Thinking?
‘The mental activity for abstracting problems and formulating solutions that can be
automated.’
‘The process of recognizing aspects of computation in the world that surrounds us, and
applying tools and techniques from Computer Science to understand and reason about
both natural and artificial systems and processes.’
1. Problem definition
2. Logical thinking
3. Algorithmic thinking
4. Decomposition
5. Generalization and Pattern Recognition
6. Abstraction
7. Modelling
8. Evaluation
1. Data Representation
2. Critical Thinking
3. Computer Science
4. Automation
5. Simulation/Visualization
CT can be applied by anyone who is attempting to solve a problem and have a computer
play a role in the solution.
To a computer scientist, it means the study of algorithms and their application
to different problems. To a mathematician, it might mean carrying out long
division factoring or doing carries in addition or subtraction. A scientist might
think of it as the process of doing an experimental procedure.
SUMMARY
Logic provides a way to tell the difference between incorrect and correct
thinking, and can therefore be defined as the Science of correct thinking.
Inductive logic
Deductive logic.
INDUCTIVE LOGIC
I got allergy when I ate strawberry for the past 3 times so I must be
allergic to strawberry (it might have caused by other reasons too but we
get conclusions with more experience like 5 or 6 times)
Every quiz has been easy so the upcoming test will also be easy
DEDUCTIVE LOGIC
Any conclusions that are reached under deductive logic are absolutely,
irrefutably, and certainly true if the assumptions are true.
EXAMPLES OF DEDUCTIVE LOGIC
All students of this class play violin, Sam is a Student of this class,
Hence Sam knows violin.
In the conference all the people are aged above 40, Daniel was there in
the conference, Hence Daniel is above 40.
SYMBOLIC LOGIC:
Logic requires precision and an absence of ambiguity, but it can be difficult to meet
these requirements when using natural language.
Not only does that reduce the clutter, but it becomes more intuitive to treat each
proposition as a variable.
BOOLEAN LOGIC:
It’s a form of logic that deals with statements having one of only two values: true
or false (usually). Different corresponding values could be used in other contexts: 1 or 0
In order to instruct computers to make logical decisions, we need a system of logic that
maps well onto this way of thinking
DIGITAL LOGIC:
Digital logic is the manipulation of binary values through printed circuit board
technology that uses circuits and logic gates to construct the implementation of
computer operations.
PREPOSITIONS
Statements in Boolean logic are also known as propositions, which have several
basic properties.
A proposition can only have one value at any one time. In other words, a
single proposition can’t be both true and false simultaneously
Second, propositions must have clear and unambiguous meaning
LOGICAL OPERATORS
Logical operators, also known as logical connectives, are used to express logical
thought.
1. AND 4. IMPLIES
2. OR 5. IF AND ONLY IF
3. NOT 6. EQUIVALENCE
AND
The technical name for this operator is conjunction. It chains propositions together in a
way that all of them must be true for the conclusion to be true.
OR
The technical name for this operator is disjunction. This operator chains
propositions together in a way that at least one of them must be true for the conclusion
to be true also
NOT
The technical name for this operator is negation. This operator doesn’t chain
propositions together itself,
IMPLIES
The technical name for this operator is implication. Using this operator is to state
that there is a correlation between the two statements.
If the first statement is true, then the second must be true also.
IF AND ONLY IF
The technical name for this operator is biconditional. This behaves very similarly to
implication, but a biconditional means that the second proposition is influenced
solely by the first.
If the first is true, the second is true. If the first is false, the second is false. No
exceptions.
EQUIVALENCE
Variables P and Q are said to be equivalent if they have the same truth value.
The truth table for logical equivalence
PROBLEM DEFENITION
WHAT IS PROBLEM DEFENITION ?
The problem definition specifies what task(s) are to be performed by the associated
software. The problem definition also serves as the software developer’s goal.
A problem statement is usually one or two sentences to explain the problem your
process improvement project will address. In general, a problem statement will
outline the negative points of the current situation and explain why this matters
Without such a goal it is impossible to know whether the problem has been solved,
impossible to say whether a computer application is correct.
Without such a goal it is impossible to know whether the problem has been solved,
impossible to say whether a computer application is correct.
DESIGN – It is the design of the solution based on the analysis given has top level
design(outline) and top-down design(detailed)
FUNCTIONAL REQUIREMENTS
Specify the particular or the main task that need to be performed. Functional
requirements are features that allow the system to function as it was intended.
If the functional requirements are not met, the system will not work. Functional
requirements are product features and focus on user requirements.
NON-FUNCTIONAL REQUIREMENTS
Characteristics and constraints related to the solution. Non-functional requirements
include expectations for things like reliability, safety, security, performance,
delivery, and help facilities.
CLEAR
CONSISTENT
COMLETE
Two scenarios that should always be included for completeness are how the
application begins and ends its execution.
Another way that functional requirements may lack completeness is when they fail
to consider all possible combinations of situations.
The start point and the goal are intimately linked. By examining the start point, you
nail down exactly what is undesirable and why. In doing so, you reveal more about
what your goal should be
Understanding the problem is the important process so solving a problem and you don’t
know what the problem will be an error so If someone else gave it to you, try restating
the problem in your own words.
Try and represent the problem using pictures and diagrams. Humans deal better
with visual representations.
There will be knowns and unknowns at the start. You should ensure that enough
information is known for you to form a solution. If there isn’t, make the unknowns
explicit
Try describing how a working solution should look. Or perhaps describe how it should
work, but only at a very broad level (remember, details are no concern yet).
If the end goal is more complicated, you could describe every desired
‘feature’ of the solution. In this case, you’d be writing a specification.
As you develop your solution, keep comparing it to the specification to
make sure you’re solving the problem correctly.
IMPORTANT NOTE
Whatever the problem, the key thing to remember is that a goal defines what needs to
be done and not how it should be done.
Thinking about details like designs and algorithms at this stage is too early. Focus
instead on what your goal looks like.
However, you specify the goal, make sure that your language is clear and specific. For
example,
if you aim to improve the speed of the current system, don’t specify your end goal
simply as ‘it should be faster’. Give it measurable accuracy.
Always write your problem definition and goal as though someone else will
eventually take what you’ve produced and verify for themselves that you’ve solved
the problem. This will force you to take a more objective, considered view.
LOGICAL THINKING AND ALOGORITHMIC THINKING
All software applications depend upon some form of logical instructions because an
executing program must make choices
A cause effect relationship consists of a logical condition (the cause) that forces the
program to perform some task (the effect)
Logic and algorithms are not the same. Algorithms build on logic because, as
part of their work, they make logical decisions. The other part of their work is
‘stitching’ those decisions together.
Algorithm is a sequence of clearly defined steps that describe a process to follow a
finite set of unambiguous instructions with clear start and end points.
Algorithms are a way of specifying a multi-step task, and are especially useful
when we wish to explain to a third party (be it human or machine) how to carry out
steps with extreme precision.
INTUTION VS PRECISION
While precisive idea is the one with add 50 grams of sugar for some algorithm a
common outline algorithm is enough but as we move on we need to have a
precisive algorithm
DEFINING AN ALGORITHM
1. Collection of individual steps
2. Definiteness (one step--one meaning with precision)
3. Sequential
DECOMPOSITION
WHAT IS DECOMPOSITION?
This may require you to apply the process recursively (see above). That is to say, the
problem is re-formed as a series of smaller problems that, while simpler, might be
still too complex,
Decomposition won’t result in a complete plan of action, but it can give you a
starting point for formulating one.
For example, a fully decomposed problem definition can show all the individual tasks,
but doesn’t necessarily show the order in which you should tackle them
Decomposition aids collaboration. If you decompose a problem well (so that the sub-
problems can be solved independently), then different people can work on different
tasks, possibly in parallel.
EXAMPLES
GENERALISATION AND PATTERN RECOGNITION
WHAT IS A PATTERN?
RECOGNISING PATTERNS
Look for nouns that appear repeatedly. These could correspond to objects
that your solution deals with.
Look for verbs that appear repeatedly. These could be operations that
the solution carries out.
Look for concrete descriptions. These could probably be substituted
by placeholders that vary in different situations. For example:
Adjectives (‘red’, ‘long’, ‘smooth’) which indicate properties of things and
could be replaced by the property name (colour, size, texture)
Actual numbers, which could be replaced with variables.
WHAT IS GENERALISATION?
Pattern generalisation is spotting things that are common between patterns. We can
represent parts of a system in general terms, including Variables, Constants, Key
Processes, repeated Processes, Inputs and Outputs.
As a result, your solution becomes simpler because it contains fewer distinct concepts,
and it becomes more powerful because you can reuse it in other situations and
solutions
ABSTRACTION
WHAT IS AN ABSTRACTION?
abstraction is anything that allows us to concentrate on important characteristics while
deemphasizing less important, perhaps distracting, details.
A control structure is a mechanism for specifying the proper order in which
instructions must be performed. Algorithms are composed of five
fundamental control structures:
1.Sequential control
2.Selection
3.Repetition
4.Control abstraction
5.Concurrency