Ah, but something sort of along those lines seems so simple when expressed as a function f: f(0,X) = X f(n,X) = f(n-1, "Which came first, the chicken or the X")
Instead, spice it up with function A: A(0, 0, X) = X A(0, n, X) = A(0,n-1, "Which came first, the chicken or the X") A(m, 0, X) = A(m - 1, 1, X) A(m, n, X) = A(m - 1, A(m, n-1,X), X)
The exercise for the "casual" reader would be to find how many times the word chicken comes up in A(4,3,"or the egg") before you decide you hate math.
f(0,X) = X
f(n,X) = f(n-1, "Which came first, the chicken or the X")
Instead, spice it up with function A:
A(0, 0, X) = X
A(0, n, X) = A(0,n-1, "Which came first, the chicken or the X")
A(m, 0, X) = A(m - 1, 1, X)
A(m, n, X) = A(m - 1, A(m, n-1,X), X)
The exercise for the "casual" reader would be to find how many times the word chicken comes up in A(4,3,"or the egg") before you decide you hate math.