Hello, I'm a Computer Science student starting to learn LISP. I have been said to program a function to find C(n,k) using tail recursion, and I would greatly appreciate your help.
I have reached this:
(defun combinatorio-recursivo-cola (n k)
(cond ((or (< n k) (< k 0)) NIL)
((or (= k 0) (= n k)) 1)
(T (* (combinatorio-recursivo-cola (- n 1) (- k 1)) (/ n k)))))
Using the following property of the binomial coefficients: http://is.gd/gwBNV
But I don't know how to make the recursive call to be the last instruction executed by each instance, since there the last one es the product. I have been trying it by using an auxiliary function, which I think is the only way, but I haven't found a solution.
Thank you.