Got Homework?
Connect with other students for help. It's a free community.
Here's the question you clicked on:
 0 viewing
ajiwo
Group Title
=quote=
To evaluate a combination, do the following:
1. Evaluate the subexpressions of the combination.
2. Apply the procedure that is the value of the leftmost subexpression (the operator) to the arguments that are the values of the other subexpressions (the operands).
=question=
can someone please explain how to apply this combination (+ 1 2 3) according to the above rule?
 one year ago
 one year ago
ajiwo Group Title
=quote= To evaluate a combination, do the following: 1. Evaluate the subexpressions of the combination. 2. Apply the procedure that is the value of the leftmost subexpression (the operator) to the arguments that are the values of the other subexpressions (the operands). =question= can someone please explain how to apply this combination (+ 1 2 3) according to the above rule?
 one year ago
 one year ago

This Question is Open

jagan Group TitleBest ResponseYou've already chosen the best response.0
(+ 1 2 3) is primitive expression, which will be evaluated as 1+2+3. But to evaluate a combination(nested expression) this rule will apply. Like (+ (*1 2) 3). 1) first evaluate the sub expression (* 1 2 ) 2) (+ 2 3)  primitive expression.solved directly ans 5
 one year ago

ajiwo Group TitleBest ResponseYou've already chosen the best response.0
thanks @jagan but according to =quote= 1.1.1 Expression ... One kind of primitive expression you might type is a number. ... Expressions representing numbers may be combined with an expression representing a primitive procedure (such as + or *) to form a compound expression that represents the application of the procedure to those numbers. For example: (+ 137 349) ... Expressions such as these, formed by delimiting a list of expressions within parentheses in order to denote procedure application, are called combinations. =reply= so i think (+ 1 2 3) is a combination. because each of the + 1 2 3 is the primitive expression. The ( and ) is the means of combination.
 one year ago

jolisper Group TitleBest ResponseYou've already chosen the best response.0
Hi @ajiwo, I read again 1.1.1 Expressions section and I think that (+ 1 2 3) is a combination just because it is a list of expressions within parentheses, that is to say that is not necessary that the list of expressions were formed only by primitives expressions to be a combination. Nonprimitive expressions within parentheses also form combinations.
 one year ago

ajiwo Group TitleBest ResponseYou've already chosen the best response.0
yes, from my example problem: (+ 1 2 3) is combination. and from jagan example answer: (+ (* 1 2) 3) is also combination.
 one year ago

dbastos Group TitleBest ResponseYou've already chosen the best response.0
It looks like you're still left with the problem of how to apply the rules above to /evaluate/ the combination. Is that correct? Here's my take on it. The first element of the combination is a procedure. A procedure is a primitive. The other elements are numbers, all primitive. Therefore, all subexpressions were evaluated  and we used only the rule number 1. We're left now with a combination of only primitive things. Now we use rule 2. We invoke the procedure passing to it all the other arguments. For completeness, let's invent another rule which allows us to substitute a combination with another combination or with a primitive. Since the procedure is + and the arguments are 1 2 3, then the whole combination should equal the primitive value 6. Applying our new invented rule, we can replace the whole combination with the primitive value 6. Perhaps you'll appreciate this approach.
 one month ago
See more questions >>>
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.