# J hooks make exotic expressions easy

You might see the approximation:

and think:

Hmmm!...

# Brute force, Backtracking and SymPy - counting permutations with no repeated letters

There are 12 unique permutations of the word ‘food’. Of these, there are only six that satisfy the constraint that no adjacent...

# The intuition behind Expectation Maximisation

Expectation Maximistation is a fantastically useful algorithm used to estimate model parameters (e.g. the bias of a coin, or the mean of...

# The Fast Inverse Square Root method in Python

The inverse square root of a number x is x-1/2. For example, put in 25, you’ll get back 0.2: the square root of 25 is 5, the inverse of 5 is 1/5, or 0.2 in decimal notation. It’s a very...

# 100 pandas puzzles

I’ve started compiling a list of short pandas puzzles of varying difficulty. You can find it over on GitHub here.

There are already some great guides to pandas out there (not least in the official documents themselves) but nothing...

# Picking magic numbers for numpy.in1d

If you’ve played about with NumPy before, you’ll probably know that given two arrays of numbers, ar1 and ar2, the function in1d returns a boolean array indicating whether or not each number in...

# Want more upvotes on Stack Overflow? Try playing the slow game

Stack Overflow, the hugely-popular programming Q&A website, has often been called an online game. To play, you post correct answers or ask interesting questions. Correct and interesting content is upvoted by other users, netting you precious green reputation points.

The...

# Python power towers

If you have a list of numbers, say [3, 2, 2, 2], what’s the best way to turn it into a power tower?

In other words, the aim is to take the list and calculate the answer to...

# A basic introduction to NumPy's einsum

The einsum function is one of NumPy’s jewels. It can often outperform familiar array functions in terms of speed and memory efficiency, thanks to its expressive power and smart loops. On the downside, it can take a little...

# The colour of the Internet

What colour is the Internet? Probably green or blue, judging by the colours that appear most often in domain names.

The graph below shows 12 colours and the number of times each one appears in .com and .net domain names....

# Words nobody wants for websites

There are over 130 million .com and .net domain names. Is every single English word being used?

Curious, I hatched a plan and found the answer: not at all.

By my reckoning, only around 64% of all recognisable English...