ajcr

Haphazard investigations

Blog About

Building a multivariate hypergeometric calculator with Lark and SymPy

Probability questions about choosing at random are easy to describe in English, but frustratingly difficult to compute. I design and build a new calculator to make it easier to ask and answer these probability problems.
Read Post

Jane Street's 'Figurine Figuring' puzzle solution and a tricky follow-up question

Solving an expected value problem by multiplying polynomials. Also, I ask (and fail to answer) a seemingly difficult question about limits.
Read Post

An Illustrated Guide to Shape and Strides (Part 3)

How manually manipulating strides opens up new array operations, and why swapping tiles of 2D arrays requires *four* dimensions.
Read Post

An Illustrated Guide to Shape and Strides (Part 2)

Exploring how manipulating stride lengths can transpose an array, as well as C vs. Fortran contiguity.
Read Post

An Illustrated Guide to Shape and Strides (Part 1)

A detailed look at strides are used to define the shape and order of multi-dimensional arrays.
Read Post

J hooks make evaluating exotic expressions easy

Implementing expressions to approximate $\pi$ using J and the power of hooks.
Read Post

The fastest way to count permutations with no repeated letters

Presenting the slow, faster and (possibly) fastest algorithms to count permutations that avoid repeating letters.
Read Post

The intuition behind Expectation Maximisation

What makes this algorithm work? A simple overview of the key steps and code involved.
Read Post

The Fast Inverse Square Root method in Python

Jumping through hoops to write the famous Quake 3 code in Python.
Read Post

100 pandas puzzles

Well, not quite 100 yet. You can find them at github.com/ajcr/100-pandas-puzzles
Read Post

Picking magic numbers for numpy.in1d

Where did the value of 0.145 come from? Contour plots.
Read Post

Three tactics to boost Stack Overflow upvotes

There are two strategies to accumulating reputation, answer fast, or answer slow. Here's how to go slow and build upvotes.
Read Post

Python Power Towers

Is there a neat way to turn a list into a tower of powers?
Read Post

A basic introduction to NumPy's einsum

einsum is one of NumPy's jewels. What does it do?
Read Post

The colour of the Internet

I argue it's mostly blue and green.
Read Post

Words nobody wants for websites

Exploring domain names to find the words nobody has used yet.
Read Post

Future Plans

Hello and welcome.
Read Post