Day 18: Back at it Again with Some More Math

In my process to confirm my theory on why the simple algorithm O(branches^depth) works I needed to learn some more math. Specifically, how to calculate the sum of a series of exponents for the same base. Where i increments from 0 to n. I mean I know the formula for “The sum of powers of 2”. I just do not know the formula for any other base. I found a few resources thought which may help me learn this math.

TLDR;

Okay, so here are the highlights of what I did:

  • Still reading through the book “Cracking the Coding Interview” by Gayle Laakmann McDowell. Looked into my theory about why the generic recursive algorithm formula works for simple recursive functions. It make sense to me in theory. Basically, I believe that since there is only a constant amount of work being performed in most simple recursive functions (both in the base and recursive cases). The processing cost for the recursive function is purely determined by how many times the function is called throughout the operation. That is why the formula O(branches^depth) works. I can currently prove this to be true for powers of 2 but I still need to learn how to calculate the sum of other powers. That’s where my BOY Khan Academy might be helping me out. I had to do a bit of googling to figure out what I was looking for exactly but hopefully tomorrow will be the big day. LOL

Conclusion

That’s all for today. This is my sixth round of the “#100daysofcode” challenge. I will be continuing my work from round five into round six. I am currently working through the book “Cracking the Coding Interview” by Gayle Laakmann McDowell. My goal is to become more familiar with algorithms and data structures. This goal was derived from my goal to better understand operating systems and key programs that I use in the terminal regularly e.g. Git. This goal was in term derived from my desire to better understand the fundamental tools used for coding outside of popular GUIs. This in turn was derived from my desire to be a better back-end developer.

I have no idea if my path is correct but I am walking down this road anyways. Worst case scenario I learn a whole bunch of stuff that will help me out on my own personal projects.