My first GM experience

A grand meetup is an event here at Automattic where the whole company gathers once a year to do classes, projects, or just hack around ideas in general.

This year it was held in Whistler, BC, Canada.

Working remotely with strangers and meeting them in person was a bit weird and overwhelming in the beginning.

However, I had already met my team during a team meetup in Vienna, so hanging out with them during the GM was more relaxing 🙂

I also met Matt!

Then, besides meeting all of these nice folks, I also played my first D&D game ever! My character was a Human Wizard (named Matt :D) and we slayed the dragon!

The food at the hotels was really good!

The village had some really nice views! We went for some souvenir shopping.

Then, for the closing party we had some arcades!

Also, my team Woo rocked the stage 😀

Some stats: before the GM I had met 1% of all Automatticians. Now that has moved up to around 20%. With that, my objective of meeting all the folks that I have interacted or worked with was completed!

So a few words about the company: Automattic is about transparency, passion, freedom, impact, people, differences. If you care about these things, Automattic is hiring and you can apply.

Thank you A8c for this great experience!

Advertisements

Deriving derivative

To reach to here, we first had to work out the point slope formula and then figure out limits. Derivatives are very powerful. This post was inspired by doing gradient descent on artificial neural networks, but I won’t cover that here. Instead we will focus on the very own definition of a derivative.

So let’s get started. A secant is a line that goes through 2 points. In the graph below, the points are A = (x, f(x)) and A' = (x + dx, f(x + dx)).

To derive a formula for this, we can use the point-slope form of a equation of a line: y - y_0 = \frac {y_1 - y_0} {x_1 - x_0} (x - x_0).

Plugging in the values, we get: f(x) - f(x + dx) = - \frac {f(x + dx) - f(x)} {dx} (dx).

What is interesting about this formula using the secant is that, as we will see, it provides us with a neat approximation at f(x).
Let’s define f_{new}(x, dx) = \frac {f(x + dx) - f(x)} {dx}. So now we have: f(x + dx) = f(x) + f_{new}(x, dx) (dx).

The limit as dx approaches 0 for f_{new} will give us the actual slope (according to the definition of an equation of a line) at x.

So, let’s define \lim_{dx \to 0} f_{new}(x, dx) = f'(x). This slope is actually our definition of a derivative. This definition lies at the heart of calculus.

The image below (taken from Wikipedia) demonstrates this for h = dx.

Back to the secant approximation, we now have: f(x + dx) \approx f(x) + f'(x) (dx). This is an approximation rather than an equivalence because we already calculated the limit for one term but not the rest. As dx -> 0, the approximation -> equivalence.

For example, to calculate the square of 1.5, we let x = 1 and dx = 0.5. Additionally, if f(x) = x^2 then f'(x) = x*2. So f(1 + 0.5) = f(x + dx) \approx f(1) + f'(1) 0.5 = 1 + 2 * 1 * 0.5 = 2. That’s an error of just 0.25 for dx = 0.5. Algebra shows for this particular case the error to be dx^2. For dx = 0.1, the error is just 0.01.

Pretty cool, right?

Here are some of the many applications to understand why derivatives are useful:

  • We can use the value of the slope to find min/max using gradient descent
  • We can determine the rate of change given the slope
  • We can find ranges of monotonicity
  • We can do neat approximations, as shown

Definition of the mathematical limit

This post assumes knowledge in mathematical logic and algebra.
We will stick to sequences for simplicity, but the same reasoning can be extended to functions. For sequences we have one direction: infinity.

Informally, to take the limit of something as it approaches infinity is to determine its eventual value at infinity (even though it may not ever reach it).

As an example, consider the sequence a_n = \frac {1} {n}. The first few elements are: 1, 0.5, 0.(3), 0.25, and so on.

Note that \frac {1} {\infty} is undefined as infinity is not a real number. So here come limits to the rescue.

If we look at its graph, it might look something like this:

We can clearly see a trend that as x -> infinity, 1/x tries to “touch” the horizontal axis, i.e. is equal to 0. We write this as such: \lim_{n \to \infty} \frac {1} {n} = 0.

Formally, to say that \lim_{n \to \infty} a_n = a, we denote: (\forall \epsilon > 0) (\exists N \in \mathbb {N}) (\forall n \geq N) (|a_n - a| < \epsilon). Woot.

It looks scary but it’s actually quite simple. Epsilon is a range, N is usually a member that starts to belong in that range, and the absolute value part says that all values after that N belong in this range.

So for all ranges we can find a number such that all elements after that number belong in this range.

Why does this definition work? It’s because when the range is too small, all elements after N belong in it, i.e. the values of the sequence converge to it endlessly.

As an example, let’s prove that \lim_{n \to \infty} \frac {1} {n} = 0. All we need to do is find a way to determine N w.r.t. Epsilon and we are done.

Suppose Epsilon is arbitrary. Let’s try to pick N s.t. N = \frac {1} {\epsilon}.

Let’s see how it looks for \epsilon = \frac {1} {2}: for n > \frac {1} {\epsilon} = 2, we have: a_n < \epsilon. This is obviously true since 1/4 < 1/3 < 1/2. So there’s our proof.

This bit combined with the slope point formula form the derivative of a function, which will be covered in the next post.