DAA Study Hub

My mistakes

Classic beginner traps, and where to log your own mistakes.

Every mistake you make in a drill or mock paper belongs in your own mistakes log on My progress, with the fix. It's saved in your browser. Before the midterm, reread it and redo every row.

Classic beginner traps (watch for these)

These are common errors. If you make one, add it to your mistakes log on My progress.

  • Writing log⁡(a+b)=log⁡a+log⁡b\log(a+b) = \log a + \log b. Wrong: the product rule is log⁡(ab)=log⁡a+log⁡b\log(ab) = \log a + \log b.
  • Counting a for i = 1 to n loop header as nn checks. It runs n+1n+1 times (the last check fails).
  • Choosing n0n_0 before cc in a Big-O proof and then contradicting myself. Pick cc, then the n0n_0 that makes it work.
  • In induction, assuming the statement for nn and calling that the proof. You assume n−1n-1 (or kk) and prove nn (or k+1k+1).
  • Loop invariant that is true but useless at termination. It must say something that gives the answer when the loop stops.
  • Recursion tree: forgetting the leaf level or getting the number of levels wrong. For halving, it's log⁡2n+1\log_2 n + 1 levels.

On this page