The answer is that it's theoretically impossible
to compute this for an arbitrary sequence.
The first answer is not correct.
If S is truly random, this would be correct.
But if S is not truly random, there might be some shorter way to compute it.
So this gives the maximum value of the Kolmogorov Complexity
of sequence length S.
And an example of such a program would just be this Python program,
that would be the program "print" + S.
That would print out the sequence S.
It's length would be the length of S plus the 5 characters for the print
plus 1 for the space.
But that doesn't prove that there isn't a shorter program that can produce S.
The trick in the second answer is this part.
This assumes that we can execute P to completion.
In order to do that, we would need to solve the halting problem.
We would need to know that P will either never finish
or know how long to wait to keep running P.
So we can't actually do this step.
This might run forever; this loop may never finish.
So we would never learn the result. So that's why this doesn't work.
This is not enough to prove that it's impossible,
because maybe there's some other way to do it.
And I'm not going to go through
how we actually prove that the Kolmogorov Complexity is uncomputable,
but I'm going to show you a paradox that will give you a little bit of an idea
why that is.
The paradox is known as the Berry Paradox.
What the paradox asks is,
"What is the smallest natural number--"
and by that I mean the set of numbers 1, 2, & 3--
sometimes we'll design it starting from 0--
the paradox would work just as well either way--
"that cannot be described in eleven words?"
So this seems like a reasonable question.
We can define the set of numbers that cannot be described in eleven words.
It seems like a perfectly reasonable description of a set.
It's also a case that any set of natural numbers
has the smallest element.
The numbers are well-ordered, so whatever that set is,
there must be some smallest number.
So that means there should be an answer to this question--
that there is a smallest number that cannot be described in eleven words.
And I'm going to describe it for you.
Here's my description.
And my description has 1-2-3-10-11 words.
So I just described the smallest natural number
that cannot be described in eleven words,
but I've described it in eleven words.
So that suggests that no such number exists,
but that contradicts the properties we had before.
That's why this is a paradox.
This is certainly not a proof that the Kolmogorov Complexity is undecidable,
But it should give you some sense of how we might prove that.
