Answers to 8.1.1 b and c
b)
Take any govien program and change it so that all output goes into an
array. Once the probram outputs 12 characters, check to see if it is
"hello, world", if it is print this out and exit, otherwise just exit.
Now if we give this to a program that can detect if a program will
produce any output then it will be able to decide if a program will
print out "hello, world", however we know that the problem is
undecidable therefore a program to detect if a program outputs
anything must also be undecidable.
c)
Take a program that prints "hello, world" and exits as is given in
Figure 8.1. Make this program P2, take any given program and tranform
it in the same way as described in b) and make that program P1, now if
we have a program that can detect if P1 has the same output as P2,
then we have a program that can detect if a program prints "hello,
world", but we know that this is undecidable, therefore it must be
undecidable to detect if two programs produce the same output.