Darts, Dice, and Coins: A beautiful article on a beautiful algorithm
Earlier this year, I asked a question on Stack Overflow about a data structure for loaded dice . Specifically, I was interested in answering this question:
The latest blog posts to take off on Hacker News. 75 posts.
Earlier this year, I asked a question on Stack Overflow about a data structure for loaded dice . Specifically, I was interested in answering this question:
Take a look at this Perl regular expression: perl -lne '(1x$_) =~ /^(11+?)\1+$/ && print "$_ is composite"' This regular expression matches only the composite numbers (and doesn't match prime numbers). Can you figure out how it works? I'll give the explanation below but try to figure it…
<img src="http://stevehanov.ca/wavelet/cup.png"/> Let's say you have millions of pictures of faces tagged with names. Given a new photo, how do you find the name of person that the photo most resembles? <p> In the cases I mentioned, each record has hundreds or thousands of elements: the pixels in a photo, or patterns…
A detailed explanation of Bézier curves, and how to do the many things that we commonly want to do with them.
Intro Fuzzy search algorithms (also known as similarity search algorithms) are a basis of spell-checkers and full-fledged search engines lik...
For twenty years, the fastest known algorithm to multiply two n-by-n matrices, due to Coppersmith and Winograd, took a leisurely O(n2.376) steps. Last year, though, in his PhD thesis, Andrew Stot…
This idea is a complete rip off an article that appeared in Wired a little while ago and it got me thinking what would my list for Compu...
Hi. I think math is really cool, but, most people (sadly) don't think so. This includes many programmers who in fact enjoy many of the sam...
Every time you shuffle a deck of playing cards, it's probably a unique order, never before seen in human history.
I was looking at my Google Calendar tonight and I realized that this software was encouraging a way of thinking about time which has signifi...
This paper appeared in Communications of the ACM in April 1960. It is the original paper on Lisp.
Fair Coins are the currency of Userland. A Fair Coin flips fifty-fifty with mathematical exactness. In the real world most coins are pretty fair, but you never know whether there might be a small bias to one side or another. This presents Lauren Ipsum , a girl who's lost in Userland, with a problem. No one wants her…
physics, history of science, pseudoscience, hoaxes, writing, education, skepticisism, humor, quotes, illusions, 3d stereo photography.
I'm no graphics expert, but appreciate why square roots are useful. The Pythagorean theorem computes distance between points, and dividing by distance helps…
Lately, there has been a lot of experimentation with very short programs that synthesize something that sounds like music. I now want to sha...
Like many in operations research, my research interests often creep over into my everyday life. Since I work on scheduling issues, I get particularly concerned with everyday scheduling, to the consternation of my friends and family (“We should have left six minutes ago: transportation is now on the critical path!”)…
There's a great deal said about Ada, Countess of Lovelace that I find misguided. And, worse, the real intellectual triumph of Lovelace is ...
A crit-bit tree can be used as a high-speed associative array. For example, an array mapping 54 to 1, 19 to 2, 99 to 3, 85 to 4, and 88 to 5 can be stored as a crit-bit tree containing 54=1, 19=2, 99=3, 85=4, and 88=5. The smallest string in the crit-bit tree larger than 85= is 85=4.
There are two kinds of latitude: geocentric and astronomical. On a perfect sphere, they're the same, but on an oblate spheroid like Earth they're different.
Here are ten things about numerical linear algebra that you may find surprising if you're not familiar with the field. Numerical linear algebra applies very advanced mathematics to solve problems that can be stated with high school mathematics. Practical applications often require solving enormous systems of…
This is the final article in my three-part look at symmetry reduction algorithms for speeding up pathfinding on uniform-cost grid maps. Recapping the story so far: Part one introduces the notion of…
Though it contains forms only for function applications, variable references and anonymous functions, it is equivalent to a Turing machine.