algorithm design and recursion the input terminates when given itself as input the pass statement actually does nothingif the terminates function returns trueturing py will go into an infinite loop okthis seems like silly programbut there is nothing in principle that keeps us from writing itprovided that the terminates function exists turing py is constructed in this peculiar way simply to illustrate point here' the million dollar questionwhat happens if we run turing py andwhen prompted to type in programtype in the contents of turing py itselfput more specificallydoes turing py halt when given itself as its inputlet' think it through we are running turing py and providing turing py as its input in the call to terminatesboth the program and the data will be copy of turing pyso if turing py halts when given itself as inputterminates will return true but if terminates returns trueturing py then goes into an infinite loopso it doesn' haltthat' contradictionturing py can' both halt and not halt it' got to be one or the other let' try it the other way around suppose that terminates returns false value that means that turing pywhen given itself as input goes into an infinite loop but as soon as terminates returns falseturing py quitsso it does haltit' still contradiction if you've gotten your head around the previous two paragraphsyou should be convinced that turing py represents an impossible program the existence of function meeting the specification for terminates leads to logical impossibility thereforewe can safely conclude that no such function exists that means that there cannot be an algorithm for solving the halting problem there you have it your boss has assigned you an impossible task fortunatelyyour knowledge of computer science is sufficient to recognize this you can explain to your boss why the problem can' be solved and then move on to more productive pursuits conclusion hope this has given you taste of what computer science is all about as the examples in this have showncomputer science is much more than "justprogramming the most important computer for any computing professional is still the one between the ears hopefully this book has helped you along the road to becoming computer programmer along the wayi have tried to pique your curiosity about the science of computing if you have mastered the concepts in this textyou can already write interesting and useful programs you should also have firm foundation of the fundamental ideas of computer science and software engineering should you be interested in studying these fields in more depthi can only say "go for it perhaps one day you will also consider yourself computer scientisti would be delighted if my book played even very small part in that process summary this has introduced you to number of important concepts in computer science that go beyond just programming here are the key ideasone core subfield of computer science is analysis of algorithms computer scientists analyze