To the human brain, operations that involve computation and calculation extremely expensive. Thus, the optimal approach (from the perspective of the human) is to attempt to reduce the complexity of the problem at hand. In effect, it is of no surprise that the mathematician tends toward recursion over iteration.
To this end, the programmer is wise to produce algorithms and solutions via mathematical induction. As a general heuristic, it is not necessary to map out every possible event within a recursive call (or set of iterations). In the case of recursion, it is only necessary to understand the base case(s) and the general pattern.
Although quite inefficient in the context of time complexity, the code snippet shown below demonstrates the power of mathematical induction quite well. Thinking through every single combination in the array is largely unnecessary; the intuitive aspect of the algorithm lies with the nested if-statements at the center of the for loops.
