0% found this document useful (0 votes)
66 views20 pages

Computationalthinking 1 2

Computational thinking involves formulating problems and expressing solutions in a way that allows computers to solve problems effectively. It includes abstraction, decomposition, and algorithmic thinking. Abstraction removes unnecessary details to focus on essentials. Decomposition breaks large problems into smaller subproblems. Algorithmic thinking involves writing step-by-step instructions to solve problems. Effective algorithms are developed through abstraction, decomposition, and iterative testing and improvement of solutions.

Uploaded by

Hùng Võ Hoàng
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views20 pages

Computationalthinking 1 2

Computational thinking involves formulating problems and expressing solutions in a way that allows computers to solve problems effectively. It includes abstraction, decomposition, and algorithmic thinking. Abstraction removes unnecessary details to focus on essentials. Decomposition breaks large problems into smaller subproblems. Algorithmic thinking involves writing step-by-step instructions to solve problems. Effective algorithms are developed through abstraction, decomposition, and iterative testing and improvement of solutions.

Uploaded by

Hùng Võ Hoàng
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Computational Thinking

Objectives
Understand computational thinking: A thought process involved in
formulating a problem and expressing its solution in such a way that
computers can effectively carry it out, including
• abstraction
• decomposition
• algorithmic thinking
Understand computational thinking including
• Make sure you revise the answerS to the question
i.e. one answer in 3 parts
Computational thinking
• Computer Science is about studying problems and
how to solve them
• How can you route pieces of information across a network to
the other side of the world?
• How can you make the images in a computer game look
more realistic?
• How can you program a computer to work out the school
timetable?
• How can you search 1,000,000 items quickly?
What is an algorithm?
A set of instructions
• An algorithm is a set of instructions for solving a
problem or completing a task
• The task could be:
• Making a chocolate cake
• Summing the numbers 1 to 1000
• Building a Lego model
• Think of some more …
Algorithmic thinking

• Solving these puzzles involves algorithmic thinking


• If you are using a computer to find the answer, you
have to figure out how to solve the problem, and
then write down the steps
• Not all solutions are equally efficient!
Divide and conquer
• Here is a problem you can solve by thinking
algorithmically
• Ask a friend to think of a number between 1 and
1000
• Guess the number by asking: “Is the number greater
than n (where n is your guess)
• How many guesses will you need to find the number?
Abstraction

• Abstraction involves removing unnecessary detail


from a problem so that you can focus on the
essentials
• The London Underground map is a good example of
abstraction
Abstraction

• When you write a program to


play a game involving dice
with a computer, how does
the computer “roll the dice”?
Decomposition
• Decomposition involves breaking down a large
problem into smaller sub-problems
• Then the sub-problems can be broken down further
until each small task is manageable
Decomposing a dice game
• Suppose you want to create a dice game to be played on the
computer
• You need to think of the main tasks that need to be performed – for
example:
• Display the rules
• Establish whether this particular game is to be a two-player game, or one
person against the computer
• Display the “board” if there is one
• Play the game
• Display the result when the game is over
Decomposition - advantages

• The problem becomes easier to solve when it


consists of a number of small subtasks or modules
• Some modules may be reusable in other programs,
saving development time
Worksheet 1

• Try Task 2 on the worksheet


Questions
1. Define the term algorithm
2. Explain briefly what is meant by decomposition
3. Explain the term abstraction
4. Explain how abstraction and decomposition are
used in the design of an algorithm to calculate how
much to charge for lemonade at a lemonade stand
16

Problem solving: Steps

4. Check for
2.
errors and look
Construct a
1. Understand the 3. Apply for
plan to
problem the plan improvements
solve the
in the current
problem
plan
17

Problem solving: Step 1


Understand the problem
 To understand the problem we need all data to understand the problem.
 It is also important to check whether the problem is solvable.
 If it is solvable, a complex problem can be broken down into simpler
modules, that can be further solved individually.

teachcomputerscience.com
18

Problem solving: Step 2


Construct a plan to solve the problem
 To simply a developer work, he/she may check whether this type of problem
has been solved earlier.
 If yes, then that plan may be adapted to suit our needs. Some problems can
also be solved using mathematics.

teachcomputerscience.com
19

Problem solving: Step 3


Apply the plan
 The plan is carried out and it is important to check at every step that what we
are doing is correct.

teachcomputerscience.com
20

Problem solving: Step 4


Check for errors and look for improvements in the current plan
 The final step of problem-solving it’s to check whether the solution is correct.
The solution must be efficient and reusable in future.
 In case of errors, it has to be identified, then solved and the complete
solution is checked again.

teachcomputerscience.com

You might also like