Hash tables
In this post you will learn what hash tables are, why you would use them, and how they are used to implement dictionaries in the most popular Python interpreter—CPython.
In this post you will learn what hash tables are, why you would use them, and how they are used to implement dictionaries in the most popular Python interpreter—CPython.
In the previous article in this series we distinguished between two kinds of unsupervised learning (cluster analysis and dimensionality reduction) and discussed the former in some detail. In this installment we turn our attention to the later. In dimensionality reduction we seek a function $f : \mathbb{R}^n \mapsto…
A perfect hash function is one that is collision-free. By implication, the hash must be at least as many bytes as the key and the function is theoretically reversible, though not always tractably so. In other words, perfect hashing is a special case of encryption. Because the hash is no smaller than the key, the…
Solving Logic Puzzles with Prolog
One reason to know how your data structures work is so that when your problem has unusual constraints you can tweak how they work to fit the problem better or work faster. In this article I’ll talk about four different fun tweaks to the concept of a hash table that I made in the process of using hash tables to…
Better visual explanations of information theoretic quantities like entropy and mutual information using I-diagrams. Based on Raymond W. Yeung's "A new outlook on Shannon's information measures" paper from 1991.
[ An updated treatment of some of this material appears in Chapter 2 of the Energy and Human Ambitions on a Finite Planet (free) textbook, also mirrors a 2022 article in Nature Physics . . ]
Knights in chess move in an L-shape: 2 squares in one direction and 1 square perpendicular. But what if it didn't have to be like that?
My problem is not just with the methods—although I do have problems with the method—but also with the ideology.
A common example of recursion is the function to calculate the $n$-th Fibonacci number: def naive_fib(n): if n < 2: return n else: return naive_fib(n-1) + naive_fib(n-2) This follows the mathematical definition very closely but it’s performance is terrible: roughly $\mathcal{O}(2^n)$. This is commonly patched up with…
Over the years, I picked up a number of tricks to optimize code. Today I’ll talk about one of them.
Please click or tap in the gray square below. It will fill with a jolly tableau of colored disks—first big blue ones, then somewhat smaller purple ones, and eventually lots of tiny red dots.
Pi in the sky: Calculating a record-breaking 31.4 trillion digits of Archimedes’ constant on Google Cloud
neural networks , convolutional neural networks , convolution , math , probability
This article is one chapter of my master thesis entitled “Design and implementation of a graphical user interface for git”. It describes the algorithm I designed to draw the commit graph in my own prototype git client called gitamine. I have adapted the content so that it fits better with this blog. Drawing graphs is…
From the highly eclectic blog of Mark Dominus
1. Introduction Shortly after the death of E.W. Dijkstra (1930-2002), K.R. Apt wrote an obituary under the title Portrait of a Genius [1]. At the time it seemed to me a bit over the top. Now, with …
The first task of the 21st Weekly Challenge was a very old one: to find (what would eventually become known as) Euler’s number.
Xoilac TV trực tiếp bóng đá HD hàng đầu Việt Nam, đường truyền ổn định, đa dạng link trực tuyến, đa dạng giải đấu, BLV chuyên môn cao và hoàn toàn miễn phí.
Do adventure games have dead ends? The author of The Teeny Tiny Mansion proves the absence of dead ends in that game via formal verification (in particular, with the help of the cbmc model-checking program ). Here I’ll demonstrate how to prove the same thing via Markov theory. The Markov approach requires more…
Preface The intended audience of this article is someone who knows something about Machine Learning and Artifical Neural Networks (ANNs) in particular and who recalls that fitting an ANN required a…
– Basketball Stats: Don’t model the probability of win, model the expected score differential.
We all lost a great person Cropped from Mexican NotiCyTI obit Héctor Garcia-Molina died just before Thanksgiving. He was a computer scientist and Professor in both the Departments of Computer Scien…
Last time we talked about free will, superintelligent predictors, and Dr. Evil planning to destroy the earth from his moon base. Today I'd like to talk about a more down-to-earth topic: time travel. The first point I have to make is one that Carl Sagan made: we're all time travelers—at the rate of one second per…
This post is a write-up of a solution to part of a programming puzzle I did yesterday. It’s a little different than the usual “solution + theory” approach, though: I’m going to talk about the actual steps you’d need to take to get to the solution (i.e. what to google, what intermediate code looks like, etc.). Often…