Lecture 41/65: Halting Problem: A Proof by Reduction

Поділитися
Вставка
  • Опубліковано 18 гру 2024

КОМЕНТАРІ • 37

  • @leepaludan6947
    @leepaludan6947 8 років тому +77

    You're a wizard harry

  • @Samuel-wl4fw
    @Samuel-wl4fw 5 років тому +22

    My understanding of the logic:
    We assume that a turingmachine R that solves haltTM exists, ie. a turing machine that accepts if something halts and rejects if it loops forever.
    If R exists we can also solve Atm.
    Before Atm runs its input, we throw the input in R, if R rejects, ie. it is a input that loops forever, then Atm should also reject. If R accepts, then Atm can run the input it tested on its own turing machine. Since it Atm is garanteed by R that it will not loop, we know that Atm will not loop, it will either accept or reject. This means that Atm is decidable. We know from previous proofs that Atm is not decidable so the fact that with R we can make Atm decidable means that R cannot be a correct assumption. Thereby we have proven that R which had to exist for haltTM to be decidable does not exist, and therefore haltTM is not decidable. Proof by contradiction.

  • @성현박-w2l
    @성현박-w2l 4 роки тому +2

    My understanding:
    We use the reduction proof. This means:
    We assume that there exists M such that it "decides" HALTtm. With this assumption, we can generate M' such that it "decides" Atm.
    If there is an input for M such that w is a machine and s is a string, M returns true if w halts on the input string s. So let's assume that M returned true. Also, we know that M itself does not loop (since M is a decider - that's just the definition of a decider) - meaning it always returns true or false.
    With the facts that M returned true (which means w halted on input string s), we can say that there are three possible outcomes for M' on the input :
    1. M' either accept since w is a Turning Machine that accepts s, or,
    2. M' rejects since w is a Turing Machine that rejects s.
    3. M' rejects since the input is invalid (i.e. w is not a Turing Machine, wrong format, etc)
    This is a full functioning algorithm that M' follows IF M returns true for an input . Now, let's look at what happens if M returned false.
    If M returned false, then that means the machine M from the input does not halt on M. In other words, it loops endlessly. If M loops, then M must return false. So when is fed to M', M' recognizes the input as invalid. Therefore, M' rejects.
    Here, we have correctly created an algorithm for the decider M' which accepts and rejects any scenario for M' without looping. We already know that M' is impossible since Atm is not decidable. Thus, the fact that we were able to derive perfect M' with our initial assumption that there exists a decider M for HALTtm tells us that our initial assumption was wrong - meaning that there does NOT exist a decider M for HALTtm.
    In other words, a machine that recognizes HALTtm is undecidable.

  • @johnhills8922
    @johnhills8922 5 років тому +3

    Very well put. I was lost reading my class notes until watching this video, but amazingly it is all clear now and I can move on more prepared to handle other reduction proofs. Awesome stuff! Thank you very much!!

  • @jphamzz
    @jphamzz 7 років тому +53

    still lost. but thank you

  • @real-investment-banker
    @real-investment-banker 4 роки тому +7

    Pictorial representation of what sir is trying to explain : imgur.com/a/fEwWglU
    Another way to prove halting problem by reducibility :
    First of all I'll try to explain what reducibility means :
    a) Reducing a harder problem to an easier problem gives us the flow of decidability, meaning : Suppose we're reducing A to B, then if A is known undecidable problem then B is also undecidable. And if B is known decidable problem then A is decidable. You cannot say B is decidable if A is decidable or A is undecidable if B is undecidable.
    (Attached an image at bottom to make it clear)
    Now after clearing the terminology
    Let's actually understand what reducibility actually means here in decidability :
    We're reducing A to B,
    Now assuming there's an algorithm or decider for B, we're gonna try to use that algorithm to make an algorithm for A. Thereby reducing A to B.
    Now coming to the case of reducing Acceptance problem (undecidable) to halting problem and trying to say that halting problem is also undecidable.
    Suppose you say that halting problem is decidable, then this means that you've an algorithm or decider 'R' (as any algorithm at the end can be described as a language which in turn can be made into TM). We will use this decider R to form another decider S which will decide the acceptance problem.
    Step 1 : You're given an input { | where M is a TM and w is an input to that TM}.
    We will create another M' Turing machine which will be fed this input and it will take M from this input and will introduce an infinite loop to all the non-accepting state. And this can be done in polynomial time(because reduction has to be done in polynomial time)
    Now we will feed this

  • @jinganqu2040
    @jinganqu2040 9 років тому +1

    Your videos are amazing, they really solve a lot of problems of this class, and everything is clear! You share with us for free, how nice your are!!!!!
    Thank you sooooooooo much!

  • @angieh26o
    @angieh26o 8 років тому +6

    This is amazing! Top quality videos, seriously :)

  • @adamcomerford8502
    @adamcomerford8502 4 роки тому +1

    In high-level language:
    A_tm is undecidable because it can potentially loop infinitely (never halt)
    R can decide whether or not an input, w, causes M to halt.
    If R decides that M(w) halts, then we can use that to decide A_tm as we have cleared the condition that M(w) will not loop infinitely.
    As A_tm is undecidable, that means that R cannot possibly do the job it claims to have done.

  • @michaeltsang1748
    @michaeltsang1748 3 роки тому +1

    This actually makes things a lot easier to understand.

  • @Pignemo
    @Pignemo 9 років тому +5

    How can you say that the accepting problem reduces to the halting problem formally? I can understand that they're similar intuitively but could you be more precise?

  • @brucewayne3141
    @brucewayne3141 2 роки тому

    so the logic goes like this:
    we are reducing ATM to HALTTM. Assuming there's a decider S that decides ATM. then we construct a subroutine R that decides if halts. If the input halts, accept. If not, reject. Then we have S that accepts R if R accepts (meaning on input R halts) and reject if R reject (meaning loops). Now we've built a decider for ATM, but since we've proven ATM is undecidable, the whole S is a decider with R as a subroutine thing fails, thus meaning R cannot be a decider for HALTTM either.

  • @tefazDK
    @tefazDK 9 років тому +8

    When you say "If M loops then => reject" How come the proof doesn't just stop there? Couldn't we already know at this point that you cannot reject on something that loops because you can not check whether or not something is looping or just taking a long time to calculate?

    • @mycloud3138
      @mycloud3138 9 років тому +1

      +TeFaZ , he assumed at some point that there is some methodology like a "time limit" given for that "M" machine to operate within and return a result. If for example it exceeded that time set, then we will consider that it has gone into an infinite loop. Theoretically, your words are correct as we already proved that its not possible to decide whether a TM is looping or it just did not have enough time to do the computation, but in end, its all assumptions he made in this video, so you can agree on making some intentionally made mistakes to conclude a contradiction.

    • @aaronweiss3294
      @aaronweiss3294 5 років тому

      The point was to prove that halt() is not decidable without having to prove it from first principles, and instead use an already proven undecideable language/problem through reduction

  • @pavelr3119
    @pavelr3119 4 роки тому +7

    "I think it is easy to get lost in the details..." and the author continues by providing even more details

  • @IBuddyH
    @IBuddyH 4 роки тому

    In 2:28 aren't we reducing the HALTtm to the Atm?
    If I'm incorrect, than my understanding is when proving HALTtm we found out it to be the reduced problem of Atm, and since Atm is undecidable, HALTtm is undecidable

  • @humzamohammad1760
    @humzamohammad1760 9 років тому +3

    Thank you so much for these videos.

  • @redrodlrowon
    @redrodlrowon 2 роки тому

    Thank You so very much. Wonderfully clear explanations.

  • @ketedenporkul0
    @ketedenporkul0 6 років тому

    You are my fucking hero. I have trying to understand this for days, came here, saw the video twice and...voila!!

  • @bapple7844
    @bapple7844 4 роки тому

    Simply brilliant

  • @bhaveshsuhagia
    @bhaveshsuhagia 8 років тому

    Why does M never loop when we simulate M on input w after constructing the reducer?

  • @zephyrliu8833
    @zephyrliu8833 5 років тому

    Contract a 2 input function into an 1 input function, then into a 0 input function(feed function to itself. This is how I memorize the key process.

  • @Justxn
    @Justxn 4 роки тому

    Thank you

  • @whipit2404
    @whipit2404 3 роки тому

    Hmm, I feel like this proof uses its conclusion as one of its premises...

  • @narendraparmar1631
    @narendraparmar1631 5 років тому

    Thanks sir

  • @sdcfewyt3926
    @sdcfewyt3926 7 років тому

    wrg, no such thing as undecidable langx, not expresx all probx as langx, express anyx by anyx no matter what and it'd be perfx, no such thing as langx. can decide

    • @DarkLordAli95
      @DarkLordAli95 7 років тому

      before you criticize, learn to type properly.