input: Write a function to explain how to use recursion to solve a given problem in Python. The function should provide a detailed explanation of what recursion is, how it works, and how to design a recursive function in Python, using the input as a context. The function should return the explanation as a string.
  assert recursion_explanation("")=="Recursion is a powerful technique for solving problems. It involves defining a problem in terms of itself. A recursion problem is solved by breaking it down into smaller problems, until the problem is small enough to be solved directly. The result from a smaller problem can then be combined with the result from the larger problem, until the original problem is solved. In Python, a recursive function is one that calls itself."
  assert recursion_explanation("To find the factorial of a number")=="Recursion is a powerful technique for solving problems. It involves defining a problem in terms of itself. A recursion problem is solved by breaking it down into smaller problems, until the problem is small enough to be solved directly. The result from a smaller problem can then be combined with the result from the larger problem, until the original problem is solved. In Python, a recursive function is one that calls itself. For example, to find the factorial of a number, a recursive function can be designed to call itself with the number decremented by 1 until it reaches 1."
  assert recursion_explanation("To reverse a string")=="Recursion is a powerful technique for solving problems. It involves defining a problem in terms of itself. A recursion problem is solved by breaking it down into smaller problems, until the problem is small enough to be solved directly. The result from a smaller problem can then be combined with the result from the larger problem, until the original problem is solved. In Python, a recursive function is one that calls itself. For example, to reverse a string, a recursive function can be designed to take the last character of the string and call itself with the rest of the string, combining the results until the entire string is reversed."
  assert recursion_explanation("To search a binary tree")=="Recursion is a powerful technique for solving problems. It involves defining a problem in terms of itself. A recursion problem is solved by breaking it down into smaller problems, until the problem is small enough to be solved directly. The result from a smaller problem can then be combined with the result from the larger problem, until the original problem is solved. In Python, a recursive function is one that calls itself. For example, to search a binary tree, a recursive function can be designed to search the left subtree if the current node is smaller than the target, and the right subtree if it is larger, combining the results until the target is found or the tree is fully searched."
  assert recursion_explanation("")=="Recursion is a powerful technique for solving problems. It involves defining a problem in terms of itself. A recursion problem is solved by breaking it down into smaller problems, until the problem is small enough to be solved directly. The result from a smaller problem can then be combined with the result from the larger problem, until the original problem is solved. In Python, a recursive function is one that calls itself."
output: def recursion_explanation(context):
      base_explanation = "Recursion is a powerful technique for solving problems. It involves defining a problem in terms of itself. A recursion problem is solved by breaking it down into smaller problems, until the problem is small enough to be solved directly. The result from a smaller problem can then be combined with the result from the larger problem, until the original problem is solved. In Python, a recursive function is one that calls itself."
      
      if context == "":
          return base_explanation
      elif context == "To find the factorial of a number":
          return base_explanation + " For example, to find the factorial of a number, a recursive function can be designed to call itself with the number decremented by 1 until it reaches 1."
      elif context == "To reverse a string":
          return base_explanation + " For example, to reverse a string, a recursive function can be designed to take the last character of the string and call itself with the rest of the string, combining the results until the entire string is reversed."
      elif context == "To search a binary tree":
          return base_explanation + " For example, to search a binary tree, a recursive function can be designed to search the left subtree if the current node is smaller than the target, and the right subtree if it is larger, combining the results until the target is found or the tree is fully searched."