Discrete Math Puzzle. The puzzle is, first of all, to figure out what this exercise/problem is asking. Use lisp code to solve: Hint: The way to deal with lisp expressions is to look for lists, and...

Discrete Math Puzzle. The puzzle is, first of all, to figure out what this exercise/problem is asking. Use lisp code to solve: Hint: The way to deal with lisp expressions is to look for lists, and when found, evaluate them. Lisp code consists of lists, and lists of lists nested to many levels. Evaluating a list entails evaluating each of its elements, except the first, which is treated differently. For now, think of the first element as an operator that operates on the values of the rest of the elements. These values are called the operands. So (+ 1 2 3 4) adds together operands 1, 2, 3, and 4 to produce 10. Note the economy of this prefix notation, as it’s called: only one mention of the + sign is needed. The more familiar infix notation requires redundant + signs, as in 1+2+3+4.

May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here