phimuemue
This is a small site mostly concerning mathematical and programmingrelated problems. I hope you discover something useful!
Newest posts

Expected number of cycles in a random permutation  March 20, 2014
Once again a random experiment and an associated random variable: We generate a random permutation and are interested in the expected number of cycles.

Bird tree  March 16, 2014
I came across a very nice method of enumerating the positive rational numbers based on a particular tree. This post explains how this tree is constructed and shows that actually all positive rational numbers are contained in this tree.

A (pure) C extension  March 12, 2014
Over three years ago, I came across a little problem and was able to write a header file for C++ that allowed the programmer two write things like the following:
10 times { do_something_here(); }
This did exactly what you would expect from what it read. Additionally, the implementation had support for an implicitly generated counting variable denoted by a single underscore. The only drawback: It was only for C++.
Now, over three years later, I can claim that I have found a way to implement (at least to some extent) the original thing in pure C.

Finding all paths  October 23, 2013
Consider the following problem: You are given a twodimensional array of integers and you are allowed to place a chess king on one of the arrays. The king can move in any of the eight directions at a time and you want to know how many (simple) paths this king can go that satisfy that the corresponding numbers are strictly increasing and that end in an even number.
As an example, consider the following array:
0 1 2 3
In this array, we have the paths
[0], [0 1 2], [0 2], [1 2], [2]
(strictly increasing and ending in an even number). 
A hiring problem  September 28, 2013
Imagine the following scenario: You want to hire a new employee, and of course you want to take the best candidate. Therefore, you conduct a series of interviews with the candidates one after another. We now impose the following restriction: You have to tell the candidate whether he or she is good enough or not (i.e. if you want to hire him or her) directly after the interview. That is, once you told a candidate you hire her or him, the interview process is over and you do not interview any more candidates. And once you told a candidate you won't hire her or him, this candidate is away and can not be hired anymore. We now consider a strategy to solve this problem: We hire a candidate if he or she is better than the expected value of the best of all following candidates. If there are no more candidates, we have to hire the last candidate.
...or you can find more in the archives.