-
Website
http://20bits.com -
Original page
http://20bits.com/articles/facebook-job-puzzles-korn-shell/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
prissypot13
3 comments · 1 points
-
Felix Purnama
4 comments · 1 points
-
hadley
2 comments · 1 points
-
adamheroku
2 comments · 3 points
-
twiss
2 comments · 1 points
-
-
Popular Threads
Thanks.
Oh, for sure. I don't think anyone is claiming they're anything more than puzzles (although Landau's function is not without its uses). But it does demonstrate ones ability to reason analytically and translate that reasoning into code.
I solved the problem on a lazy afternoon last year, and was curious about its origins and other solutions, and I came across your page. The origin as far as I can tell is an ancient 70s paper entitled "Control Structure Abstractions of the Backtracking Programming Technique". They called the problem "Malicious Secretary" (IMHO, a much better title than the misleading "Korn Shell")
In the general case we're not computing partitions of 26, but rather the value of Laundau's function. We only have to consider partitions of 26 because we're left with too few letters to fill each cycle.
Also, in the general case, I'm talking about cycles in permutations rather than partitions. Why I list 4 rather than 5 is a side-effect of the mathematical notation: cycles of length one are left out. Thus, up to conjugation, the permutation of interest is (1..4)(5..9)(10..16)(17..25). At least, that's how we'd write it in group theory.
So, IOW, if we have at least four distinct letters we can put one in each of those cycles, producing a game that lasts 1260 rounds. That the fifth, single-element cycle is left unfilled has no impact, as you said.
As for the name, I got it from Facebook. Blame them. :P
http://www.google.com/search?q=0xFACEB00C+%2F+4...
Your solution makes for interesting reading -- thanks for writing it up.
Here's my own page on 0xFACEB00C >> 2 in decimal.
I thought I found a solution that didn't require a full search of the problem space. Guess I was too clever.
Know of any papers that outline an efficient algorithm for calculating Landau's function?