It's possible to generalize many of the recurrence relations (that we come across in Combinatorics problems, (you may want to try recurrence relations problems like these )
To learn how to generalize recurrence relations (using math) you could read these notes by Daniel Chiu - recursion, linear, part 2.
And if you want to know some tricks to manipulate things come to homogeneous recurrences, see the solutions in my note Need help
This was for in Maths... Let's now try programming..... (I have just started learning it...)
In programming(Python), people try various programs to print the numbers, but what i prefer is , start with an empty list " "
Then, we write a program which will take into consideration all the Fibonacci numbers.
recurnce
As shown in the image, just the to , so the is now containing the terms of Fibonacci Sequence!!!
On this list, as shown you can do operations like of elements (use sum(li) ), of elements (use len(li), which gives length of list 'li'), and the code can be used to see whether any given number is a term of a Fibonacci sequence or not. (If the number is in Fibonacci sequence, then will give value 1, and else, 0 )
This will be for the terms of Fibonacci sequence which are less than the range you type at first. (in the while loop)
Also, not only Fibonacci sequence, you can get other recurrence relations by this too !
Like the one in terms , like initial conditions and for , This type of recurrences, you can solve by making characteristic equation and finding it's roots, as done in this note.
But by programming, it will be as follows
recrnc
In this one, the recurrence is simply defined by the last line in the loop. Then, the list will directly get numbers included and you can try any operations, like sum of first terms, or you can even find the term of the sequence just by using python code and it will give you the term. (Note that it won't give general form, it will give value for value of ).
Because this was example, i restricted the range of , but you may try to get bigger values by increasing it !
This shows the use of Programming to get terms of a recurrence relation and easily doing operations on them, like addition of few, for example, if you want the sum of terms to of Fibonacci sequence (i.e. , where is Finbonacci term), then you define a new list as and it will make to be list of Fibonacci numbers from to . (Note that in new list, we took in formula for li_1 because it will exclude 2nd term)
Like and reshare if it was helpful to you.
Easy Math Editor
This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.
When posting on Brilliant:
*italics*
or_italics_
**bold**
or__bold__
paragraph 1
paragraph 2
[example link](https://brilliant.org)
> This is a quote
\(
...\)
or\[
...\]
to ensure proper formatting.2 \times 3
2^{34}
a_{i-1}
\frac{2}{3}
\sqrt{2}
\sum_{i=1}^3
\sin \theta
\boxed{123}
Comments
Very good discovery. This is fundamental to programming theory.
Log in to reply
??? trolling or what ? I know you already know this all....
Log in to reply
The notes were by Daniel Chiu, not me. I fixed it for you ;)
Log in to reply