📑 Contents

Chapter 9.1: Computational Thinking Skills

9618 AS Computer Science

📚 Learning Objectives
🌟 Prior Knowledge Required
📖 What is Computational Thinking?

Computational thinking is a problem-solving process where a number of steps are taken to reach a solution. It is a logical approach to analyze a problem, producing a solution that can be understood by humans and used by computers.

It involves thinking about how a computer can be used to solve a problem, and then providing the computer with instructions that are precise and detailed.

Four Cornerstones of Computer Science ABSTRACTION DECOMPOSITION PATTERN RECOGNITION ALGORITHM DESIGN PROBLEM SOLVING

1. Abstraction

📖 Definition

Abstraction is the process of removing unnecessary details from a problem to focus on the important features for implementing a solution.

It involves filtering out — essentially, ignoring — the characteristics that we don't need in order to concentrate on those that we do. It is also the filtering out of specific details. From this we create a representation (idea) of what we are trying to solve.

📝 Examples of Abstraction in Everyday Life
🌟 What Can Be Modelled Using Abstraction?
COMPLEX PROBLEM • All details • Unnecessary info • Important features • Background noise ABSTRACTION (Filter out details) ESSENTIAL MODEL • Key features only • Relevant data • Solution-focused SOLUTION (Ready to code)

1.1 Benefits of Abstraction

Benefit Explanation
Reduced Development Time Time required to develop a program is reduced, so the program can be delivered to the customer more quickly
Smaller Program Size The program is smaller in size, so it takes up less space in memory and download times are shortened
Greater Customer Satisfaction Customer requirements are met more effectively as focus is on essential features
Easier Problem Understanding By removing unnecessary details, the core problem becomes clearer and easier to solve

1.2 Exam-Style Example: Car Hire System

Question: A system is being developed to help manage a car hire business. A customer may hire a car for a number of days. An abstract model needs to be produced. (9618 P21 Oct 22)
📝 Data Items Required for Car Hire
📝 Operations Required to Process Car Hire Data
  1. Input customer details
  2. Input car details
  3. Input payment details
  4. Create hire / start hire
  5. Return car / end hire
CUSTOMER • ID • Name • Licence • Address CAR • Car ID • Registration • Car Type HIRE DETAILS • Start Date • Return Date • No. of Days • Cost CAR HIRE SYSTEM
💡 Exam Tip

When asked to identify items for abstraction, focus on what is NECESSARY for the specific task. Ask yourself: "Does the system need this information to function correctly?" If not, it should be filtered out through abstraction.

1.3 Library System Example (9618/23/M/J/23)

Scenario: A school library system allows students to borrow books for a length of time. Information relating to students and books is stored in text files. Student information includes name, home address, email address, date of birth, tutor, and subject choices. Book information includes author, title, subject category, library location, and date that book was borrowed. A program helps staff to manage borrowing of books.
📝 Question: Applying Abstraction to Overdue Book Module

A new module needs to be written to generate emails to send to students who have an overdue book. Students who are sent an email are prevented from borrowing any more books until the overdue book is returned.

(a) Purpose of Applying Abstraction

📖 Answer [2 marks]

To filter out information that is not necessary to solve the problem and to include only essential information.

(b) Required vs Not Required Information

Category Required Not Required
Student Info Student name, Email address Home address, Date of birth, Tutor, Subject choices
Book Info Return/Issue date, Book title Library location, Category, Author
⚠️ Justification

Required: Student name/email needed to send the overdue notification. Return/Issue date needed to determine if book is overdue.

Not Required: Home address, tutor, subject choices are irrelevant for sending an email notification about an overdue book. These details don't help identify or contact the student about the overdue book.

(c) Operations for Processing Returned Overdue Book

📖 Answer [2 marks]
CHECK DUE DATE (Compare dates) SEND EMAIL (Student name, Email address) BLOCK STUDENT (No borrowing) BOOK RETURNED • Clear loan • Unblock student

2. Decomposition

📖 Definition

Decomposition is breaking down a complex problem into smaller parts that can be further subdivided into even smaller parts until each part is easy to examine and understand, and a solution can be developed for it.

It is one of the four cornerstones of Computer Science. It involves breaking down a complex problem or system into smaller parts that are more manageable and easier to understand.

🌟 Why is Decomposition Important?

2.1 Benefits of Decomposition

Benefit Explanation
Easier to Understand Breaking a complex problem down makes it easier to understand each component
Easier to Program/Test/Maintain Smaller problems are easier to work with individually
Team Collaboration Sub-problems can be given to different programmers with different expertise
Code Reusability Program modules already written and tested can be identified and reused, saving development time
COMPLEX PROBLEM Sub-Problem 1 Sub-Problem 2 Sub-Problem 3 Task 1.1 Task 1.2 Task 1.3

2.2 Decomposition in Practice

We do many tasks on a daily basis without even thinking about or decomposing them. Let's look at some practical examples:

Example 1: Brushing Our Teeth

📝 How Would You Decompose Brushing Teeth?

Example 2: Creating an App

📝 How Would You Decompose Creating an App?
CREATE APP DESIGN FEATURES PLATFORM PROGRAMMING TESTING MARKETING UI UX Logo Each task can be assigned to different team members!
💡 Exam Tip

When asked about decomposition benefits, mention these key points:

  1. Breaking down makes problems easier to understand
  2. Smaller problems are easier to program, test, and maintain
  3. Sub-problems can be assigned to different programmers with different expertise
  4. Existing modules can be reused, saving development time

3. Pattern Recognition

📖 Definition

Pattern recognition is one of the four cornerstones of Computer Science. It involves finding the similarities or patterns among small, decomposed problems that can help us solve more complex problems more efficiently.

When we decompose a complex problem, we often find patterns among the smaller problems we create. The patterns are similarities or characteristics that some of the problems share.

🌟 Types of Patterns

Patterns exist among different problems and within individual problems. We need to look for both!

3.1 Patterns Among Different Problems

To find patterns among problems, we look for things that are the same (or very similar) for each problem.

📝 Example: Baking a Cake

Decomposing the task of baking a cake would highlight the need to solve these smaller problems:

Once we know how to bake one particular type of cake, we can see that baking another type of cake is not that different — because patterns exist!

CHOCOLATE CAKE • Ingredients • Mixing time • Baking temp • Equipment COMMON PATTERN All cakes share similar steps: 1. Gather ingredients 2. Mix in specific order 3. Bake at temperature VICTORIA SPONGE • Ingredients • Mixing time • Baking temp • Equipment

4. Data Modelling

📖 Definition

Data modelling involves analyzing and organizing data to create a representation of how data will be stored, accessed, and processed in a system.

📝 Examples of Data Modelling

5. Algorithm Design

📖 Definition

Algorithm design involves developing step-by-step instructions to solve a problem. An algorithm is a finite sequence of well-defined instructions to solve a class of problems or perform a computation.

⚠️ Important: Algorithm Requirements
The Computational Thinking Process PROBLEM Identified ABSTRACTION Filter details DECOMPOSE Break into smaller parts PATTERNS Find similarities DESIGN Algorithm SOLUTION
🧠 Memory Trick: ADPA

Remember the order of computational thinking steps:

A - Abstraction (Filter out unnecessary details)

D - Decomposition (Break into smaller parts)

P - Pattern Recognition (Find similarities)

A - Algorithm Design (Create step-by-step solution)

6. Exam-Style Questions

1. Explain what is meant by the term abstraction in computational thinking. [2 marks]

Answer:

  • Abstraction is the process of filtering out information that is not necessary to solve a problem
  • And including only essential information needed to solve the problem
  • Additional point for deeper understanding: It creates a simplified representation of the problem that focuses on key features
2. Describe two benefits of using decomposition when developing a software solution. [4 marks]

Answer:

  • Easier to understand: Breaking a complex problem down makes it easier to understand each component
  • Easier to program/test/maintain: Smaller problems are easier to work with individually
  • Team collaboration: Sub-problems can be given to different programmers with different expertise
  • Code reusability: Modules already written and tested can be identified and reused
  • Additional point: Faster development as multiple people can work simultaneously on different parts
  • Additional point: Easier debugging as errors can be isolated to specific sub-problems
3. A train timetable is an example of abstraction. Explain why this is an example of abstraction. [3 marks]

Answer:

  • The timetable shows only necessary information for travellers (departure/arrival times, stations)
  • It filters out unnecessary details such as exact track layouts, train specifications, geography
  • Travellers only need to know that getting on at station A will take them to station B at a specific time
  • Additional point: The complex real-world railway system is simplified into an easy-to-read representation
4. Explain what is meant by pattern recognition in computational thinking. Give an example to illustrate your answer. [4 marks]

Answer:

  • Pattern recognition involves finding similarities or patterns among small, decomposed problems
  • These patterns help solve more complex problems more efficiently
  • Example: When baking different types of cakes, the process follows a similar pattern: gather ingredients, mix, bake, decorate
  • Recognizing this pattern means we can apply the same general approach to any cake recipe
  • Additional point: Standard algorithms exist for common patterns (sorting, searching)
  • Additional point: Patterns can exist among different problems or within individual problems
5. A software company is developing a new mobile game. The project manager decides to use decomposition to break down the task. Discuss how decomposition would help in this project. [6 marks]

Answer:

  • The game development can be broken into smaller sub-problems such as: graphics design, sound design, game logic programming, user interface, testing, marketing
  • Each sub-problem can be assigned to different team members with relevant expertise (e.g., artists work on graphics, programmers on code)
  • Smaller problems are easier to manage, test, and debug
  • Work can happen in parallel, reducing overall development time
  • Existing modules/components can be reused from previous projects
  • Each component can be tested independently before integration
  • Additional point: If one part fails, other parts can still progress
  • Additional point: Makes project scheduling and milestone tracking easier

6. Exam-Style Questions (Continued)

6. A school is developing a system to manage student attendance. Using abstraction, identify three items of data that would be required and three items that would NOT be required for generating attendance reports. Justify your choices. [6 marks]

Answer:

Required Data:

  • Student ID/Name - To identify which student's attendance is being recorded
  • Date and Time - To record when the student was present/absent
  • Present/Absent Status - The core attendance data needed for reports
  • Additional: Class/Subject - To track attendance per lesson

Not Required Data:

  • Student's home address - Not needed to track if they are present in class
  • Student's hobbies/interests - Irrelevant to attendance tracking
  • Parent's occupation - Not needed for attendance reports
  • Additional: Medical records - Not relevant for basic attendance
7. Describe the relationship between decomposition and pattern recognition in computational thinking. [4 marks]

Answer:

  • Decomposition breaks down a complex problem into smaller, manageable sub-problems
  • Once decomposed, we can look for similarities and patterns among these smaller problems
  • Pattern recognition follows decomposition - we need smaller problems first to identify patterns
  • Recognized patterns allow us to apply common solutions to similar sub-problems
  • Additional point: This makes problem-solving more efficient as we don't reinvent solutions
8. What is algorithm design? Explain how it relates to the other components of computational thinking. [5 marks]

Answer:

  • Algorithm design is developing step-by-step instructions to solve a problem
  • It is the final stage of computational thinking after abstraction, decomposition, and pattern recognition
  • After abstraction filters unnecessary details, decomposition breaks the problem down, and patterns are identified, algorithm design creates the actual solution
  • Algorithms must be precise, unambiguous, and finite
  • It bridges the gap between human understanding and computer implementation
  • Additional point: Good algorithms can be translated into any programming language
9. A flight simulator is an example of abstraction. Explain how abstraction is used in a flight simulator and why it is important. [5 marks]

Answer:

  • The simulator shows a simplified representation of flying an aircraft
  • It includes essential elements like controls, instruments, and visual displays
  • It filters out unnecessary real-world details like the texture of seats, smell of fuel, or exact weather conditions
  • Important because: It makes the simulation focused and manageable for training purposes
  • Important because: Users can learn to fly without the risks and costs of real aircraft
  • Additional point: Different abstraction levels can be created for different training needs (beginner vs advanced pilots)
10. Explain how data modelling is used in computational thinking and give two examples of data models. [4 marks]

Answer:

  • Data modelling involves analyzing and organizing data to understand how it will be stored and processed
  • It helps create a representation of the data structure needed for a solution
  • Example 1: Abstract Data Types (ADTs) like queues model real-world concepts (e.g., print queue, waiting lines)
  • Example 2: Classes in Object-Oriented Programming model real-world entities with attributes and methods
  • Additional example: Entity-Relationship diagrams model database structures
  • Additional point: Data models help programmers understand how data flows through a system

7. Glossary

📖 Key Terms

Abstraction — The process of removing unnecessary details from a problem to focus on the important features for implementing a solution.

Algorithm — A finite sequence of well-defined instructions to solve a class of problems or perform a computation.

Algorithm Design — The process of developing step-by-step instructions to solve a problem.

Computational Thinking — A problem-solving process using logical approaches to analyze problems and produce solutions understandable by humans and usable by computers.

Data Modelling — The process of analyzing and organizing data to create a representation of how data will be stored, accessed, and processed.

Decomposition — Breaking down a complex problem into smaller, more manageable parts that can be solved individually.

Pattern Recognition — Finding similarities or patterns among small, decomposed problems that can help solve more complex problems more efficiently.

Representation — A simplified model or idea created through abstraction that captures essential features of a problem.

Sub-problem — A smaller, simpler problem created through decomposition of a larger, complex problem.

COMPUTATIONAL THINKING ABSTRACTION DECOMPOSITION PATTERN RECOGNITION ALGORITHM DESIGN DATA MODELLING

8. Exam Success Tips (Part 1)

💡 Abstraction Questions - Key Points
💡 Decomposition Questions - Key Points
💡 Pattern Recognition Questions - Key Points
🧠 Memory Trick: The 4 Cornerstones

Remember "ADPA" for the order:

Or think: "A Detective Plans Ahead"

❌ Common Mistakes to Avoid

8. Exam Success Tips (Part 2)

⚠️ Answer Structure Tips
💡 Algorithm Design Questions
Term What It Does Key Phrase
Abstraction Removes unnecessary details "Filter out and focus"
Decomposition Breaks into smaller parts "Divide and conquer"
Pattern Recognition Finds similarities "Look for commonalities"
Algorithm Design Creates step-by-step solution "Precise instructions"
Data Modelling Organizes data structure "Analyze and organize"
🌟 Quick Revision Checklist

9. Key Takeaways

📌 Summary Points

Computational Thinking

Abstraction

Decomposition

Pattern Recognition

Algorithm Design

Data Modelling

PROBLEM ABSTRACTION Filter details DECOMPOSITION Break into parts PATTERN RECOGNITION Find similarities ALGORITHM DESIGN SOLUTION Ready to code! DATA MODELLING (Throughout process)
🧠 Final Memory Trick

ADPA = A Detective Plans Ahead

Abstraction → Decomposition → Pattern Recognition → Algorithm Design