← Semester 2

IT · Sem 2 · Chapter 1

Done
IT · Semester 2 · Chapter 1 · Grade 8 (M.2)

Computational Thinking 🧩

Four habits of mind for breaking big, messy problems down into something a computer — or a person — can actually solve.

🕶️ with Guru Jazzy

🎯 What you'll unlock this lesson

  • Explain each of the four pillars of computational thinking
  • Recognize which pillar is being used in a real scenario
  • Apply all four together to plan a solution to a problem

💡 What is computational thinking?

Computational thinking isn't about computers first — it's a way of thinking about problems that happens to make them easy to hand to a computer afterward. It has four pillars, and real problem-solving usually cycles through all of them.

KEY TERM · Computational thinking — a problem-solving process built on decomposition, pattern recognition, abstraction, and algorithm design.

1.1 Decomposition

Splitting one large, overwhelming problem into several smaller sub-problems that are each easier to tackle on their own — then solving (or assigning) each piece separately.

Example: "plan a class party" breaks into food, music, decorations, and a guest list — four smaller, manageable jobs instead of one huge one.

1.2 Pattern Recognition

Spotting similarities between a new problem and one you've already solved — or between pieces of the same problem — so you can reuse a known approach instead of starting from zero.

Example: noticing that "find the tallest student" and "find the most expensive item" are really the same problem: find the maximum.

1.3 Abstraction

Keeping only the details that matter for the problem at hand and throwing away everything else. A map is a classic example — it keeps roads and landmarks, and abstracts away the exact width of every street.

Example: a train map shows stations and connections in order, not real geographic distance — that detail doesn't matter for the problem "how do I get there."

1.4 Algorithm Design

Writing the exact, ordered, step-by-step instructions that solve the problem — precise enough that someone (or something) with no judgement of their own could follow them and get the right result.

Often drawn as a flowchart before it's ever written as code.

🃏 Key-term flashcards tap to flip

🔀 Flowchart symbols 1.4

Before code, algorithms get drawn. Each shape means something specific — click each one to reveal what it's for.

📋 Worked example: checking if a number is even or odd

StepShapeInstruction
1OvalStart
2ParallelogramInput a number, N
3DiamondIs N divided by 2 with no remainder?
4aRectangleYes → Output "Even"
4bRectangleNo → Output "Odd"
5OvalEnd

Every flowchart has exactly one Start and at least one End. The diamond is the only shape with two ways out.

🧪 TASK — Design a flowchart to find the largest of three numbers

Try sketching it yourself first: Input A, B, C → compare A and B → compare the bigger of those to C → output the largest.

StepShapeInstruction
1OvalStart
2ParallelogramInput A, B, C
3DiamondIs A > B?
4RectangleYes → Max ← A · No → Max ← B
5DiamondIs C > Max?
6RectangleYes → Max ← C
7RectangleOutput Max
8OvalEnd

🎯 Case study: putting it all together 1.5

Sorting a pile of unordered exam papers into ascending score order uses all four pillars at once:

  • 🧩 Decomposition: "sort the whole pile" becomes "repeatedly find the smallest remaining paper and place it next."
  • 🔁 Pattern recognition: "find the smallest remaining" is the same small task, repeated.
  • 🎭 Abstraction: only the score matters for ordering — ignore the student's name, handwriting, or paper color.
  • 📐 Algorithm design: a precise, repeatable procedure — this is selection sort.
KEY TERM · Selection sort — repeatedly find the smallest (or largest) value in the unsorted portion of a list, and swap it into place at the front of that portion.

🎮 Interactive Selection Sort Visualizer signature move

Hit Step (or Auto-run) to watch the algorithm scan for the minimum, then swap it into place — one pass at a time.

🧮 Trace: sorting [7, 2, 9, 1, 5]

PassUnsorted portionMinimum foundSwap withResult
17 2 9 1 51 (index 3)index 0 (7)1 2 9 7 5
22 9 7 52 (already first)— (no swap)1 2 9 7 5
39 7 55 (index 4)index 2 (9)1 2 5 7 9
47 97 (already first)— (no swap)1 2 5 7 9

Once one element is left, it's automatically in place — the list is sorted.

🎉 Activity 1.1 — Plan the celebration

In groups, plan the running order for a class celebration dance. Fill out a table like this one, applying computational thinking to the planning itself:

PillarApplied to the celebration plan
DecompositionSplit into: music selection, formation blocking, costume/prop list, rehearsal schedule
Pattern recognitionReuse last year's formation pattern for the parts of the song that repeat
AbstractionFor blocking, only track each dancer's position and timing — ignore costume detail
Algorithm designWrite the exact step order: enter → formation 1 → formation 2 → exit, with counts

🧠 Mini-quiz — no cap, prove it

📝 Exam-style questions try, then peek

1 · Identify the pillar in each scenario
  • 🧩 Splitting a school project into research, writing, and slides → Decomposition
  • 🔁 Noticing two maths problems both reduce to "find the average" → Pattern recognition
  • 🎭 A subway map that ignores real distances but keeps station order → Abstraction
  • 📐 Writing precise numbered steps to check in a library book → Algorithm design
2 · Trace selection sort on [4, 1, 3]

Pass 1: minimum of [4,1,3] is 1 (index 1) → swap with index 0 → [1,4,3]

Pass 2: minimum of [4,3] is 3 (index 2) → swap with index 1 → [1,3,4]

Result: [1, 3, 4] ✅

Guru Jazzy 🕶️ · Sem 2 · Chapter 1 · Computational Thinking