Questions: Rice's Theorem

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A software company wants to build a tool that, given any program P, definitively answers 'yes' or 'no': 'Will this program ever throw a NullPointerException on any input?' According to Rice's theorem, is this possible?

AYes — null pointer exceptions are a well-defined runtime behavior that any modern compiler can detect statically.
BNo — whether a program throws a null pointer exception is a semantic property, and since it is non-trivial, Rice's theorem guarantees it is undecidable.
CYes, but only for programs under a certain size — above that size, the problem becomes undecidable.
DNo — but only because null pointer exceptions depend on runtime input, which is inherently unpredictable.
Question 2 Multiple Choice

Which of the following questions about a program is decidable?

ADoes this program halt on all inputs?
BDoes this program output a prime number on input 17?
CDoes this program have exactly 47 states in its Turing machine description?
DDo this program and a reference program compute the same function?
Question 3 True / False

Rice's theorem implies that no algorithm can decide whether two arbitrary programs compute the same function.

TTrue
FFalse
Question 4 True / False

Rice's theorem proves that most properties of programs — including syntactic properties like code length or number of variables — are undecidable.

TTrue
FFalse
Question 5 Short Answer

Why must every practical static analysis tool (type checkers, linters, bug finders) be either incomplete or unsound, according to Rice's theorem?

Think about your answer, then reveal below.