A note about the scoring system
In the sandbox, several people had an intuition that the optimal answers to this challenge will take the form of compressing the shakespeare.txt
file and outputting it deterministically. However, the scoring system has been carefully chosen so that this strategy will not be optimal. If you have a stochastic solution then in theory you can turn it into a perfect deterministic solution, at the cost of adding -log2(p(program outputs shakespeare))
bits of code into your program. This extra code decreases p(monkey outputs program)
by exactly the same factor that it increases p(program outputs shakespeare)
, resulting in zero change to the overall score.
But this is the absolute best you can do. Any real encoding will be less than perfect, so in reality the net result of such a strategy will be to slightly decrease the score. Because of this, it's likely that the most competitive answers will be stochastic. However, deterministic, compression-based answers are permitted and are welcome to complete, as long as they meet the spec.
One commenter had an intuitionOn the off chance that I'm wrong about the optimal solutionproperties of the scoring system, I intend to battle-test this challenge before I post it. To do this I will beimplement (i) the obvious illegal solution using bzip2 to compress the shakespeare.txt
filewhole text, and output it deterministically(ii) the not-quite-so-obvious illegal solution using bzip2 to stochastically predict the next character from the ones already received, so that this ends up just beingwithout including a kolmogorov-complexity challenge. I'm fairly certain that isn'tcompressed version of the casetext in the code. I expect solution (ii) to beat solution (i), for information-theoreticthe reasons described in the last section of the question. However, I will testIf it beforedoesn't I postwill either give up on the challenge: if I can't write or add a submission that beatsfudge factor into the obvious bzip-based solution then I will notscoring system to give slightly more reward to stochastic solutions.
I'll also post a sample answer (legal but not very competitive), in order to address the challengepoint about the spec being a bit daunting to understand.
I'm unsure about the rule banning built-in compression algorithms. It seems more elegant to leave it out, butand it would still be a meaningful challenge without that rule. But in Paint Starry Night, objectively, in 1kB of code theyoff-the-shelf compression spoiled the fun a bit, and I'm worried that with this scoring system the same could happen here. I'm happy to hear any thoughts about that.
Finally, a very specific query: the ban on word tables seems like it would rule out some golfing languages. I don't want to rule them out any languages but don't want to open the floodgates either, so if someone can think of a good middle ground it would be helpful.