🧠 Week 1: Introduction to Computational Thinking

Week 1 Computational Thinking 📅 Qualifier

1.1 What is Computational Thinking? 🤔

Computational thinking is a problem-solving process that includes decomposition, pattern recognition, abstraction, and algorithms. It's a way of thinking about problems that allows us to use computers and other tools to help solve them.

💡 Key Definition

Computational Thinking: A problem-solving methodology that breaks down complex problems into manageable parts and creates step-by-step solutions that can be implemented by computers or humans.

The Four Pillars of Computational Thinking

🧩

Decomposition

Breaking down complex problems into smaller, more manageable sub-problems.

Example: Planning a trip → Choose destination, book flights, find accommodation, plan activities
🔍

Pattern Recognition

Identifying similarities and patterns within and between problems.

Example: Recognizing that sorting algorithms follow similar comparison patterns
🎭

Abstraction

Focusing on essential features while ignoring irrelevant details.

Example: A map abstracts roads and landmarks, ignoring building details
âš™ī¸

Algorithms

Creating step-by-step instructions to solve problems.

Example: Recipe instructions: 1. Heat oil, 2. Add ingredients, 3. Cook for 10 minutes

1.2 Problem Solving Strategies đŸŽ¯

Effective problem-solving requires systematic approaches and methodologies.

The Problem-Solving Process

1

Understand the Problem

  • Read the problem carefully
  • Identify what you know
  • Identify what you need to find
  • Clarify any ambiguities
→
2

Plan Your Approach

  • Break down the problem
  • Choose appropriate strategies
  • Consider similar problems
  • Estimate the solution
→
3

Implement the Solution

  • Follow your plan
  • Work step by step
  • Keep track of progress
  • Be flexible if needed
→
4

Review and Reflect

  • Check your solution
  • Verify it makes sense
  • Consider improvements
  • Learn for next time

Common Problem-Solving Strategies

🔄 Trial and Error

Testing different solutions until finding one that works.

✅ Simple to implement
❌ Can be time-consuming

📋 Make a List

Systematically listing all possibilities or options.

✅ Comprehensive approach
❌ May be overwhelming for large problems

🎨 Draw a Picture

Creating visual representations to understand the problem better.

✅ Makes complex problems clearer
❌ Not suitable for all problem types

🔙 Work Backwards

Starting from the desired outcome and working towards the beginning.

✅ Efficient for goal-oriented problems
❌ Requires clear end goal

1.3 Algorithms & Pseudocode 📝

Algorithms are step-by-step procedures for solving problems, and pseudocode is a way to describe algorithms using natural language.

What is an Algorithm?

đŸŽ¯ Clear and Unambiguous

Each step must be precisely defined with no room for interpretation.

đŸ“Ĩ Well-defined Inputs

The algorithm should specify what inputs it requires.

📤 Well-defined Outputs

The algorithm should specify what outputs it produces.

âšī¸ Finite

The algorithm must terminate after a finite number of steps.

✅ Effective

Each step must be simple enough to be carried out exactly.

Writing Pseudocode

Example: Finding the Maximum Number in a List

ALGORITHM FindMaximum
INPUT: A list of numbers called "numbers"
OUTPUT: The largest number in the list

STEPS:
1. SET max = first number in the list
2. FOR each number in the remaining list:
   a. IF current number > max THEN
      i. SET max = current number
   b. END IF
3. END FOR
4. RETURN max

END ALGORITHM
                        

Algorithm Examples

🏠 Algorithm: Getting Ready for School

  1. Wake up
  2. Take a shower
  3. Brush teeth
  4. Get dressed
  5. Eat breakfast
  6. Pack backpack
  7. Leave for school

🧮 Algorithm: Adding Two Numbers

1. INPUT number1
2. INPUT number2  
3. SET sum = number1 + number2
4. OUTPUT sum
                            

🔍 Algorithm: Linear Search

1. INPUT list and target
2. FOR each item in list:
   a. IF item equals target:
      i. RETURN position
3. RETURN "not found"
                            

đŸƒâ€â™‚ī¸ Practice Problems

Problem 1: Decomposition Practice

Break down the problem "Organizing a birthday party" into smaller sub-problems.

Problem 2: Write Pseudocode

Write pseudocode for an algorithm that determines if a number is even or odd.

Problem 3: Pattern Recognition

Identify the pattern in this sequence: 2, 4, 8, 16, 32, ?