The Little Vulgar Book of Mechanics (v0.9.1) - Functions I

Last updated: February 27th 2022

Just updated this section of the book: Functions I

Functions I #

What is a function?

And, most importantly, why do we use functions?

I'll answer both questions soon, but first, I have a confession to make: I wasn't always this hot and rich.

I used to be ugly and mediocre, like Galileo. So I decided to start playing metal guitar, so that I would be cool and girls would like me. But the problem was that my guitar riffs were shit. They were as mediocre as Galileo's attempts at science and math before he stumbled upon his magic little toy (which he deliberately kept from his intellectually superior peers as long as he could, so that he would be "first!" to observe and confirm stuff.)

Luckily, just like Galileo, one day I accidentally came across a new technology, before any of my peers! So I ran back home, and used that technology to become amazingly hot, and rich, and historically important. This technology was a box. A box that, mathematically, looked like this: metalzone( ).

As you can see, the box has a hole. So I put my shitty riff x in the hole. Like this: metalzone(x), and, wouldn't you know it: The output was an amazing riff. And all of a sudden I was a rockstar. I was the talk of the town. The point of the story is: BOSS MT-2 fo' lyfe!

Actually, the better point of that story is that: A function is the mathematical way to express the idea of putting a thing (a time value, an audio sample, etc.) in a box that transforms it into something else (its "output").

And here's why we use functions: It's because they help us express our understanding of how certain things work in the world. Specifically, we use them to model the way something (an output such as length, position, etc.) depends on something else (an input such as time, force, etc.)

Inputs and outputs will be some quantity, e.g. weight, pressure, time, etc. Or more complicated structures. Anything can be an input or an output. It depends on what aspect of the world we're trying to model. I.e. What problem we're trying to solve.

See current full book's WIP here.