Common Mistakes in Computational Thinking

The computational thinking mistakes students make most often are writing algorithm steps too vague to follow, writing recursion without a base case it can reach, and reading binary place values from the wrong end (the rightmost bit is worth 1). Below are 21 common mistakes grouped by topic, each with how to fix it.

Algorithm

  1. Writing steps that are too vague for a computer to follow

    Replace words like "sort it" or "fix it" with exact actions the machine can perform.

  2. Testing the procedure on only one easy example

    Trace the algorithm with several inputs, including unusual or boundary cases, before assuming it is correct.

  3. Forgetting to define the input and output clearly

    Start by naming what goes into the algorithm and what result should come out.

  4. Ignoring what should happen when the input is empty or invalid

    Good algorithms describe how to handle special cases, not just the normal path.

  5. Confusing a single example with a general method

    An algorithm must work for every valid input in its domain, not just one sample case.

Algorithm mistakes in detail

Binary

  1. Assigning powers of 2 from left to right instead of from the rightmost digit

    The rightmost bit is worth 2⁰ = 1, and the values double as you move left.

  2. Forgetting that 1 + 1 in binary equals 10

    Binary uses base 2, so two ones make one group of two and carry into the next place.

  3. Mixing up bits and bytes during conversions

    A bit is one binary digit; a byte is a group of 8 bits.

  4. Treating binary as if it used powers of 10

    Decimal place values are 1, 10, 100. Binary place values are 1, 2, 4, 8, 16, and so on.

  5. Converting without checking whether the answer is reasonable

    Estimate first. For example, binary 10000000 should be much larger than binary 00000001.

Binary mistakes in detail

Debugging

  1. Changing many lines at once without isolating the cause

    Make one small change, rerun the failing case, and watch what changed.

  2. Fixing the visible symptom instead of the root cause

    Trace backward from the wrong output to the first place the data becomes wrong.

  3. Skipping the step of reproducing the bug reliably

    Before you debug, make sure you know exactly which input or action causes the problem.

  4. Assuming the code is correct because it runs

    Logic errors often produce wrong answers without crashing, so compare actual output with expected output.

  5. Not testing the fix with edge cases after the bug seems gone

    A patch is not finished until you check that it solves the original bug and does not create a new one.

Debugging mistakes in detail

Recursion

  1. Leaving out the base case

    Every recursive function needs a case it answers directly. For factorial, return 1 when n is 0; returning 0 there makes every result 0, and leaving it out recurses until the stack overflows.

  2. Writing a base case the calls never reach

    Check that every call moves toward the base case for every allowed input. If fact(n) stops only at n = 0, then fact(−1) counts down past 0 without ever reaching it, so reject negative input.

  3. Making a recursive call that does not shrink the problem

    Each call must work on a smaller input, such as n − 1 or half the list. sum(list) should call sum on the list without its first item; calling sum(list) again never gets closer to the base case.

  4. Confusing recursion with iteration

    A loop repeats steps inside one call; recursion solves a smaller copy of the problem and builds on its answer. Since n! = n × (n − 1)!, fact(n) returns n × fact(n − 1).

  5. Forgetting stack growth

    Each call waits on the call stack until the calls below it return, so fact(10000) holds 10,000 frames at once and can overflow. For very deep inputs, use a loop instead.

  6. Assuming recursion is "magic"

    Trace a small case by hand: fact(3) = 3 × fact(2) = 3 × 2 × fact(1) = 3 × 2 × 1 × fact(0) = 6. Trust the pattern once the base case and the smaller step are both correct.

Recursion mistakes in detail

Mistakes From Every Lesson, by Topic

Every computational thinking lesson lists the mistakes students make with that idea. These pages collect them by topic, each linked to the lesson that explains the right idea.

Why These Mistakes Happen

Computational thinking errors usually come from solving the surface problem instead of the underlying structure: confusing one example with an algorithm, skipping decomposition, or taking a pattern noticed once for a rule that always holds. The fixes below build the general habit rather than patching one case.