comp-think/2022-2023

Lecture "Introduction to Computational Thinking", exercise 2

Opened this issue · 10 comments

What is the result of applying the second natural language definition of the Fibonacci function in Section "Natural languages vs programming languages" using “7” as input?

I'm having trouble finding the first exercise which appears in the computational thinking book but not here, so I will write both the answers of the first exercise and of the second one in this comment:
First exercise: I write, You write, I read, You read.
Second exercise: 13

With 7 as input, the result is 13

I was not able to do it just by looking at the natural language definition, I also looked at the C language description above.
The result was 13.

With 7 as input, the result will be 13.

The result is 13.
I also looked at the high-level programming language definition to better understand the function Fn = Fn-1 + Fn-2

I can't get it!
Please help me to understand!

The result is 13, but I managed to understand it using the math formula Fn = Fn-1 + Fn-2.

The answer is 13, to me it was easier to understand through the math formula

The function for calculating the 7th Fibonacci number takes as input an integer “7”. And return the sum of the same function with “7-1” as input and still the same function with “7-2” as input.

Result = 13

The answer is 13, following the instructions given in natural language we must subtract 1 from "n" to get up to make "n" result as <= 3 and by doing that "c" will correspond to 13