Most people have heard of word problems, but not as many have heard of the word problem. If you’re imagining that the word problem is some superlatively awful word problem, I can assure you it’s not. It’s both simpler and weirder than that. The word problem is essentially about whether …

Oct. 20, 2020, 12:19 a.m.

I often work in a sort of amphibious environment, using Unix software on Windows. As you can well imagine, this causes headaches. But I’ve found such headaches are generally more manageable than the headaches from alternatives I’ve tried. On the Windows command line, you can type the name of a …

The previous post looked at Gray code, a way of encoding digits so that the encodings of consecutive integers differ in only bit. This post will look at how to compute the inverse of Gray code. The Gray code of a non-negative integer n is given by def gray(n): return …

Sept. 8, 2020, 11:08 p.m.

Suppose you want to list the numbers from 0 to N in such a way that only one bit at a time changes between consecutive numbers. It’s not clear that this is even possible, but in fact it’s easy using Gray code, a method named after Frank Gray. To convert …

Sept. 8, 2020, 12:56 p.m.

I’ve been doing a little introspection lately about what software I use, not at an application level but at a feature level. LaTeX It started with looking at what parts of LaTeX I use. I wrote about this in April, and I revisited it this week in response to some …

This morning I found out that Emacs org-mode has its own markdown entities, analogous to HTML entities or LaTeX commands. Often they’re identical to LaTeX commands. For example, \approx is the approximation symbol ≈, exactly as in LaTeX. So what’s the advantage of org-entities? In fact, how does Emacs even …

Last year I wrote a post about being a computational survivalist, someone able to get their work done with just basic command line tools when necessary. This post will be a different take on the same theme. I just got a laptop from an extremely security-conscious client. I assume it …

I was explaining to someone this evening that I’m in the habit of saying “bang” rather than “exclamation point.” Here’s a list of similar nicknames for symbols. These nicknames could complement the NATO phonetic alphabet if you needed to read symbols out loud, say over the phone. You might, for …

This post looks at an algorithm by Cohen et al [1] to accelerate the convergence of an alternating series. This method is much more efficient than the classical Euler–Van Wijngaarden method. For our example, we’ll look at the series which converges slowly to -π²/12. The first algorithm in [1] for …

Programming language support for hexadecimal integers is very common. Support for hexadecimal floating point numbers is not. It’s a common convention to put 0x in front of a number to indicate that it is an integer written as an integer literal. For example, 0x12 is not a dozen, but a …

If and when large-scale quantum computing becomes practical, most public key encryption algorithms currently in use would be breakable. Cryptographers have known this since Peter Shor published his quantum factoring algorithm in 1994. In 2017 researchers submitted 69 algorithms to the NIST Post-Quantum Cryptography Standardization Process. In 2019 NIST chose …

July 23, 2020, 12:52 p.m.

Suppose you’re given a complex number z = x + iy and you want to find a complex number w = u + iv such that w² = z. If all goes well, you can compute w as follows: ℓ = √(x² + y²) u = √((ℓ + x)/2) v …

A probable prime is a number that passes a test that all primes pass and that most composite numbers fail. Specifically, a Fermat probable prime is a number that passes Fermat’s primality test. Fermat’s test is the most commonly used, so that’s nearly always what anyone means by probable prime …

The most obvious way to compute the determinant of a 2×2 matrix can be numerically inaccurate. The biggest problem with computing ad – bc is that if ad and bc are approximately equal, the subtraction could lose a lot of precision. William Kahan developed an algorithm for addressing this problem. …

There are numerous web sites that will let you upload a PostScript (.ps) file and download it as a PDF. Some of these online file format conversion sites look sketchy, and the ones that seem more reputable don’t always do a good job. If you want to convert PostScript to …

Here are five things I appreciate about using Emacs. They also apply to any software that runs entirely on your computer. It doesn’t track me. It doesn’t show me ads. It doesn’t require two-factor authentication. It doesn’t change unless I change it. It doesn’t stop working if my internet connection …

April 28, 2020, 1:49 p.m.

In the previous post I present a bash one-liner to search directories for LaTeX files and count the commands used. College files I first tried this out on a directory that included some old files from grad school. I chose this directory because I knew it had a lot of …

April 19, 2020, 8:23 p.m.

I started this post by wanting to look at the frequency of LaTeX commands, but then thought that some people mind find the code to find the frequencies more interesting than the frequencies themselves. So I’m splitting this into two posts. This post will look at the shell one-liner to …

April 19, 2020, 7:27 p.m.