map
, there's still only one inputmap
? What seems to be going in the blanks for combine with
? max
? What seems to be going in the blanks for combine with
?
Ways to Think About It. When you see this:
{1;2;3;4}
using addition."{1;2;3;4}
"
Combine with
is most useful with functions that take two inputs like:
or the
max
function that you defined above.
These operations are associative, which means that the result is the same no matter how the items are grouped. For example, (3 + 4) + 5 = 3 + (4 + 5) and join words
("the cat")("sat") = join words
("the")("cat sat").
combine with
because the grouping of the items matters in these cases. For example, (3 - 4) - 5 ≠ 3 - (4 - 5). combine with
? Try it.
sum
that takes a list of numbeers and reports their sum.numbers
.
factorial
that models this using combine with
.
{1;2;3;4}
? --MF