A factorial tutorial
The trouble with being interested in words is this: you look up a word, the definition leads you to further searches and those in turn lead to more research. I had been meaning to look up 'recursion' and 'recursive' for a while now. I know incursion means invasion, but I didn't know what recursion meant other than recurrence. Saturday crosswords all done, I remembered that, and decided to give it a go.
My trusty Webster's was of no help. It said 'recursion' meant return and added that it was an obsolete usage.
The concise OED was enigmatic. It said that 'recursion' was the application or use of a recursive procedure or definition, and gave a second meaning that it was a recursive definition. The next word was 'recursive formula' which it defined as an expression giving successive terms of a series, et cetera. The next word was 'recursive,' which was defined as characterized by recurrence or repetition.
Then came a clarification that in mathematics or linguistics parlance, it meant " relating to or involving the repeated application of a rule, definition or procedure to successive results."
It was clear as mud.
So I turned to the Resident Mathematician. "It is mathematical logic, Lali," he said. "I will try to keep it simple," he said. I thought of Alice.
"You may call it 'nonsense' if you like," she said, "but I've heard nonsense, compared with which that would be as sensible as a dictionary!" I murmured to myself.
"A function can be thought of as a sort of mathematical vending machine. If you put in a certain kind of number the function will return to you a number. Not all forms of coins are accepted by every vending machine, you see?" The Resident Mathematician said.
I thought of abacuses and computers. "I think I got that," I said.
"For example, the squaring function accepts all numbers."
I thought squaring meant to cause to match or positioning so as to be a square. It turned out not to be the case.
"It multiplies the input by itself, the "input", that is, and that's what it returns. If you feed it five, it will return twenty-five. If you input minus one, it will return one and so on." The Resident Mathematician went on.
I was getting cross-eyed, but I did ask for it.
"The cubing function cubes the number which is fed to it. But notice this, these two functions are defined in terms of the operation of multiplication." He went on, getting complicated at me. "But the factorial function is defined differently. The factorial function is defined like a recipe." I cringed.
"I see," I said, not seeing at all. Then the Resident Mathematician got more technical at me.
"You are told that factorial will only accept positive integers," he said. "Remember, squaring function accepted negative numbers? Then you are told that factorial of zero is one, the last item which completes the description. The factorial of a number n plus one is the factorial of n multiplied by n plus one." He went on, relentlessly.
This was getting worse by the minute.
"So, factorial of two will be one times two. To compute the factorial function for a particular number, you must know the factorial of the preceding number. This is a recursive definition." He said.
I sighed. "Honey, did I tell you about this lovely clue I solved?" I said. "Prevent big cities being readable? Five, eight. Block capitals."
The Resident Mathematician sighed.