P R O G R A M M I N G F U N D A M E N TA L S
INTRODUCTION TO PROBLEM SOLVING
AND COMPUTATIONAL THINKING
Lecture # 01
DEPARTMENT OF COMPUTER SCIENCE
GC UNIVERSITY, HYDERABAD
01
Introduction
02
CLASS
Problem Solving
Process
03
Computational
OUTLINE
Thinking
04
Four Pillars of
Computational
05 Thinking
Applications
06
Key Takeaways
WHAT IS
PROBLEM
SOLVING?
WHAT IS PROBLEM SOLVING?
PROBLEM SOLVING is the process of finding
solutions to difficult or complex issues through
systematic thinking and analysis.
REAL-LIFE EXAMPLE:
Imagine you want to go from your home to university:
• Problem: How to reach university?
• Solutions: Walk, bike, bus, car, ride-sharing
• Best Solution: Depends on distance, time, cost, weather
PROBLEM SOLVING STEPS
• Understand - What exactly is the problem?
• Plan - What are possible solutions?
• Execute - Implement your chosen solution
• Verify - Did it work? If not, try another approach
What is Computational Thinking?
Computational thinking means solving problems
in a structured and logical way so that a computer
(or a human) can follow the steps easily.
“It’s not about thinking like a computer; it’s about solving
problems in a way that computers can help us.”
FOUR PILLARS OF
COMPUTATIONAL THINKING
DECOMPOSITION PATTERN
(BREAKING DOWN RECOGNITION
PROBLEMS) 1 2 (FINDING SIMILARITIES)
ABSTRACTION 3 4 ALGORITHM DESIGN
(FOCUS ON (STEP-BY-STEP
IMPORTANT DETAILS) SOLUTION)
DECOMPOSITION
(Breaking Down Problems)
Dividing a large and complex problem into
smaller, manageable parts.
Real-Life Example – Making Biryani Programming Example
Big Problem: Cook biryani for 10 people
Big Problem: Create a
Smaller Tasks: student management system
• Wash and soak rice
• Marinate and cook chicken/meat Sub-tasks:
• Prepare masala and spices • Add student record
• Fry onions • Delete student record
• Layer rice and meat • Update student
• Final cooking (dum) information
• Search for a student
Why it helps: Small tasks are easier to • Display all students
manage than one big task.
PATTERN RECOGNITION
Identifying similarities or repeated patterns in problems.
(Finding Similarities)
Real-Life Example – Daily Routine
➢ Wake up → Brush → Breakfast → Commute → Study/Work
➢ This routine repeats every day
➢ Once recognized, it can be optimized
Programming Example
Finding a maximum value:
➢ Highest marks in a class
➢ Maximum temperature in a week
➢ Most expensive item in a list
Common Pattern:
➢ Compare each value with the current maximum
➢ Update if a larger value is found
ABSTRACTION
(FOCUS ON IMPORTANT DETAILS)
Ignoring unnecessary details and focusing
only on what is important.
Real-Life Example – Using an ATM
What you need to know:
➢ Insert card
➢ Enter PIN
➢ Select amount
➢ Take cash
Programming Example
What you don’t need to know: cout<<"Hello World”
➢ Internal machine working ➢ You only need to know that it
➢ Banking network communication prints text
➢ Programming language of the ATM ➢ Internal working is hidden
ALGORITHM DESIGN
Creating a clear and logical sequence of steps to solve a problem.
(Step-by-Step Solution)
Real-Life Example – Making Tea
[Link] water
[Link] tea leaves
[Link] sugar
[Link] milk
[Link] into cup
[Link]
Programming Example – Check Even or Odd Number
[Link] a number as input
[Link] the number by 2
[Link] remainder is 0, number is even
[Link], number is odd
[Link] result
Why Learn Computational Thinking?
Benefits
➢ Better problem-solving skills
➢ Strong logical thinking
➢ Efficient and optimized solutions
➢ Improved error handling
➢ Useful in all careers (IT, business, medicine, engineering)
PREPARING FOR AN
APPLYING
EXAM
DECOMPOSITION
Step # 01 ➢ Understand syllabus
COMPUTATIONAL TH INKING
➢ Collect notes and books
➢ Create a study schedule
➢ Study each topic
➢ Practice questions
➢ Take mock tests
➢ Revise weak areas
PREPARING FOR AN
APPLYING
EXAM
PATTERN RECOGNITION
Step # 01 ➢ Similar types of questions appear repeatedly
COMPUTATIONAL TH INKING
➢ Mistakes often come from the same topics
Step # 02
PREPARING FOR AN
APPLYING
EXAM
ABSTRACTION
Step # 01 ➢ Focus on important topics, concepts, and formulas
COMPUTATIONAL TH INKING
➢ Ignore unnecessary details like page design or font
Step # 02
style
Step # 03
PREPARING FOR AN
APPLYING
EXAM
ALGORITHM DESIGN
Step # 01 1. List all topics (7 days remaining)
COMPUTATIONAL TH INKING
2. Each day:
- Study 2 topics
Step # 02
- Make short notes
- Solve 10 questions
Step # 03 - Mark difficult questions
3. Day 6: Revise notes
4. Day 7: Solve past papers
Step # 04
5. Review mistakes
CREATE A CALCULATOR
APPLICATION IN PROGRAMMING
PROGRAM
DECOMPOSITION
Step # 01 ➢ Input two numbers
➢ Select operation
➢ Perform calculation
➢ Display result
➢ Handle errors
CREATE A CALCULATOR
APPLICATION IN PROGRAMMING
PROGRAM
PATTERN RECOGNITION
Step # 01 ➢ All operations need two numbers
➢ Same input-process-output structure
Step # 02
CREATE A CALCULATOR
APPLICATION IN PROGRAMMING
PROGRAM
ABSTRACTION
Step # 01 ➢ User does not need to know internal memory or
binary calculations
Step # 02
Step # 03
CREATE A CALCULATOR
APPLICATION IN PROGRAMMING
PROGRAM
ALGORITHM DESIGN
Step # 01 1. Input first number
2. Input second number
3. Input operation (+, -, *, /)
Step # 02
4. Perform operation
5. If division and second number is 0, show error
Step # 03 6. Display result
Step # 04
Activity 2: Pattern Recognition
Identify the pattern:
➢ 2, 4, 6, 8, 10, ?, ?
➢ Monday–Work, Tuesday–Work, Wednesday–Work, Thursday–?, Friday–?
Activity 3: Algorithm Writing
Activity 1: Decomposition Problem: Make a phone call
Problem: Plan a birthday party ➢ Write step-by-step
➢ Break it into smaller tasks instructions
AC TIV I TIE S
KEY TAKEAWAYS
➢ Problem solving is a structured approach
➢ Computational thinking has four pillars:
➢ Decomposition
➢ Pattern Recognition
➢ Abstraction
➢ Algorithm Design
➢ These skills apply to programming and daily life
HOMEWORK
Choose a daily-life problem
Apply all four pillars
Write the solution in your
notebook
Be ready to discuss in class
ANY
T
HAVE YOU
QUESTION
Y
ASK FREELY