Zulip Chat Archive

Stream: maths

Topic: quiz: course-of-values recursion


Bulhwi Cha (Dec 22 2022 at 06:03):

Quiz: define the following function in Lean, evaluate the values of the first ten arguments of that function, and find another way of defining it.

f(0)=1f(n+1)=f(n)+f(n1)++f(0)f \left( 0 \right) = 1 \wedge f \left(n + 1 \right) = f \left( n \right) + f \left( n - 1 \right) + \cdots + f \left( 0 \right)

Solution

Reference

CWoo. “course-of-values recursion.” PlanetMath. Last modified Mar 22, 2013. https://planetmath.org/courseofvaluesrecursion.

Bulhwi Cha (Dec 22 2022 at 06:18):

While trying to solve Exercise 3 from Chapter 8 of #tpil4, I came up with the quiz above.

Patrick Johnson (Dec 22 2022 at 09:04):

Can you define f without using lists and without proving any theorem before the definition of f?

Simpler definition

The final proof may be harder using this definition though.

Bulhwi Cha (Dec 22 2022 at 11:07):

Right. Maybe I can also use Finset to define f; I'd like it to be computable.


Last updated: Dec 20 2023 at 11:08 UTC