What is computational Thinking?
Computational Thinking is a systematic approach to problem-solving that allows
individuals to break down complex problems into smaller, more manageable parts. It
involves using logical reasoning, analytical skills, and structured methods to devise effective
solutions. Computational thinking is not limited to computer science; it is a universal skill
that can be applied in everyday life, education, engineering, and business. The main
components of computational thinking include decomposition, pattern recognition,
abstraction, and algorithm design.
Pillars of Computational Thinking
• Decomposition – Decomposition is the process of breaking a complex problem or
system into smaller, more manageable parts. By dividing a problem into simpler
components, it becomes easier to understand, analyze, and solve. For example,
when planning a school event, tasks like invitations, decorations, food
arrangements, and games can be handled separately, making the overall process
more organized and efficient.
• Pattern Recognition – Pattern recognition involves identifying similarities, trends,
or repeated elements within a problem. Recognizing these patterns helps in
predicting outcomes and simplifying solutions. For instance, in mathematics or
coding, noticing a repeating sequence can help in forming formulas or loops that
save time and effort.
• Abstraction – Abstraction focuses on extracting only the relevant information from a
problem while ignoring unnecessary details. This allows for a clear and simplified
view of the problem, making it easier to develop solutions. For example, when
designing a navigation app, only essential data like routes, distances, and traffic
information are considered, while unrelated details are ignored.
• Algorithm Design – Algorithm design is the process of creating a step-by-step
procedure or set of instructions to solve a problem efficiently. Algorithms are the
backbone of computational thinking and programming, providing a clear path from
problem to solution. For example, a recipe for baking a cake is an algorithm: it
specifies each step in order to achieve the desired outcome
Example: Developing a To-Do List Application
• Decomposition: Break the application development into smaller tasks such as
designing the user interface, creating a database to store tasks, implementing
add/edit/delete task functionality, and setting reminders. Each part can be worked
on separately.
• Pattern Recognition: Identify common features in similar apps, like task
categorization, deadlines, or notifications. Recognizing these patterns helps in
reusing code or designing standard modules efficiently.
• Abstraction: Focus on the essential functionalities that the app must have, such as
storing tasks, marking them complete, and notifying users. Ignore unnecessary
details like background colors or extra animations initially to simplify development.
• Algorithm Design: Create step-by-step procedures for key functions. For example:
Adding a task: Input task details → Store in database → Update task list on screen →
Set reminder if needed.
Deleting a task: Select task → Remove from database → Update display.
How computational thinking is used?
Computational Thinking (CT) is used in various fields to solve problems systematically and
efficiently by applying logical, structured, and algorithmic approaches. It is not limited to
computer science; its principles can be applied in daily life, education, business, and
technology.
1).In Programming and Software Development: CT helps programmers break complex
coding problems into smaller tasks (decomposition), recognize recurring patterns in code
(pattern recognition), focus on essential features (abstraction), and create step-by-step
algorithms to solve problems efficiently.
2).In Data Analysis and Decision Making: Analysts use CT to organize large datasets, identify
trends, focus on relevant information, and design processes to derive meaningful insights
and predictions.
3).In Education: Teachers use CT to help students approach problems logically, develop
algorithms for projects, and improve problem-solving skills through structured thinking
exercises.
4).In Everyday Life: CT is applied in tasks like planning a trip, managing finances, or
organizing events. By decomposing tasks, recognizing patterns, focusing on key
information, and designing step-by-step plans, people can solve real-life problems
efficiently.
5).In Artificial Intelligence and Robotics: CT is essential for designing AI systems and robots
that can process information, make decisions, and perform tasks autonomously by applying
algorithms and logical reasoning.
Information and data
Data refers to raw, unprocessed facts and figures without any context. It can be numbers,
text, images, symbols, or any form of input that has not yet been organized or interpreted.
For example, a list of numbers like 45, 78, 92 is just data. Data on its own does not convey
meaning until it is processed or analyzed.
Information, on the other hand, is processed, organized, or structured data that carries
meaning and is useful for decision-making. When data is analyzed and interpreted in a
specific context, it becomes information. For example, if the data 45, 78, 92 represents
student marks, and you calculate the average, the result gives meaningful insight — that is
information.
Converting Information into Data
• Identify the information you want to convert – Recognize the meaningful content
that needs to be stored or processed. This could be anything like a student’s grade, a
color, a sound, or a date. Understanding exactly what you need to store is the first
step.
• Break the information into smaller, measurable components – Divide the
information into simpler, discrete pieces that can be handled separately. For
example, “Swati scored 85 in Mathematics” can be split into Name, Subject, and
Score.
• Decide the appropriate data type for each component – Determine how each piece
of information will be stored so that the computer can process it correctly. Numbers,
text, colors, pictures, and sounds are common data types.
• Convert each component into a computer-readable format or code – Transform the
information into a format the computer can understand. For instance, text can be
stored as ASCII codes, colors as RGB or HEX codes, numbers in numeric formats, and
sound or images in binary files.
• Store the data in a structured format – Organize the converted data into databases,
tables, spreadsheets, or files so that it can be accessed, processed, or analyzed
efficiently. Proper structure ensures accuracy, quick retrieval, and usability.
Examples:
i).Information: “Aarti scored 92 in Science”
Data: Name → “Aarti” (text), Subject → “Science” (text), Score → 92 (number)
ii).Information: “The traffic light is green”
Data: Color → “Green” (text) or #00FF00 (HEX code)
iii).Information: “Today’s temperature is 36°C”
Data: Temperature → 36 (number), Unit → “°C” (text)
Iv).Information: “Song ‘Shape of You’ is playing”
Data: Audio → shape_of_you.mp3 (binary data/file)
v).Information: “Student attendance: Present”
Data: Attendance → “Present” (text) or True (Boolean)
Datatypes
A data type is a classification that specifies which kind of value a variable can hold and what
operations can be performed on it. In computing, data types help the system understand
how to store, process, and display data. They ensure that the right type of data is used for
the right kind of task, such as performing arithmetic on numbers, concatenating text, or
playing sound files. Commonly, data types include numbers, text, colors, pictures, and
sound.
1.Numbers
Numbers are data types used to represent numeric values. They can be whole numbers
(integers) or fractional numbers (floating-point). Numbers are used for mathematical
calculations, measurements, and statistical analysis. For example, a variable storing a
person’s age or a product’s price would use a numeric data type.
2. Text
Text, also known as a string, is a data type used to represent sequences of characters. It can
include letters, numbers, spaces, and symbols. Text is often used for names, addresses,
messages, and descriptions. For example, a username in an application or the content of an
email would be stored as text.
3. Colors
Colors are data types that represent different shades and hues, usually stored in digital
systems as combinations of values. Common representations include RGB (Red, Green,
Blue), HEX codes, or HSL values. Colors are widely used in designing websites, apps, and
images, enabling visually appealing presentations.
4. Pictures
Pictures are data types that store graphical or photographic information. They can be in
different formats such as JPEG, PNG, or GIF. Pictures are used in everything from social
media to medical imaging, and they are stored as a collection of pixels, each with specific
color information.
5. Sound
Sound data types represent audio information. They can be stored in formats like MP3,
WAV, or AAC. Sounds can be speech, music, or any kind of audio signal. In applications,
sound data is used for notifications, music playback, voice recordings, and multimedia
content.
Classic Puzzle Solving
Classic Puzzle Solving refers to the process of solving problems or puzzles that are well
known, logical, and have been studied or used for a long time. These puzzles are often seen
in mathematics, computer science, and logical reasoning exercises. They are designed to
enhance problem-solving skills, critical thinking, and creativity. The solutions to classic
puzzles usually require a systematic approach, where the problem is broken down into
smaller, manageable steps.
One of the main features of classic puzzles is that they have a clear and concise problem
statement. They also have specific constraints or rules that must be followed to arrive at the
solution. The process of solving them is often language-independent, meaning they can be
explained using plain English, diagrams, pseudocode, or flowcharts. These puzzles are
excellent tools for learning algorithm design because many of them can be directly
implemented as computer programs.
Characteristics of Classic Puzzle Solving
1.Known Structure
Classic puzzles usually follow a standard and recognizable format. Examples like the Tower
of Hanoi or Sudoku have fixed rules, patterns, and objectives. This structure allows solvers
to apply tested strategies while still using creativity to find solutions.
2.Requires Logical Thinking
These puzzles are based on logic and reasoning rather than guessing. To solve them, you
must think critically, analyze the given information, and deduce the correct steps that follow
the puzzle’s rules.
3.Step-by-Step Approach
Solving a classic puzzle often involves breaking it into smaller, more manageable parts. Each
step brings you closer to the solution, and skipping steps usually leads to errors. This
sequential thinking is also a core concept in programming and problem-solving.
4.Language-Independent
The solution to a classic puzzle can be expressed in plain language, diagrams, pseudocode,
or flowcharts. It is not tied to any specific programming language, which makes it easy to
share and understand globally.
5.Helps in Algorithm Learning
Many classic puzzles can be directly converted into computer algorithms. For example, the
Tower of Hanoi can be represented using recursion, and the N-Queens problem can be
solved using backtracking. This makes them valuable for learning programming concepts
and algorithm design.
6.Clear Problem Statement and Rules
A classic puzzle always comes with a clearly defined goal and a set of rules. These
constraints guide the solver and ensure there’s a specific path or set of valid solutions.
7.Encourages Patience and Strategy
Since they require logical steps and adherence to rules, classic puzzles improve patience
and strategic planning. Solvers often need to think several moves ahead to avoid mistakes.
Some classic Puzzle solving problems are:
1.Tower of Hanoi
Problem Statement: You have three rods and n disks of different sizes stacked on one rod in
decreasing order (largest at the bottom, smallest at the top). The goal is to move all disks
from the source rod to the destination rod using an auxiliary rod.
Rules:
i).Only one disk can be moved at a time.
ii).A larger disk cannot be placed on top of a smaller disk.
All disks must be moved following these rules.
• Concept Used: Recursion.
• Application: Teaches recursive thinking, problem decomposition.
2.N-Queens Problem
Problem Statement: Place n queens on an n×n chessboard so that no two queens attack each
other.
Rules: A queen can attack another if they are in the same row, column, or diagonal.
• Concept Used: Backtracking algorithm.
• Application: Solving constraint satisfaction problems, AI search problems.
3.Water Jug Problem
Problem Statement: Given two jugs with different capacities, measure a specific amount of
water using them.
Example: Jug A = 4 liters, Jug B = 3 liters, Goal = 2 liters in Jug A.
Rules:
i).You can fill, empty, or pour from one jug to another.
ii).No measuring scale is available.
• Concept Used: State space search (BFS/DFS).
• Application: Teaches state representation and systematic search.
4.Sudoku
Problem Statement: Fill a 9×9 grid so each row, column, and each of the nine 3×3 subgrids
contain all numbers from 1 to 9 without repetition.
Rules:
i).No duplicate numbers in any row, column, or 3×3 box.
ii).Some cells are pre-filled as clues.
• Concept Used: Constraint satisfaction, backtracking.
• Application: Logical reasoning, AI constraint-solving algorithms.
5. Magic Square Problem
Problem Statement: Fill an n×n square with distinct numbers from 1 to n² so that the sum of
every row, column, and diagonal is the same.
Rules: No repeated numbers, sum must be constant in all rows, columns, and diagonals.
Concept Used: Mathematical patterns, backtracking.
Application: Number theory, combinatorics
General Problem Solving Technique: General problem solving is the process of
identifying a problem, analyzing it, and applying a systematic approach to find an effective
solution. It is not limited to any particular subject or domain — instead, it is a universal skill that
can be applied in daily life, education, technology, business, and more.
The goal is to move from the current state (problem) to the desired state (solution) efficiently
and logically
Steps in General Problem Solving
1.Understanding the Problem – Clearly define the problem and know what is required.
2.Gathering Information – Collect relevant facts, data, and constraints.
3.Analyzing the Problem – Break the problem into smaller parts and study the relationships
between them.
4.Generating Possible Solutions – Think of multiple ways to solve the problem.
5.Selecting the Best Solution – Evaluate each idea based on feasibility, cost, and effectiveness.
6.Implementing the Solution – Apply the chosen solution in practice.
7.Reviewing the Result – Check whether the problem has been solved and make adjustments if
necessary.
Techniques of General Problem Solving
1.Divide and Conquer – Breaks a problem into smaller independent subproblems, solves them
individually, and then combines their results. Examples include Merge Sort and Quick Sort.
2. Greedy Method – Builds a solution step by step by choosing the option that looks best at the
moment, aiming for an optimal result. Example: Huffman coding.
3. Trial and Error – Repeatedly tries different solutions until one works, without a guaranteed
efficient method; works for small or simple problems.
4.Brute Force – This method tries all possible solutions one by one until the correct answer is
found. It is simple but often inefficient for large problems.
5. Backtracking – This technique builds a solution step by step and abandons it (“backtracks”) if
it leads to an invalid or undesirable result, useful in puzzles like N-Queen.
6.Dynamic Programming – This method solves complex problems by breaking them into smaller
overlapping subproblems, storing their results to avoid repeated computation.
Pseudocode
A pseudocode is a simple, informal way of writing algorithms that uses plain language and
basic programming-like structures to describe the steps needed to solve a problem.
It’s not actual code that a computer can run, but rather a blueprint for writing a program. It
helps you focus on logic without worrying about the syntax of a programming language.
Steps to write a pseudocode :
1.Understand the Problem
i.Read the problem statement carefully.
ii.Identify inputs, processing steps, and outputs.
2.Define the Inputs and Outputs
i.Decide what data you need from the user (input).
ii.Decide what result you want to display (output).
3.Break the Problem into Steps
i.Think of the solution in small, logical steps.
ii.Arrange them in the order they should happen.
4. Use Structured Keywords
Common keywords:
• START, END
• INPUT, OUTPUT or PRINT
• IF, ELSE, ENDIF
• FOR, WHILE, REPEAT UNTIL
• SET or ASSIGN (to give values)
5.Keep It Language-Independent
i.Avoid any specific programming syntax (e.g., no semicolons, no curly braces).
ii.Use plain English and math operators (+, -, *, /, MOD).
6. Maintain Readability
i.Write one action per line.
ii.Use indentation to show loops and conditions clearly.
7. Test the Logic
i).Mentally run through your pseudocode with example inputs.
ii).Check if it gives the correct output.
Characteristics of Pseudocode
1.Simplicity
Written in plain, easy-to-understand language.
Focuses on the logic rather than syntax.
2.Language-Independent
Can be understood by programmers of any language (C, Python, Java, etc.).
3.Step-by-Step Representation
Describes the solution in a logical sequence of actions.
4.Use of Keywords
Common control keywords: START, END, IF, ELSE, FOR, WHILE, PRINT, INPUT.
5.Structured Format
Uses indentation to show loops, conditions, and blocks clearly.
6.No Strict Syntax Rules
Not bound by programming grammar, but still follows a consistent style.
7.Clarity and Readability
One action or decision per line.
Avoids unnecessary details.
8.Easily Convertible into Code
Can be directly translated into any programming language with minimal changes.
1.Print sum of two numbers
START
INPUT num1
INPUT num2
Sum = num1 + num2
PRINT “Sum =”, sum
END
2. Check if number is even or odd.
START
INPUT num
IF num MOD 2 == 0 THEN
PRINT “Even Number”
ELSE
PRINT “Odd Number”
ENDIF
END
OR
START
SET a = 5
SET b = 10
PRINT “Value of a =”, a
PRINT “Value of b =”, b
END
5. Print n odd numbers
START
INPUT n
SET count = 0
SET num = 1
WHILE count < n DO
PRINT num
Num = num + 2
Count = count + 1
ENDWHILE
END
4. Check if a Number is Prime
START
INPUT num
SET isPrime = true
IF num <= 1 THEN
SET isPrime = false
ELSE
FOR i = 2 TO num - 1 DO
IF num MOD i == 0 THEN
SET isPrime = false
BREAK
ENDIF
ENDFOR
ENDIF
IF isPrime == true THEN
PRINT "Prime Number"
ELSE
PRINT "Not Prime Number"
ENDIF
END
5. Factorial of a Number
START
INPUT num
SET fact = 1
IF num < 0 THEN
PRINT "Factorial not defined for negative numbers"
ELSE
FOR i = 1 TO num DO
fact = fact * i
ENDFOR
PRINT "Factorial =", fact
ENDIF
END
6. Print First N Natural Numbers
START
INPUT n
FOR i = 1 TO n DO
PRINT i
ENDFOR
END
7. Area of Various Shapes
START
PRINT "Choose shape to find area:"
PRINT "1. Circle"
PRINT "2. Rectangle"
PRINT "3. Square"
PRINT "4. Triangle"
INPUT choice
IF choice == 1 THEN
INPUT radius
area = 3.14 * radius * radius
PRINT "Area of Circle =", area
ELSE IF choice == 2 THEN
INPUT length
INPUT breadth
area = length * breadth
PRINT "Area of Rectangle =", area
ELSE IF choice == 3 THEN
INPUT side
area = side * side
PRINT "Area of Square =", area
ELSE IF choice == 4 THEN
INPUT base
INPUT height
area = 0.5 * base * height
PRINT "Area of Triangle =", area
ELSE
PRINT "Invalid Choice"
ENDIF
END