Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started