- Home
- /
- CS Thinking
- /
- Computational Thinking
Computational Thinking
40 concepts in CS Thinking
Computational thinking is a problem-solving approach that draws on concepts fundamental to computer science but applies far beyond programming. It involves four key practices: decomposition (breaking complex problems into smaller, manageable parts), pattern recognition (identifying similarities and trends), abstraction (focusing on essential information while ignoring irrelevant details), and algorithmic thinking (designing step-by-step solutions). Students also learn how to generalize from examples, model real systems, represent information efficiently in binary, and compress data for storage and communication. These skills translate directly into writing code, but they also strengthen reasoning in mathematics, science, and everyday decision-making. As technology becomes central to nearly every career, computational thinking provides students with a versatile intellectual toolkit for understanding and shaping the digital world around them.
Suggested learning path: Start with decomposition, pattern recognition, and generalization using concrete, unplugged activities, then introduce abstraction, algorithmic design, and debugging, and finally apply these skills to data representation, simulation, recursion, and efficient problem solving.
Algorithm
A step-by-step set of instructions for solving a problem or accomplishing a specific task. An algorithm must be precise (every step is unambiguous), finite (it terminates after a bounded number of steps), and effective (each step can actually be carried out).
Decomposition
Breaking a complex problem into smaller, independently-solvable parts that combine into a complete solution.
Pattern Recognition
Pattern recognition is the process of identifying similarities, trends, or regularities across data or problems in order to build general solutions. By spotting what is the same across different cases, you can create reusable strategies instead of solving each case from scratch.
Abstraction
Focusing only on the essential information needed to solve a problem while ignoring irrelevant details. Abstraction reduces complexity by creating simplified models that capture what matters and hide what does not, enabling reasoning at higher levels.
Sequence
Executing a series of instructions one after another in a fixed, specific order. In sequential execution, each instruction must complete before the next one begins, and the order in which statements appear determines the order in which they run.
Selection
Choosing which block of code to execute based on whether a condition is true or false. Selection allows programs to make decisions, following one path when a condition holds and a different path otherwise, using constructs like if, else-if, and else.
Iteration
Repeating a block of instructions multiple times until a stopping condition is satisfied. Iteration is one of the three fundamental control structures (along with sequence and selection) and is implemented through while loops, for loops, and other looping constructs.
Variable
A named container in a program that stores a value, which can be read, updated, or replaced. Variables have a name (identifier), a value (the data stored), and in many languages a type (what kind of data it holds).
Data Types
Categories that classify data values and determine which operations can validly be performed on them. Common data types include integers, floating-point numbers, strings, booleans, and arrays, each with its own set of permitted operations.
Boolean Logic
A system of logic that works with only two possible values—true and false—combined using the operators AND, OR, and NOT. Boolean logic provides the mathematical foundation for all decision-making in computing, from simple if-statements to complex database queries and digital circuit design.
Function (Programming)
A named, reusable block of code that performs a specific task, taking input (parameters) and optionally returning output (a return value). Functions allow you to write a piece of logic once and use it many times throughout a program.
Parameters
Named values declared in a function definition that act as placeholders for the actual data (arguments) passed in when the function is called. Parameters allow the same function to operate on different data each time it is invoked.
Array
An ordered collection of values stored together under a single name and accessed by their numeric index position. Arrays allow you to store, retrieve, and manipulate multiple related values efficiently using loops and index-based access.
Debugging
The systematic process of finding, diagnosing, and correcting errors (bugs) in a program. Debugging involves reproducing the problem, isolating its cause through testing and inspection, applying a targeted fix, and verifying the fix resolves the issue without introducing new problems.
Input/Output
The mechanisms by which a program receives data from the outside world (input) and sends results back (output). Input can come from keyboards, files, sensors, or network connections; output can go to screens, files, printers, or other devices.
Binary
Binary is a base-2 number system that uses only two digits, 0 and 1, to represent all values. Each digit position represents a power of 2, and computers use binary because electronic circuits have exactly two states: on and off.
Bits and Bytes
A bit is a single binary digit (0 or 1), the smallest unit of digital data. A byte is a group of 8 bits that can represent 256 different values (0 to 255), enough to encode one text character. All digital storage and communication is measured in bits and bytes.
Recursion
A technique where a function calls itself to solve progressively smaller instances of the same problem. Every recursive solution has two parts: a base case that stops the recursion, and a recursive case that breaks the problem into a smaller version of itself.
Algorithm Efficiency
The ratio of useful output energy (or power) to total input energy, expressed as a percentage — always less than 100% due to energy losses.
Searching
The process of locating a specific item or value within a collection of data using a systematic strategy. The two fundamental approaches are linear search (check every element one by one) and binary search (repeatedly halve the search space in sorted data).
Sorting
Rearranging items in a collection into a defined order, such as smallest to largest or alphabetical. Sorting is one of the most studied problems in computer science, with algorithms ranging from simple (bubble sort, $O(n^2)$) to efficient (merge sort, $O(n \log n)$).
Event
A detectable action or occurrence in a program—such as a user click, key press, mouse movement, or timer expiry—that the program can respond to by executing a predefined event handler function.
Data Representation
The way information—numbers, text, images, and sound—is encoded as binary digits (0s and 1s) inside a computer. Different encoding schemes map real-world data to binary patterns, such as ASCII/Unicode for text, RGB for colors, and sampling for audio.
Simulation
Using a computer program to model and experiment with a real-world system or process. Simulations represent key variables and their relationships mathematically, allowing you to test scenarios, make predictions, and explore outcomes without real-world cost or risk.
Testing
Systematically running a program with known inputs to verify that its outputs are correct. Testing involves designing test cases that cover normal inputs, boundary values, and error conditions, then comparing actual results against expected results.
Modular Design
Modular design is the practice of structuring a program as a set of independent, self-contained modules, each responsible for a single, well-defined task. Modules communicate through clear interfaces, making the system easier to build, test, debug, and maintain.
Binary Search
An efficient algorithm for finding a target value in a sorted list by repeatedly halving the search range. At each step, compare the target to the middle element: if equal, the search is done; if smaller, search the left half; if larger, search the right half.
Linear Search
A search algorithm that checks each element in a list one by one, starting from the first, until the target is found or the entire list has been examined. It is the simplest search algorithm and works on both sorted and unsorted data.
Merge Sort
A divide-and-conquer sorting algorithm that splits a list in half, recursively sorts each half, then merges the two sorted halves back together in order. The key insight is that merging two already-sorted lists into one sorted list is efficient and straightforward.
Bubble Sort
A simple sorting algorithm that repeatedly walks through the list, compares each pair of adjacent elements, and swaps them if they are in the wrong order. This process repeats until no more swaps are needed, meaning the list is fully sorted.
Generalization
Generalization is the process of taking a pattern that appears in several examples and turning it into a rule or method that works in many cases. In computational thinking, it helps students move from one solved example to a reusable strategy.
Divide and Conquer
Divide and conquer is an algorithmic strategy that splits a problem into smaller subproblems of the same kind, solves those smaller problems, and then combines their solutions into one final answer. It is a structured form of decomposition often paired with recursion.
Error Types
Error types are the main categories of mistakes that can occur in a program. The most common categories are syntax errors (the code is written incorrectly), runtime errors (the program crashes while running), and logic errors (the program runs but gives the wrong answer).
Image Representation
Image representation is the way a computer stores a picture as numeric data. Most digital images are made of pixels arranged in a grid, where each pixel stores color information such as red, green, and blue values.
Audio Representation
Audio representation is the way a computer stores sound as numeric data. Digital audio is usually created by sampling a sound wave many times each second and storing each sample with a certain number of bits.
Random Numbers
Random numbers are values chosen without a predictable pattern, or in computing, values that imitate that behavior closely enough for practical use. Computers often generate pseudo-random numbers using algorithms that look random even though they are created deterministically.
Modeling
Modeling is the process of building a simplified representation of a real system so you can study, predict, or explain its behavior. A model keeps the details that matter for the question and leaves out details that do not.
Data Compression
Data compression is the process of reducing the number of bits needed to store or transmit information. Some compression is lossless, meaning the original data can be recovered exactly, while some is lossy, meaning some detail is discarded to save more space.
Logical Operators
Operators that combine or modify boolean expressions: AND (true only when both operands are true), OR (true when at least one operand is true), and NOT (reverses a boolean value from true to false or vice versa).
Truth Tables
A table listing every combination of boolean inputs and the resulting output for a logical expression.