There are two precise mathematical terms with names that sound delightfully imprecise: almost always, and almost everywhere.
Category Archives: Mathematics
When 0.3 is not 3/10
If you’ve taken a course in numerical computing you’ll be familiar with the various sources of numerical error. First you have representation error that arises when you have to represent a number with a finite number of digits. A common example: the decimal expansion for 1/3 = 0.3333… has a never-ending string of 3’s and …
Simple, Efficient, and Wrong.
I’m finally giving this thing a name of its own, paraphrasing a quote by H.L. Menken: For every problem there is a solution that is simple, efficient, and wrong. Reality has a nasty habit of getting in our way. Like icebergs, real problems have edge cases and complexities that mean most of the problem is …
Counting combinations modulo power of 2
It is pretty simple to calculate the number of ways to choose k items out of n: There are n ways to choose the first item, n-1 ways to choose the second item, and so on, until there are \(n-k+1\) ways to choose the kth item. By the rule of product there are \(n (n-1)···(n-k+1)\) ways …
Infinite integers
Lately we’ve discussed how integers work in computers when their size is limited to a fixed number of bits. What if there is no such limitation and we can use as many bits as we want? As computers get more and more powerful we’d like to derive this case by looking at what happens when …