Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranî)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
What's going on, ladies and gentlemen?
I hope you're feeling good and that you are ready for a recursion challenge.
And in this challenge we are going to write a function, if feeble, not your function and recursive
one that will get some and which represent the index of an element enfeeble not you serious.
And the function should return the associated value to these given.
And so write the recursive function that receives this parameter or some number n and this and will
represent the index of a given element in Fibonacci series.
So you find, you get your index and then you find a value.
Ian Fibonacci.
Serious.
And for result.
For those of you who is not familiar with what we will not you seriously is.
Let's take a look.
So basically the formula, the general formula for if you will not be serious, looks like this.
So the first element when An equals two zero, when the index is zero, the first element, the value
is going to be zero.
The next element for an equals, the one when the index equals to one, the value will be one.
And we can see it right here.
And then every next element in these feeble notches serious is going to be calculated as the sum of
the two previous elements.
So, for example, we know that the first element is zero.
Then we have one and then we have the of the F for an equals two.
Two.
Right.
We can see the formula if An is greater than one.
So F of two equals two.
F of one which is one plus F of zero, which is zero.
And it will give us a total of one.
And then also in the same way you find what will be the value for an equals two three, which is the
total of the value of F two plus the value of F one.
So if we take further loop, for example, the series will look like this.
So for index zero, for index zero will have the value of zero.
Right.
That's based on the formula here.
And for index one, when N equals two one.
Right.
This line is for the index for N when N equals two one, that the value is also going to be one.
And we can see it here.
And then we know that we found out that F of one is one and F of two will be equal to F one plus F zero.
So if one plus F zero will give us one plus zero, which is a total of one, that's basically the serious
Fibonacci.
And if we want to find out what will be F three or four, we just take the sum of the two previous value
for these given value that we want to find out.
So F of three equals two, F of two plus F of one.
And we know both of them, which is one and one.
And the total result will be two and four for.
We can see that it will be equals to F three plus F two.
And we know that it's just two plus one, which is a total of three.
And if we wanted to find out what will be F five, it will be just three plus two, which is five and
so on.
You got the idea how to find all the elements are in the feeble natsheh serious.
And what you have to do is to write a recursive function, a recursive Fibonacci function that will
get some n some index and you will find out and return the value and index N.
So if it will receive an index of three, if it will receive an equals two three.
Then the function is going to return to and if the function will receive N for example, five.
So the function will return five.
Right.
Because five for index five, the value is calculated by the sum of two and three.
So this result should not be done or calculated in an iterative approach, but rather it should be done
using a recursion.
So take your time, think of the solution and I'll see you in the Solutions video.
Good luck, guys.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.