Skip to content

When I was 15, I didn't like doing them by hand in my math class, so I was challanged by my teacher to code it

License

Notifications You must be signed in to change notification settings

CRiSTiK24/NewtonBinomialSolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NewtonBinomialSolver

Introduction

Back in 2018 when I coded this, all I knew about programming and python was from a mobile app. I decided this was going to be my first project. In 2019 I redid the program because from a StackOverflowPost I made someone told me about the existence of libraries and that I really did not need to code everything on my own. I publish both versions here as Old Program and BetterProgram.

Old Program (2018)

For the first, I only used the math library. I remember to spend days thinking on how could I represent the Tartaglia triangle following something simmilar I found on the internet and how to calculate the Combinations. Finally I succeded, it had some issues like not being able to calculate with variables that had an unknown value, but which I did not know how to solve on my own at that time. An example of a possible operation:

$ (4 + 5)^3 $

You can check the results in the same folder as the script, I have an example of an Easy operation and another that froze my (new then) computer for some minutes(don't try it at home).

New Program (2019)

After that and the tips I recieved in Stackoverflow, I saw that I wrote a lot of algorithms unneeded. I refactored the whole code and learnt to use sympy. Now it was able to not only use unknown variables, but also put exponents inside the variables. For example:

$({3x}^6 + {4y}^7)^4$

You can check the video if you want to check it out. (Sorry for the stereotypical music and format. Though to be honest I find it quite charming, it really is a gate to the past)

Conclusion

I learnt quite a lot about how to turn the algorithms from the head to functional code, and how essential and lifesaving libraries really are.

Nowadays (2022) I've already passed 2 of the 4 years in order to earn a Computer Science Degree, and I'm able to see a lot of mistakes which I didn't know at that time (such as not adding comments for every function with at least a #pre and a #post, A while true and breaks that would have gotten me failed had I shown it at the first programming class...)

If you are interested in learning to program and find this, feel free to contact me! It really can be dificult to have a good base without some sort of guidance. You should be able to find the mail at my GitHub Profile.

About

When I was 15, I didn't like doing them by hand in my math class, so I was challanged by my teacher to code it

Resources

License

Stars

Watchers

Forks

Languages