dyslexic
edit
qrcode
+=-

Skill: Similar Problem / Fewer Variables


Critical Thinking for COS 265

What does it mean to "similar problem / fewer variables"?


This critical thinking skill is used to transform a complex problem into a similar and simpler problem that is more easily solved. An important note: while a specific solution can help with moving forward on a project, the specific solution introduces edge cases. The problem is not fully solved until a general solution to the original problem is synthesized from several specific solutions.

Another situation where this critical thinking skill can be beneficial is where a bug is discovered, but a cause cannot be easily determined. For example, suppose a bug is discovered in a very complicated system, where many parts interact, or it happens inconsistently. In such situations, it is usually worthwhile to systematically peel away all extraneous code paths until you're left with the core path that exposes the bug.

Why should I use it?


When should I use it?


How can this type of thinking help me?


Changing the context under which a complex problem manifests can sometimes over-complicate the process of understanding the problem, thereby making a general solution even more difficult to develop. Finding a similar problem that has fewer variables (or simply removing or fixing the variables involved with the original problem) is one approach to reducing the complexity. While a specific solution may be found using this technique, this solution will be specific and therefore only useful to the particular context (variable set). However, finding solutions to other similar problems of different contexts can then aid in understanding the original, more general problem, thereby leading back toward a more general solution.

How do I use it?


  1. Identify the problem or issue that is a challenge.
  2. Identify the various contexts in which the problem lies. In other words, try to enumerate all of the variables involved.
  3. Temporarily eliminate or fix as many variables as possible to produce a similar but less complex problem.
  4. Find a solution to the simpler problem.
  5. Implement the solution.
  6. Repeat the previous three steps a few times, each time eliminating/fixing different sets of variables.
  7. Synthesize the specific solutions into a more general solution
    • Take care not to produce a cased solution, one that changes its computation based on the input, because the solution may be applied to a context that you have not thought about.
    • Often times The general solution will be more elegant and natural to explain than any of the specific solutions.
  8. Ask a trusted, knowledgeable person (expert) if the generalization seems sound and complete and if there are missing/unhandled variables.
  9. Evaluate whether the solution was successful. A good solution should successfully handle any of the specific contexts you identified.

What other critical thinking skills are often used with this skill?


Example


Suppose that you receive a bug report that text is not wrapping correctly in a custom-made text box. Sifting through the text wrapping code, you realize that the code logic is overly complicated, and therefore difficult to reason about, so you decide to rewrite it. However, even after cleaning the code logic, the issue still remains for the bug reporter. The issue doesn't exist in the code that breaks up the lines, but is instead in the system call that calculates how wide the text will appear on the screen. To test your hypothesis, you write up a very short line of code that eliminates everything except for the text width code.

import blf; blf.size(0,12,72); blf.dimensions(0, 'test')[0]

The bug reporter can confirm that the text widths are reporting differently than what you expect. After communicating with the developers of the system call, you all come to the conclusion that the bug reporter's system font settings are somehow inconsistent, so a "load factory settings" fixed the bug.