通过类比进行推理

Reasoning by Analogy:

  • A powerful learning, problem-solving, and debugging technique with a four-step process: have a question, translate to a similar understood thing (analogue), solve for the analogue, and translate back.
  • Used all the time to leverage past experience to solve new problems.
  • Grade school math example: Solved a problem about Alice and Bob's apples by simplifying to a similar problem with fewer apples and realizing it was an addition problem. Then applied the same to the original problem.
  • Parameterized Html and List types example: Confused by Elm's parameterized Html type, used intuition about the parameterized List type to construct an experiment. Found that someHtml : Html a must be static like someList : List a must be empty.
  • Weakness - false analogies: Important to be careful in step 2. If the analogue is not similar, the solution won't translate correctly, leading to wrong conclusions. For example, in grade school math, a wrong simplification led to the wrong operation.
  • Other applications: Great for debugging like in a random generators stack overflow bug and as a general problem-solving tool when stuck writing complex JSON decoders.
  • Related reasoning techniques: Has roots in classical philosophy including deductive reasoning (big to details), inductive reasoning (details to big), and process of elimination. There's a whole article on using classical reasoning techniques for debugging including reasoning by analogy.
阅读 6
0 条评论