I have the following exercise but am not sure on how I should begin. The wording doesn’t make sense to me:
Using the addition function over the
natural numbers, give a recursive
definition of multiplication of
natural numbers.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can think of
3 * 5as5 + 5 + 5, i.e. adding5for3times. If you want to do it recursively, then you can think of it like this: the result ofa * bis equal to addingbto the result of(a-1) * b. From here to a Haskell recursive function, the step is small 🙂