What exactly is the halting problem?

前端 未结 22 772
时光说笑
时光说笑 2020-11-29 00:01

Whenever people ask about the halting problem as it pertains to programming, people respond with \"If you just add one loop, you\'ve got the halting program and therefore yo

22条回答
  •  一个人的身影
    2020-11-29 00:21

    From Programming Pearls, by Jon Bentley

    4.6 Problems

    5. Prove that this program terminates when its input x is a positive integer.

    while x != 1 do
        if even(x)
            x = x/2
        else
            x = 3*x +1
    

提交回复
热议问题