r/AskComputerScience • u/Advanced-Reindeer894 • Jul 17 '26
Can you write a program to predict what living things would do?
This is from a comment on lesswrong, and I just wanted to know if what was said in it is accurate, sorry for the length:
Agreed!
No, Rice's theorem is really not applicable. I have a PhD in programming languages, and feel confident saying so.
Let's be specific. Say there's a mouse named Crumbs (this is a real mouse), and we want to predict whether Crumbs will walk into the humane mouse trap (they did). What does Rice's theorem say about this?
There are a couple ways we could try to apply it:
- We could instantiate the semantic property P with "the program will output the string 'walks into trap'". Then Rice's theorem says that we can't write a program Q that takes as input a program R and says whether R outputs 'walks into trap'. For any Q we write, there will exist a program R that defeats it. However, this does not say anything about what the program R looks like! If R is simply
print('walks into trap'), then it's pretty easy to tell! And if R is the Crumbs algorithm running in Crumb's brain, Rice's theorem likewise does not claim that we're unable tell if it outputs 'walks into trap'. All the theorem says is that there exists a program R that Q fails on. The proof of the theorem is constructive, and does give a specific program as a counter-example, but this program is unlikely to look anything like Crumb's algorithm. The counter-example program R runs Q on P and then does the opposite of it, while Crumbs does not know what we've written for Q and is probably not very good at emulating Python. - We could try to instantiate the counter-example program R with Crumb's algorithm. But that's illegal! It's under an existential, not a forall. We don't get to pick R, the theorem does.
Actually, even this kind of misses the point. When we're talking about Crumb's behavior, we aren'tasking what Crumbs would do in a hypothetical universe in which they lived forever, which is the world that Rice's theorem is talking about. We mean to ask what Crumbs (and other creatures) will do today (or perhaps this year). And that's decidable! You can easily write a program Q that takes a program R and checks if R outputs 'walks into trap' within the first N steps! Rice's theorem doesn't stand in your way even a little bit, if all you care about is behavior after a fixed finite amount of time!
Here's what Rice's theorem does say. It says that if you want to know whether an arbitrary critter will walk into a trap after an arbitrarily long time, including long after the heat death of the universe, and you think you have a program that can check that for any creature in finite time, then you're wrong. But creatures aren't arbitrary (they don't look like the very specific, very scattered counterexample programs that are constructed in the proof of Rice's theorem), and the duration of time we care about is finite.
If you care to have a theorem, you should try looking at Algorithmic Information Theory. It's able to make statements about "most programs" (or at least "most bitstrings"), in a way that Rice's theorem cannot. Though I don't think it's important you have a theorem for this, and I'm not even sure that there is one.
the comment is from this post: https://www.lesswrong.com/posts/7tNq4hiSWW9GdKjY8/intuitive-self-models-3-the-homunculus#3_5_4_Why_are_ego_dystonic_things__externalized__
9
u/Somniferus Jul 17 '26
It is.
8
u/T_Thriller_T Jul 17 '26
Yes.
This is 100% accurate and hits the nail on the head.
I think the best thing in here is
This whole thing is _much mor _about the fact that Rice's Theorem is the completely and utterly wrong tool to use here then it is about the question whether or not we can predict whativing things would do.
(E.g. because living things by definition have a lifespan and infinity is a must for Rice's Theorem)
The whole point is not about predictability. A prediction has a certain margin of error - it's what will most likely happen.
We can very much predict the behaviour of living beings.
Rice's Theorem is more complex than that, due to two things:
So, in easier words: we're not trying to say for a specific setup something can or cannot happen - we're talking about all the setups that could ever be.
Which, again, loops back to: this is the wrong tool.
I'm not really up on "can we predict how rodents behave". What I do now is that for one given program (so assuming you have the exact behaviour of rodents programmed) we can most likely prove that it will show that the rodent will/won't go into the trap.
It is really important that we can do this. Because this is, for example, used in aviation to show that the current firmware of your plane will and can never just do "really bad thing that will instantly kill everyone".
1
u/green_meklar Jul 18 '26
You can write programs to make useful statistical predictions about the behavior of an organism or a multitude of organisms. Maybe you can predict with some degree of accuracy what species are most likely to go extinct soon, or the migration route of a particular whale, or something like that.
But fully simulating an organism down to the atomic level? That would require an immense amount of computation power, beyond anything we have; maybe too much to fit in the observable universe. And even if you could, it raises the question of what counts as a 'prediction'. If you're fully simulating the organism, then are you actually predicting the organism, or are you just observing a copy of it after the fact?
Glancing at the Wikipedia page, that seems correct. The theorem is about programs in general, or to put it another way, arbitrary programs, not specific subsets of all programs. There are definitely programs- and their behavior might seem quite complicated at times- whose behavior can be predicted by taking analytical shortcuts. (What portion of all programs are like this is a difficult question that tends to depend how you enumerate programs and runs into problems with infinity.)
In any case, I would point out that a mouse, for instance, doesn't have access to unbounded memory and therefore doesn't really have the general properties that make a program's behavior undecidable. That fact is unlikely to be of much practical use, though, insofar as the difficulty of predicting what a program will do scales ridiculously fast relative to the amount of memory it's allowed to use, and the information content of a mouse is high enough to make it a daunting problem.
I would warn you that theoretical results about computability are often of little practical use, and this is something that LessWrong-minded folks, in my experience, don't take seriously enough. They often prove abstract results and then take those results to inform their intuitions (or support their preconceived biases) about what works in the real world, whereas what works in the real world is often some kind of shortcut that has little to do with the abstract result. It is unlikely that the value of trapping any given mouse will ever be high enough to justify the construction of a perfectly reliable mouse-predicting computer; there are more efficient solutions to problems involving mice.
That sounds right, although the question of what qualifies as a 'prediction' (vs an after-the-fact observation of a simulated instance) still stands.
1
u/Aaron1924 Jul 18 '26
your entire argument is basically:
1
u/Saragon4005 Jul 17 '26
I suppose this depends on how much quantum mechanics happens in the nervous system. Because if it's a significant amount then it's truly random and impossible to predict introducing drifts over time.
1
u/stonerism Jul 18 '26
Rice's theorem just says you can't a priori answer questions about if an animal will walk into a humane death trap. You need more surrounding context and information.
However, that may be the case depending on the semantic context of the statement.
1
u/PvtRoom Jul 18 '26
you can completely write a program to predict what something will do.
your prediction can and most likely will be wrong.
-1
u/donaldhobson Jul 17 '26
> Let's be specific. Say there's a mouse named Crumbs (this is a real mouse), and we want to predict whether Crumbs will walk into the humane mouse trap (they did). What does Rice's theorem say about this?
The mouse contains a finite number of atoms, and is a finite size. Therefore the mouse is a finite state machine. And it's possible to predict the behavior of finite state machines out to infinite time, because eventually they halt or start looping.
In practice, mice don't live forever. So yes, it's theoretically possible for a computer to predict the mouse's behaviours. Or at least, rice's theorem doesn't get in the way.
Chaos theory + quantum "uncertainty" can get in the way. But under the many worlds interpretation, a quantum coinflip just splits the universe into 2 superimposed states. This is deterministic and predictable.
The main problems are
I can't see the comment's you are responding to, but you seem to be correct about rice's theorem and what it doesn't say.