Question: Lisp sigma function recursion help me trace it. I get it logically, I just need to understand this example so I can do my assignments.

Lisp sigma function recursion help me trace it. I get it logically, I just need to understand this example so I can do my assignments. I'm not sure what is happening on the 3rd and 4th line, what is x being set to. If my inputs are (sigma f 1 2) my output is 20, another example would be (sigma f 1-5). If you can help me trace it. I would post the sigma definition below. Thank you for your help.

(defun sigma (f m n)

(if (> m n) 0

(let ((x (sigma f (+ m 1) n)))

(+ (funcall f m) x) )))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!