Add Me!Close Menu Navigation

From fighting crime and arresting pirates to blasting away zombies, you can always count on a superhero. Unfortunately, I am definitely not that person.

Add Me!Open Categories Menu

Currently Browsing


28 October

0x5f400000: Understanding Fast Inverse Sqrt the Easy(ish) Way!

In this post, we attempt to unravel the mysteries of the “magic” constant found in the fast inverse sqrt method in an intuitive fashion.

29 December

Counting Binary Trees (The Hard Way)

In this post, we prove the closed form of a nonlinear recurrence corresponding to the count of binary trees with n nodes.

9 November
Posted in Article, Math Problems

Counting Words

Suppose that we are given the alphabet \Sigma = \Rec{0,1,2}; a word of length n: x_n \in \Sigma^5, is an ordered n-tuple whose elements all came from \Sigma. For example, a word of length 5 in \Sigma might be the tuple (0,0,2,1,0), which we will hereon denote as 00210. For some natural number k \le n, how many words of length n are there that contains exactly k zeros?

6 November

Annoying Mclaurin Series

Suppose that we’re given the function B(z) = \frac{1 + z}{1 - z - z^2}, find the ordinary generating function associated with it in the form of B(z) = \sum_{k=0}^\infty b_k k^z. Furthermore, find/compute \sigma_n = \sum_{k=0}^n b_k.

15 October

Infinity Norm of the Inverse of Lower Bidiagonal Matrices

We consider the problem of efficiently computing the infinity norm of the inverse of a lower bidiagonal matrix L in linear time.

Limit Preserving Functions in CPOs

Very short proof that limit preserving functions (continuous functions) on complete partial orders are necessarily monotone.

28 May

Introduction to Scientific Computing: Error Propagation

The first part on a series designed to survey the design and analysis of various numerical methods will look at error propagation.

Subtype Ambiguity in Java

Let’s take a look at an example of a situation where ambiguity occurs during the derivation of subtyping proofs in Java. In general, it’s conjectured that subtyping in Java is undecidable.

16 March
Posted in Article, OCaml

Neat way of counting OCaml objects satisfying certain types

We use a very natural semantic translation from OCaml styled types (or really any almost algebraic types) to the count of the instances of those types and do some cool stuff with this translation.

18 January

Fixing floating point cancellation I

How can you compute \sqrt{x^2+1}-x to 14 digits of accuracy within the domain |x| < 10^8?