Computational Thinking

Free Content

Theory

Computational thinking is a problem-solving process that includes (but is not limited to) formulating problems in a way that enables us to use a computer and other tools to help solve them, logically organising and analysing data, representing data through abstractions such as models and simulations, and automating solutions through algorithmic thinking (a series of ordered steps).

Sign up here
Go back

Video Resources

Computational Thinking Explained

How to create a Flowchart

State Examination 2024

HLSection AQuestion 4
Question 4
6 marks

Figure 1 shows a row of black and white discs with their position numbers shown under each square. There are only two ways to move a disc:

  1. Move into an empty square: one position to the left or right, for example, 1 → 2 means move the disc from square 1 to square 2.
  2. Jump in either direction over a single adjacent disc into an empty space immediately beyond, for example, 3 → 1 means move the disc from square 3 to square 1, jumping over a disc in square 2.
Figure 1 (Start State)
0
1
2
3
4

Write a sequence of steps, or an algorithm, that swaps all the white discs with the black discs so that the row looks like that shown in Figure 2. You can only move a single disc in each step.

Figure 2 (End State)
0
1
2
3
4
Enter each step on a new line. Use the format: position → position, position - position, position > position or position -> position.

State Examination 2024

HLSection AQuestion 11
Question 11
6 marks

(a) Apply the algorithm shown in pseudo code below to the row of shapes shown in Figure 4 and illustrate your answer in the boxes provided. (4 marks)

1problem_solved ← FALSE
2LOOP until problem_solved IS TRUE
3 square ← find the leftmost square
4 triangle ← find the rightmost triangle
5 IF position of square IS GREATER THAN position of triangle
6 problem_solved ← TRUE
7 ELSE
8 swap (square, triangle)
Figure 4 (Initial State)
0
1
2
3
4
5
6
7
8
(Enter 'S' for square, 'T' for triangle, 'E' for empty)
(Enter 'S' for square, 'T' for triangle, 'E' for empty)

(b) The algorithm described in part (a) provides a general solution to the problem it solves. Explain what is meant by the phrase 'a general solution'. (2 marks)

State Examination 2024

HLSection BQuestion 14(a)
Question 14
9 marks

The flowchart, shown in Figure 6 below, describes an algorithm that reads two values, swaps them, and then displays their new values.

Figure 6
Start
a, b ← INPUT
Enter two values
t ← a
a ← b
b ← t
OUTPUT a, b
Stop

(iii) Flowcharts are commonly used in the design process to describe algorithms. State one advantage and one disadvantage of using flowcharts.(4 marks)

This question continues on the next page.