Right now i'm looking to code a program that can do basic linear algebra from, Where i have 2 constants: A and B, where i can simply input their coefficients and add other values onto it.
Example:
Say i wanted to find the terms of the fibbonaci sequence
A
B
I want to take A + B and append it to file.
A
B
A+B
Now i want to add the 2nd and 3rd term
A
B
A + B
A + 2B
And so on.
I have a program that can do this for all numerical values just fine, however, i would like to see it go up algebraicly, Without using binets formula.
My only guess is to store the coefficents of A and B to 2 seperate files in order to calculate them and then print them out, however, If linear algebra is available in C it would be much easier.
Edit: Never mind, i forgot that this is a place for computer nerds, not math nerds
Being a traditional imperative language, C has no built-in support for algebraic expressions. To compute the coefficients of your Fibonacci sequence, you can write a program like the following:
This will print:
For more complex problems, I'd suggest to use a computer algebra system that offers C bindings.