CyberSpy

Rantings from a guy with way too much free time

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

Getting Visual With It

Time to Get Vizzy With It!

Like Will says:

Gettin vizzy wit it Na na na na na na na nana Na na na na nana Gettin vizzy wit it…

Plot thickens

Time to turn on the lights and see what our data objects look like when we turn them into visualized plots. Sure, we can use the print function to see the numbers within our numpy objects. Better yet, let’s turn our objects into pretty graphical images. To do so, we turn to the matplotlib library. An extensive library of plotting routines that easily allows us to render image plots into many different formats (png, jpg, pdf, etc…) - both onto the screen for quick visual inspection, or written to a file for general use.

Continue reading

Do the Numpy

2017-11-07 Programming Python

Do the Numpy Dance, Is your Chance to do the Nump!

Sir Numpy says:

The Numpy Dance is your chance to do the nump Do the Numpy Nump, come on and do the Numpty Nump Do the Numpy Nump, just watch me do the Numpty Nump Do ya know what I’m doin’, doin’ the Numpty Nump Do the Numpy Nump, do the Numpty Nump

Start at the beginning: NumPy

The first library that we will investigate is numpy. Simply put, numpy allows us to represent mathematical objects like arrays and matricies of different datatypes and performs operations on those objects thereby easing the burden of writing the tedious code within your applications to do the mundane representations and operations.

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
Newer posts