Surely we could optimize the return value with a switch statement and store the result as an integer to hide the compiler warning about our clearly correct code:
internal static bool AreBooleansEqual(bool orig, bool val)
{
int result;
if(orig)
{
if(val)
{
result = 0;
}
else
{
result = 1;
}
}
else
{
if(val)
{
result = 1;
}
else
{
result = 0;
}
}
switch (result)
{
case(1):
return true;
case(0):
return false;
default:
return AreBooleansEqual(orig, val);
}
}
New LOC: 35
The proof assumes that the monkeys mash the keys at random and that there is a nonzero probability to write any chunk of text appearing in Shakespeare’s works. If there is a section that the monkeys cannot generate, for example if we removed the letter ‘e’ from their typewriter, the monkeys will never write the complete works of Shakespeare regardless of the amount of time spent on it, so their point still stands and it depends on the assumptions you make about the monkey typists’ typing skills.