CyberSpy

Rantings from a guy with way too much free time

Brew up some Elixir recursion

2017-11-17 Programming

Recursion is recursion is recursion is recursion….

So how hard is it to go back to a programming language that you haven’t used for months that you only used for less than a year? Well, it took me a few more minutes than I anticipated, but in the end, I was succesful!

Tonight, I thought I’d take the simple idea of creating Pascal’s Triangle. A simple construction that creates a table of binomial coefficients for the binomial $(x+y)^n = x^4+4x^3y+6x^2y^2+4xy^3+y^4$. Notice the coefficients in our expanded binomial:

Continue reading

Making Heads or Tails out of Recursion and Combinatorial Math

2017-11-09 Programming Math Python

GNU — GNU’s Not Unix

I thought I’d take a look at two topics at once and make some fun by mashing them together. Today’s topic is recursion. In computer science (and in math, although we call the equation a recurrence relation) recursion is an often misunderstood concept causing lots of panic and anxiety. In reality - it’s pretty easy once you wrap you head around the idiom.

What is recursion?

When we define a function in such a way that it calls itself, we’ve defined a recusive function. The most basic example is the Factorial function, $f(n)=n!$. We define the function recursively by defining it in reference to itself. So, recursively, we define $f(n)$ as:

Continue reading

Basic Math Concepts made Complicated Quickly

2017-10-15 Math

Fibonacci - What’s in a Name…

The man, the myth

Leonardo Fibonacci was a mathematician who lived in the middle ages and was held in high esteem for his prowess as a talented mathematician. Best known for his Fibonacci Sequence which seemingly is simple to define, yet it’s limit point (of the ratio of the last two elements of the sequence) (also known as the Greek letter Phi). The mysticism around the Golden ratio abounds due to its correlation with many natural element - both living things as well as dynamic processes.

Continue reading