Computational Thinking
There are four fundamental concepts of computational thinking:
- Abstraction
- Algorithmic Design
- Decomposition
- Pattern Recognition
Abstraction
- Process of filtering out unnecessary details to focus only on what matters.
- Representing a problem/system with a simplified model.
- Allows generalization so the same model can apply to different situations.
- Helps ensure clarity by ignoring distractions and keeping only essential properties.
These are key questions to remember when abstracting a problem:
- What is the main goal we’re trying to achieve? (Strip the problem down to its real purpose.)
- What minimum information must we work with? (Decide which data is indispensable to begin and to finish the task.)
- What details could be removed without changing the outcome? (Spot the extras that don’t influence results.)
Abstraction is not about ignoring details, it's about identifying which details are relevant to the problem at hand.
ExampleScenario 1: School Lunch Ordering App
The school wants to build an app that predicts how many lunches the cafeteria should prepare each day.
- What is the main goal we’re trying to achieve?
- To estimate the number of meals needed so food isn’t wasted and every student gets lunch.
- What minimum information must we work with?
- The total number of students expected in school, how many usually bring lunch from home, and the cafeteria’s past sales data.
- What details could be removed without changing the outcome?
- The color of lunch trays, the type of tables in the cafeteria, or what music is played during lunchtime, none of these affect the prediction.
Scenario 2: Predicting the Winner of a Robotics Competition
A program is designed to forecast which robot will perform best in a school robotics race.
- What is the main goal we’re trying to achieve?
- To estimate which robot has the highest chance of finishing first.
- What minimum information must we work with?
- Each robot’s motor speed, battery life, weight, and history of mechanical reliability.
- What details could be removed without changing the outcome?
- Robot paint color, team T-shirt designs, or the background music at the event, none of these influence race results.
Algorithmic Design
- An algorithm = step-by-step instructions to solve a problem or achieve an outcome.
- Must be clear, precise, efficient, logical, and unambiguous.
- Algorithms can be written in code or represented in other formats.
- Flowcharts are often used to visualize how a system or solution functions.
- Breaking problems into smaller, ordered steps makes solutions easier to design and implement.
Oftentimes, explaining your algorithm step-by-step to someone else can reveal missing parts or gaps.
These are key questions to ask when designing an algorithm:
- What is the problem?
- Can I state the exact problem clearly and simply?
- What goes in and what comes out?
- What data does the algorithm need, and what outputs should it produce (and in what format)?
- What decisions or repeats are involved?
- Are there choices (branches) or loops (iterations) that need to be included?