Category Archives: Miscellaneous

Matrix Decomposition

In ordinary arithmetic, the decomposition of a number is finding two numbers that when multiplied together give the original number. For example, the number 12 can be decomposed into 3 and 4 because 3 * 4 = 12. There’s a … Continue reading

Posted in Miscellaneous | Leave a comment

Selecting n Random Items Using JavaScript

Even though I’m not a huge fan of JavaScript, I like the language more than most of my engineering / developer colleagues. Just for fun I decided to code up a function that selects n random integers from N. For … Continue reading

Posted in JavaScript, Miscellaneous | Leave a comment

Hikaru Nakamura wins the 2019 U.S. Chess Championship

Chess grandmaster Hikaru Nakamura won the 2019 U.S. chess championship with a score of 8.0 out of 11. The event ran from March 18 through April 1 and was held in St. Louis. Nakamura is one of the strongest players … Continue reading

Posted in Miscellaneous

Sampling from the Beta Distribution using Python

The beta distribution pops up from time to time in my work with machine learning. Many people are familiar with the Gaussian (also called normal, or bell-shaped) distribution. A particular Gaussian distribution is characterized by a mean and a standard … Continue reading

Posted in Miscellaneous

The Sort Order of an Array

In some programming scenarios it’s useful to get the sort ordering of an array. For example, suppose an array/vector has values [5.5, 3.5, 1.5, 2.5, 4.5]. If you sort the array you’d get [1.5, 2.5, 3.5, 4.5, 5.5]. But instead … Continue reading

Posted in Miscellaneous

Quicksort Implemented Using JavaScript

My dog is responsible for this blog post. I’ll explain what that means in a moment. The quicksort algorithm is generally considered the best all-purpose technique to sort an array. Most programming languages have a built-in library that has a … Continue reading

Posted in JavaScript, Miscellaneous

Checking if Random Numbers are Evenly Distributed

I wrote a very lightweight random number generator using JavaScript. Well, it’s not really a RNG, it’s a very crude way to generate sort-of random numbers. I figured I should do a minimal check of the RNG code to make … Continue reading

Posted in Miscellaneous | 1 Comment