15/03/2016
When you’re studying algorithms, there is a number of series and expression that keep showing up. A while ago, I discussed the special form
. But that’s not the only one. Another form that keeps showing up is
.
We can look the particular form this sum takes for specific
in some compendium (like CRC’s tables and formulae, that have seen 30-something editions over the last half century), or… you can find the formula yourself. It’s a bit tedious, but not that complicated.
Read the rest of this entry »
Leave a Comment » |
Mathematics | Tagged: Piskunov, powers, Sum of powers, sums |
Permalink
Posted by Steven Pigeon
01/03/2016
Suppose you want to draw randomly a number between 0 and 1, with multiple throws of a six sided dice, what would you write down on its face?

Read the rest of this entry »
Leave a Comment » |
Mathematics | Tagged: dice, random, six sided dice, uniform random |
Permalink
Posted by Steven Pigeon
23/02/2016
In the course of analyzing an algorithm, I used the simplifying hypothesis that the cost function is
.
That expression is cumbersome but we can get a really good simplified function to use as a proxy. Let’s see how.
Read the rest of this entry »
Leave a Comment » |
Mathematics | Tagged: approximation, Logarithm, n!, Stirling's series |
Permalink
Posted by Steven Pigeon
26/01/2016
So I’m still writing lecture notes. This time, I need to include kind of larger pieces of C or C++ code, and
environments do not really help me a lot. Some are better than others, but you still have to escape and fancify text yourself. This is laborious and error-prone, and is an obvious target for automation. A script of some sort. The task isn’t overly complicated: highlight keywords, and escape symbols like { } _ and & that make
unhappy. This looks like a job for
sed.
Read the rest of this entry »
2 Comments |
C, C-plus-plus, hacks, LaTeX | Tagged: bash, grep, LaTeX, poor man's bold, sed |
Permalink
Posted by Steven Pigeon
19/01/2016
We all know about binary search. It’s been with us such a long time. Knuth thinks it’s first appearance in print is in the Moore School Lectures, in 1946. The technique search for an item in a list by halving, iteratively, the searched portion. Its complexity is
for a list of
values, making it a very efficient algorithm for searching.
One may even be tempted to think that it’s in fact optimal, that we can’t do significantly better. Is that so?
Read the rest of this entry »
Leave a Comment » |
algorithms, data structures | Tagged: Binary Search, complexity, interpolation, Interpolation Search, PoC, search |
Permalink
Posted by Steven Pigeon
12/01/2016
When I write papers or other things, I tend to create separate bib files, so that I don’t end with a giant unsearchable and unmaintainable blob. Moreover, topics tend to be transient, and the bibliography may or mayn’t be interesting in a few year’s time, so, if unused, it can safely sleep in a directory with the paper it’s attached to.

But once in a while, I need one of those old references, and since they’re scatted just about everywhere… it may take a while to find them back. Unless you have a script. Scripts are nice.
Read the rest of this entry »
Leave a Comment » |
Bash (Shell), hacks, LaTeX | Tagged: bibliography, Bibtex, grep, sed |
Permalink
Posted by Steven Pigeon