Starter Activity (5 mins)
Problem Solving Puzzles...
Discussion Points:
- 1. Complexity often arises from having many steps, lots of details to remember, dependencies between parts, or unclear goals.
- 2. Simplification often involves breaking the task into smaller, manageable parts (decomposition), focusing only on the essential details at each stage (abstraction), or following a clear plan (algorithmic thinking).
- 3. Good instructions are usually clear, step-by-step, and unambiguous. Sometimes an overview is helpful first, then detailed steps. The level of detail might depend on the other person's existing knowledge.
Lesson Outcomes
By the end of this lesson, you should be able to:
- Define Computational ThinkingA problem solving process using abstraction, decomposition and algorithmic thinking. Results in an algorithm we can code for a computer. and its core principles.
- Explain AbstractionRemoving/hiding unnecessary detail and focusing on the important details that are necessary to solve a problem. Simplifies the problem and reduces complexity making it easier to solve/understand. and provide examples of its use in problem-solving.
- Explain DecompositionBreaking a problem down into smaller steps in order to solve it. A CT skill. and describe its benefits.
- Explain Algorithmic ThinkingDefining the steps needed to solve a problem using sequence, selection and iteration. A CT skill. and how it relates to creating algorithms.
- Apply these principles to define and refine problems.
Introduction: What is Computational Thinking?
Computational Thinking (CT)A problem solving process using abstraction, decomposition and algorithmic thinking. Results in an algorithm we can code for a computer. is not about thinking *like* a computer in a literal sense, but rather a set of problem-solving skills and techniques that computer scientists (and many others!) use to understand complex problems and design solutions that can often be implemented by a computer.
It's a way of breaking down large, complex problems into smaller, more manageable parts, identifying what's important and ignoring irrelevant details, and then developing step-by-step instructions (algorithms) to solve them.
The three core principles of Computational Thinking we will explore are:
- AbstractionRemoving/hiding unnecessary detail and focusing on the important details that are necessary to solve a problem. Simplifies the problem and reduces complexity making it easier to solve/understand.
- DecompositionBreaking a problem down into smaller steps in order to solve it. A CT skill.
- Algorithmic ThinkingDefining the steps needed to solve a problem using sequence, selection and iteration. A CT skill.
Mastering these skills is fundamental to computer science and programming, but they are also incredibly useful in many other areas of life! Hover over keywordsThis is an example tooltip! for definitions.
Abstraction
Focusing on the Essentials
AbstractionRemoving/hiding unnecessary detail and focusing on the important details that are necessary to solve a problem. Simplifies the problem and reduces complexity making it easier to solve/understand. is the process of removing or hiding unnecessary detail and focusing on the important details that are necessary to solve a problem. It simplifies the problem and reduces complexity, making it easier to understand and solve.
Think of it like a map: a London Underground map is an abstraction. It shows the stations and lines (essential details for navigating the tube) but hides the actual geographical twists and turns of the tunnels, street layouts above ground, or distances between stations (unnecessary details for its purpose).
Examples in Computing:
- Calling built-in functions in Python (e.g., `randint()`). You don't need to know *how* `randint()` generates a random number, just that it does and how to use it.
- Accessing a website via a URL (e.g., `www.google.com`). You don't need to manually find the IP address from a DNS server; the browser handles that complexity.
- Using a calendar widget to pick a date. The complex logic of calendars (leap years, days in a month) is hidden; you just click a date.
- Variables in programming: A variable name like `userScore` abstracts away the memory location where the score is actually stored.
Task 1.1: Spot the Abstraction (Max 3 points)
For each scenario, identify what key detail or complexity is being hidden or simplified by abstraction.
Decomposition
Breaking Down Problems
DecompositionBreaking a problem down into smaller steps in order to solve it. A CT skill. is the process of breaking down a complex problem or system into smaller, more manageable sub-problems. Each sub-problem can then be solved individually, and the solutions combined to solve the original complex problem.
Imagine trying to build a car. You wouldn't just start welding metal randomly! You'd decompose the task into building the engine, the chassis, the electronics, the interior, etc. Each of these can be further decomposed.
Example: Developing a Chess Game
- Display the chess board.
- Allow a player to input a move.
- Validate if the move is legal.
- Update the board state.
- Check for win/draw conditions.
- (If playing against AI) Develop the AI's logic to choose its own move.
Benefits of Decomposition:
- Makes complex problems easier to understand and solve.
- Allows different people or teams to work on different parts of a problem simultaneously.
- Reduces development time.
- Program components (modules/functions) developed for one sub-problem can often be reused.
- Easier to test and debug smaller, individual components.
- Programs are less prone to errors during development.
- Easier to manage changes if requirements evolve.
- Simplifies program maintenance.
Task 2.1: Decompose a Daily Task (Max 3 points)
Think about the task of "Making a cup of tea." Decompose this into at least 3-5 smaller, distinct sub-tasks or steps. Write one sub-task per box.
Algorithmic Thinking
Creating Step-by-Step Solutions
Algorithmic ThinkingDefining the steps needed to solve a problem using sequence, selection and iteration. A CT skill. is the process of developing a step-by-step solution to a problem, or the rules to follow to solve a problem. It involves defining a precise sequence of instructions that can be followed to achieve a desired outcome.
An algorithmA finite sequence of well-defined, computer-implementable instructions, typically to solve a class of specific problems or to perform a computation. is the result of algorithmic thinking. Algorithms must be unambiguous (clear and not open to interpretation) and finite (they must eventually end).
Key components of algorithmic thinking often involve:
- Sequence: Performing instructions in a specific order.
- Selection: Making decisions and choosing different paths based on conditions (e.g., using IF...THEN...ELSE statements).
- Iteration (Repetition): Repeating a set of instructions a certain number of times or until a condition is met (e.g., using loops like FOR or WHILE).
Example: Algorithmic thinking for a chess AI
- List all possible legal moves for the current board state.
- For each possible move, evaluate its outcome (e.g., how good is the resulting board position?).
- Select the move that leads to the best evaluated outcome.
- Make that move.
- Repeat for the next turn.
Task 3.1: Order the Algorithm - Making Toast (Max 3 points)
Drag the steps into the correct logical order to make toast.
Algorithm Steps (Drag these)
Making Toast - Algorithm:
Real-World Computational Thinking
Computational Thinking isn't just for programmers! These skills are valuable in many fields and everyday situations:
- Scientists: Decompose complex experiments into manageable steps, abstract data to find patterns, and develop algorithms for analysis.
- Doctors: Use decomposition to diagnose illnesses by considering different systems of the body. They abstract symptoms to identify underlying causes and follow algorithmic diagnostic procedures.
- Chefs: Decompose recipes into steps (algorithmic thinking). They abstract ingredients (e.g., "a pinch of salt" rather than an exact gram measurement for home cooking) and might abstract techniques (e.g., "sauté" implies a set of hidden detailed actions).
- Project Managers: Decompose large projects into tasks, abstract key milestones, and create timelines (algorithms) for completion.
- Everyday Problem Solving: Planning a journey (decomposition, abstraction of map details, algorithmic route planning), organizing your study schedule, or even tidying your room can benefit from CT principles.
Computational Thinking Myth Busters!
Myth 1: "Computational Thinking is only for people who want to be programmers."
Reality: While CT is fundamental to programming, its principles (abstraction, decomposition, algorithmic thinking) are powerful problem-solving tools applicable across many disciplines and in everyday life, as seen in the real-world examples.
Myth 2: "Abstraction means making things vague or less precise."
Reality: Good abstraction isn't about being vague; it's about being precise about what's important for a particular purpose and deliberately ignoring what's not. It's about managing complexity by focusing on the relevant level of detail. A well-abstracted model is clear and useful, not fuzzy.
Myth 3: "Decomposition means you have to break a problem down into the tiniest possible pieces."
Reality: Decomposition is about breaking a problem into *manageable* sub-problems. The appropriate level of decomposition depends on the complexity of the problem and the context. Breaking it down too far can sometimes create more work than necessary if the sub-problems become trivial or too numerous to coordinate effectively.
Task 4: Exam Practice Questions
Apply your knowledge to these exam-style questions.
1. Define abstraction in the context of computational thinking. Give one example of abstraction in everyday life (not computing related). [3 marks]
Mark Scheme:
- Definition: Removing/hiding unnecessary detail (1) and focusing on the important details/essentials to solve a problem / simplify complexity (1).
- Everyday Example: A map (hides terrain details, shows roads/landmarks) / A car dashboard (hides engine mechanics, shows speed/fuel) / A recipe (hides chemical reactions, shows ingredients/steps). (1 mark for a suitable example with brief explanation of what's hidden/focused on).
2. A team is developing a new video game. Explain how decomposition would be used in this project and state two benefits of using decomposition. [4 marks]
Mark Scheme:
- How used: The overall game development would be broken down into smaller, manageable modules/parts (1). Examples: graphics engine, physics engine, character design, level design, sound design, user interface, AI for opponents (1 mark for specific examples of game components).
- Benefit 1: Makes the complex problem of game development easier to solve/manage (1). OR Different teams/people can work on different parts concurrently, reducing development time (1).
- Benefit 2: Modules can be tested independently, making debugging easier (1). OR Components can be reused in other games or projects (1). OR Easier to maintain/update specific parts (1).
Key Takeaways
- Computational Thinking (CT)A problem solving process using abstraction, decomposition and algorithmic thinking. Results in an algorithm we can code for a computer. is a problem-solving approach using AbstractionRemoving/hiding unnecessary detail and focusing on the important details that are necessary to solve a problem. Simplifies the problem and reduces complexity making it easier to solve/understand., DecompositionBreaking a problem down into smaller steps in order to solve it. A CT skill., and Algorithmic ThinkingDefining the steps needed to solve a problem using sequence, selection and iteration. A CT skill..
- Abstraction involves hiding unnecessary details to focus on essentials, simplifying complexity.
- Decomposition means breaking complex problems into smaller, manageable sub-problems, making them easier to solve and manage.
- Algorithmic Thinking is about developing precise, step-by-step instructions (an algorithmA finite sequence of well-defined, computer-implementable instructions, typically to solve a class of specific problems or to perform a computation.) using sequence, selection, and iteration to solve a problem.
- These principles are used to define, refine, and ultimately solve problems, often leading to solutions that can be implemented by computers.
What's Next?
You've now learned the core principles of Computational Thinking!
The next steps in Topic 2.1 (Algorithms) involve applying these skills to specific types of algorithms:
- 2.1.2 Standard searching algorithms (Linear search, Binary search)
- 2.1.3 Standard sorting algorithms (Bubble sort, Merge sort, Insertion sort)
- Understanding how to represent algorithms (e.g., pseudocode, flowcharts).
Extension Activities
1. Levels of Abstraction in a Computer System
Computer systems themselves are built with many layers of abstraction, from the physical hardware up to the applications you use.
Research Task: Describe at least three different levels of abstraction in a typical computer system (e.g., hardware level, operating system level, application level). For each level, explain what details are hidden from the level above it.
2. Decomposing a Complex Real-World Problem
Choose a complex real-world problem (e.g., reducing traffic congestion in a city, organizing a large charity event, designing a sustainable food production system).
Task: Apply decomposition to this problem. Identify at least 5-7 major sub-problems or components that would need to be addressed to solve the overall problem.
3. Pattern Recognition - The "Fourth Pillar"?
Some models of Computational Thinking include "Pattern Recognition" as a fourth core principle alongside Abstraction, Decomposition, and Algorithmic Thinking. Pattern recognition involves finding similarities or trends within problems or data.
Research Task: What is pattern recognition in the context of CT? How might it help in solving problems or designing algorithms? Give an example.