Тёмный

Undecidability of the Halting Problem 

Neso Academy
Подписаться 2,6 млн
Просмотров 254 тыс.
50% 1

TOC: Undecidability of the Halting Problem
Topics discussed:
This lecture shows how can we prove the Undecidability of the Halting problem.
Contribute: www.nesoacademy...
Website ► www.nesoacademy...
Forum ► forum.nesoacade...
Facebook ► goo.gl/Nt0PmB
Twitter ► / nesoacademy
Pinterest ► / nesoacademy
Music:
Axol x Alex Skrindo - You [NCS Release]

Опубликовано:

 

7 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 138   
@yuqian822
@yuqian822 5 лет назад
Proving Atm is not decidable is a hard problem. And it could be confusing. However, can people please be polite and respectful? Some comments are so RUDE. This RU-vidr spent time to make this video for free.
@sujatasharma562
@sujatasharma562 4 месяца назад
Every person in neso academy have such a great voice 😂🩷
@userwhatever3298
@userwhatever3298 3 года назад
H eats a program and an input and always tells you if the program will loop or halt given that particular input. H(x,y) = LOOP/HALT H is a subprogram of C. It gets the exact same inputs that C gets. C also eats a program and an input. It is programmed to contradict H. It loops if H says HALT, it halts if H says LOOP. We feed C to itself. So the inputs are program C with input c (or any code, it doesn't matter). If H(C,c) says that C(C,c) will halt then C(C,c) will loop. If H(C,c) says that C(C,c) will loop then C(C,c) will halt. We have a paradox so the machine H cannot exist and terminators are chasing Alan Turing in the past for some reason.
@Thahira-yc2ys
@Thahira-yc2ys 10 месяцев назад
But, its because of our program c na? Didn't we write so? Why are we saying it is contradiction at last instead of the time we write it initially as C.
@drainedzombie2508
@drainedzombie2508 9 месяцев назад
@@Thahira-yc2ys yeah. exactly my doubt too
@theboneman7493
@theboneman7493 3 месяца назад
Thank you for the explaination! I was getting pretty confused until you explained it further
@niteshswarnakar
@niteshswarnakar 3 года назад
alan turing to schrodinger : It will halt and not halt at the same time :)
@akankshasharma7498
@akankshasharma7498 3 года назад
It is funny that some people think Quantum computer can solve the halting problem
@niteshswarnakar
@niteshswarnakar 3 года назад
@@akankshasharma7498 I find it possible by quantum computer because the property of Q-bits, you tell me why do you find this funny ?
@akankshasharma7498
@akankshasharma7498 3 года назад
@@niteshswarnakar my bad, missed a "comma" 😩. I meant the conversation between Turing and schrodinger, you wrote about, is 2× funny acknowledging some people think that Quantum computers can solve the haunting problem
@akankshasharma7498
@akankshasharma7498 3 года назад
@@niteshswarnakar if I may ask, why do you think that Quantum Computer can solve the haunting problem? I don't have an opinion on that btw, in the morning I think they can, by the night I think they can't 🤣🤣🤣🤣🤣. It is "undecidable" for me 🤣🤣🤣
@niteshswarnakar
@niteshswarnakar 3 года назад
@@akankshasharma7498 well your undecidable thought is actually funny for me. Thank you for the response :)
@ramchandrakedari8655
@ramchandrakedari8655 2 года назад
You teach better than my IIT professor , thanks a lot
@jonaszhang4129
@jonaszhang4129 3 года назад
After watching tons of video about halting problem, this one finally makes much sense to me! thanks!!!!
@Midna81
@Midna81 4 года назад
I've watched other videos on this same topic, but finally after watching this video combined with its predecessor "The Halting Problem", I think I've finally understood it. Thanks!
@tanyasharma5003
@tanyasharma5003 3 месяца назад
Best lecture !! So helpful 😃 thank you so much ❤️❤️
@alexrubio40
@alexrubio40 4 месяца назад
This is the best explanation of the halting problem. Thank you
@yetu0983
@yetu0983 5 лет назад
tnxs sir i love NESO ACADMEY YOUR VOICE IS EASY TO LEARN
@vibsh625
@vibsh625 5 лет назад
Running C on C as input halts, but the reason why it halts is because the machine H(which basically checks whether it halts) says that it doesn't. That is why machine H is wrong. Took a fkin semester to understand 😆
@AmitSingh-1916
@AmitSingh-1916 3 года назад
what if i write in if return and in else loop forever?? i think i didn't understand this can u help?
@ajayjangid1898
@ajayjangid1898 3 года назад
@@AmitSingh-1916 But we have to show it is wrong so by that particular thing we showed H is wrong now in general we cannot say H exist for such question
@vyshnanp2479
@vyshnanp2479 5 лет назад
Thank you so much sir.
@patricechaula3430
@patricechaula3430 Год назад
Neso Academy you are the best 👏
@pseudonetwork2581
@pseudonetwork2581 2 года назад
what if you program the sub program C(x) to halt when H(x,x) halts and to not halt when H(x,x) does not halts. In that case, there won't be any paradox and wouldn't this machine be possible to make? I am confused.
@quantumsoul3495
@quantumsoul3495 7 месяцев назад
If you suppose H exists, then you create C and C(C) is absurd, so H shouldn't exist
@justacoolguy5296
@justacoolguy5296 4 месяца назад
i might be 1 year late but i'll still try, pretty sure it is because a program that does not halt is impossible just like we saw in the video (i guess it's because it has to run infinitely to give a conclusion that it doesn't halt cuz that's the meaning of not halting)
@sz-vn2oe
@sz-vn2oe 5 лет назад
If it halts, then it will not halt but if it will not halt, then it will halt :(
@maxbojorquez8579
@maxbojorquez8579 4 года назад
This is all based on contradiction. If we pass C itself theres twos options, either halting or not halting. If it halts it will loop forever and if it's not halting it will halt. In my head it makes sense
@weichen4275
@weichen4275 Год назад
You save my life!
@janisidd2101
@janisidd2101 3 года назад
Thanks you soo much nesco for helping me in my papers preparation
@timlee8717
@timlee8717 3 года назад
I like this lecture very much. I have got a lot from it.
@bidyutbaranchowdhury4004
@bidyutbaranchowdhury4004 5 лет назад
During the algorithm loop forever is written in the if part....if we are halting for an input then why do we need to write an infinite loop in the body of the program??? Please explain....
@LasradoRohan
@LasradoRohan 4 года назад
It is an independent statement. example: for(int i=5; i>=0; i++);
@sadhnasharma1000
@sadhnasharma1000 3 года назад
@@LasradoRohan no but why we need to write this loop only can't we write some loop which will terminate please can you explain I would be glad to know the answer
@KahHongTan
@KahHongTan 2 года назад
@@sadhnasharma1000 because we want to show that there is a contradiction, and the only way to do that is if there is a loop (i.e. does not halt) for when H(X,X) says the program will halt. So it has to be opposite to the result of H(X,X).
@NirajSingh-nv2jb
@NirajSingh-nv2jb 6 лет назад
Sir, all of you are doing extremely well .Also if possible please upload videos on operating system in this session. Its really impt topic in engineering subject.
@BalaguruS-zp5qf
@BalaguruS-zp5qf 2 года назад
can u pls give answer for this question "Prepare a subroutine to move a TM head from its current position to the right, skipping over all 0’s until reaching a 1 or a blank. If the current position does not hold 0, then the TM should halt. You may assume that there are no tape symbol other than 0,1 and B(blank). Then , use this subroutine to design to TM that accepts all strings of 0’s and 1’s that do not have two 1’s in a row"
@baoxinliu9150
@baoxinliu9150 6 лет назад
Sir, I have a question that all your proof is based on the function H(x,x), what if you switch the branches? I mean if(H(x,x)==halt) then return; else loop forever? In this case, there is no contradiction.
@mohitshresthanep
@mohitshresthanep 6 лет назад
If you find a single counterexample or contradiction to a given property, then that property is false. In this case, we have the counterexample in the video already, there's no need to consider the case where the branches are switched. If you consider the case where you do switch the branches, no, there isn't a contradiction, but that still doesn't tell us anything about the nature of H.
@adityaraj5678
@adityaraj5678 5 лет назад
@@mohitshresthanep Okay.But if u consider the situation logically if(H(x,x)==halt) ,then it should return not loop forever
@niteshsarraf7453
@niteshsarraf7453 5 лет назад
@@adityaraj5678 If H exists, it should be able to work for all kinds of inputs. One of the inputs is the program C where it fails. Hence, H cannot exist. We are creating a paradox here.
@suls829
@suls829 Год назад
@@mohitshresthanep thank you so much for explaining!
@Dolphin01
@Dolphin01 4 года назад
4 time i watch this video and finally i got it thank you neso academy than you so much
@RahulMadhavan
@RahulMadhavan 5 лет назад
wow! that proof is just beautiful for lack of a better word
@vishwasnegi5184
@vishwasnegi5184 3 года назад
Very nice video
@rachyuthkumar8366
@rachyuthkumar8366 4 года назад
really loved proof
@RamyAhmedGomaaBB
@RamyAhmedGomaaBB 2 года назад
What is the difference between that program and the problem I'm Writing? C(X) if{H(X,X) == True} return False else return True if I run it on itself it going to produce the following H(C,C) == True -> False H(C,C) == False -> True This is also a contradiction. But why can we design such a machine and cant design one that tells whether it will halt? is it going to run the code and check if the code halts or not? in this case, it's going to always not halt Can someone answer?
@anaika1804
@anaika1804 2 года назад
Thank you sir...it helps alot..to understand the topics in easy way...
@anikettiratkar
@anikettiratkar 5 лет назад
What is the need to put a statement that loops forever in there, when "H(P, I)==HALT" condition is satisfied? I mean, we can put any halting statement there, can't we?
@LasradoRohan
@LasradoRohan 4 года назад
You just need one example to prove contradiction here
@MrGrey64
@MrGrey64 Месяц назад
Practically, this sort of problem can occur in a way that’s not as blatant as this. The contradiction could be hidden, and regardless of what the program is, a program that detects whether it should halt should simply detect everything and figure it out. But it can’t figure it out because it will always be wrong. The contradictions are only so explicit because Sir is trying to explain them. In reality, it could be much more complex than that.
@saurabhrudrawar5887
@saurabhrudrawar5887 6 лет назад
Wow just the one i needed to understand thanks Sir
@aousnikgupta5541
@aousnikgupta5541 4 года назад
why will we run a loop forever when it can halt? we can halt in both if and else statements and give our verdict, right?
@rachelmatthew6771
@rachelmatthew6771 4 года назад
Nice video! Made my concept clear.
@cooperchia8459
@cooperchia8459 4 года назад
I very much appreciate this video
@PotatoShip
@PotatoShip 5 лет назад
why don't we replace the loop with return and return with the loop??
@Atemel
@Atemel 5 лет назад
to provide better understanding may be the definition of languages involves Adfa,Anfa,Acfg could've been.
@riteshpatidar9184
@riteshpatidar9184 4 года назад
H: It does not halts C:But it halts, because I am going to halt it H: It halts C: It does not halts, because I am not going to halt it H: wtf bro😑 C: Worship me, I am god
@Rahulsingh-bu6jh
@Rahulsingh-bu6jh 4 года назад
There is nothing wrong in this video he has actually proved it if you can't understand it then watch it twice or thrice... Don't be disrespectful he is providing free education, show some respect...
@coop4476
@coop4476 4 года назад
@@Rahulsingh-bu6jh He's just making fun of the concept not the person who made the video. It's actually funny; no disrespect.
@Rahulsingh-bu6jh
@Rahulsingh-bu6jh 4 года назад
@@coop4476 naah I don't think so he is making fun of the person
@anhta9001
@anhta9001 Год назад
I know that the function H in this video cannot exist. But what if you have a function that give it a program with given inputs, it will return one of these three values: halt/not halt/undecidable? Can such a function exist?
@AndrewCodeDev
@AndrewCodeDev Год назад
Good question - I believe the answer is no for a variety of reasons. I think the simplest one is that to return a value of undecidable, the program would have to halt to do so. If we think about how a Turing machine is defined, it has set of states. Two special states are { q_acc, q_rej }. Any other state "q_i" is a state that continues the computation. To reach a conclusion, the program has to halt. Therefore, for the program to terminate on the state that means "undecidable", it would have to halt to do so. Another way to approach this would be to think about what the machine you're proposing would imply. If we could build a machine that says "H(P, I) == undecidable", then "not H(P, i) == decidable", thus implying that negating the program proposed would mean that we have built a machine that can determine decidability. I know youtube can be full of mean spirited comments, but I sincerely intend this comment in good faith. Happy computing!
@huailinchen
@huailinchen 3 года назад
The design of H has some issue. For H is a DECIDER, hence, it should either ACCEPT or REJECT. "Not Halt" means what? Loop? doesot make sense for H. Make things complicated. Please refer to Page 165 of Dr. Michael Sipser's book.
@LasradoRohan
@LasradoRohan 4 года назад
This is genius
@ScorpioneOrzion
@ScorpioneOrzion 3 года назад
This can exist in the quantum world, because it will then both halt and loop forever.
@narendraparmar1631
@narendraparmar1631 4 года назад
Thanks Neso Academy
@abkonmalonma1028
@abkonmalonma1028 4 года назад
Can you please able the subtiles for english auto generated like the other videos. This video only have french subtitles
@jackgidney6372
@jackgidney6372 4 года назад
Thank you finally understand the proof :)
@khushvantmadodiya8375
@khushvantmadodiya8375 9 месяцев назад
can we use that type of machine check multiple input strings with given language and if it will halt all the input strings than we can say that program should be halt
@alieser7770
@alieser7770 2 года назад
Beautiful
@kanhaiyapandey8262
@kanhaiyapandey8262 6 лет назад
this is your best edio
@gibraanjafar2774
@gibraanjafar2774 5 лет назад
All videos till here have been great ! but this one doesn't make much sense. You keep saying 4:50 onwards that this contradicts and doesn't make sense . I'll tell you what doesn't make sense to me : H(P,I) takes input a machine P and and string I , so when you write H(X,X) you are giving 2 machines as input . That sounds just wrong .
@joelvzach
@joelvzach 5 лет назад
I too felt the same way but the textbook I use says such assumptions are alright.
@Zademn99
@Zademn99 5 лет назад
the theory says that every program(P) is a string ( a combination of characters). therefore, it can be passed as a string( I ) . Think about a program that you write in C or Java. It's a string
@shreyashchoudhary4576
@shreyashchoudhary4576 3 года назад
Great! Thanks a lot!
@ShaliniNegi24
@ShaliniNegi24 4 года назад
God Bless you with prosperity. :)
@mortezataghaddomi8597
@mortezataghaddomi8597 5 лет назад
Thanks for your videos. I read Sipser book and it's used reducibility to prove it. Both procedures are OK?
@nishantsharma8776
@nishantsharma8776 5 лет назад
thanks sir
@RTXAftab
@RTXAftab 3 месяца назад
What if we swap the C conditions when == halt it returns and otherwise loop forever wouldn't it just solves our problem 😮 IDK I am just confused RN
@bohanxu6125
@bohanxu6125 6 лет назад
so we know the existence of the C( ) Turing machine? (On the first look, C( ) needs to halt when H(X,X) doesn't halt...it seems like a hard thing to achieve)
@jessielucky5530
@jessielucky5530 6 лет назад
I think you and me are studying in the same university.
@bohanxu6125
@bohanxu6125 6 лет назад
Really? Where are you studying?
@user-em9mw9ch3y
@user-em9mw9ch3y 5 лет назад
she said "same university" : |
@sayantanpanda3049
@sayantanpanda3049 5 лет назад
Beautifully explained
@deepaksehrawat970
@deepaksehrawat970 4 месяца назад
What is we write C(X) as if{H(X,X)==halt} return; else Loop forever;
@tomcatgamingvideos
@tomcatgamingvideos 4 года назад
this is some nolan level stuff!
@naziaafreen3111
@naziaafreen3111 5 лет назад
Holy Dayumm! Like, reaaalllly? XD XD XD XD XD Thiz contradiction waz soo fun!!!
@yunfeichen9255
@yunfeichen9255 4 года назад
How is 6:11 any different from saying: " int functionH(int num){ if(condition)return -1; //do something return 0; } int functionC(int num2){ if(functionH(num2) == 0){ return -1; } return 0; } As you can see if you try to call functionC(functionH); functionH will return -1, and functionC will return 0, hence we have a contridaction, and therefore no such functions can be written. " But clearly such functions can be written, compiles and runs and gives correct output...
@LasradoRohan
@LasradoRohan 4 года назад
You're passing the result of a function (H) to a function (C) which is different than passing the definition of a function to a function (that check whether the passes definition can/will always halt)
@yunfeichen9255
@yunfeichen9255 4 года назад
@@LasradoRohan Ummm The definition of a funtion to another function, I think you need to give more background explaination than that??
@LasradoRohan
@LasradoRohan 4 года назад
@@yunfeichen9255 This might sound a bit weird, but bear with me... Imagine a datatype "function". A variable (object) of this datatype has the ability to store the exact steps to be followed and value to be computed and returned when that object is "called". Say, a function is defined as int f(int a, int b) {return a+b;} So when I pass 'f' to another function say 'g', by doing g(f), I'm giving it the "definition" of that function. But, when I pass f(1,2) to 'g', by doing g(f(1,2)), I'm giving it the value/output (1+2=3) of 'f' evaluated on inputs 1 and 2. Here, they define 'H' as: H(function f, string s){ if("f halts") return 'Halts' else return 'Doesn't Halt' } and define 'C' as: C(function f){ if(H(f, 'some string') == 'Halts'){ //start running an infinite loop } else{ //do something non infinite } } Therefore, calling C(C): For the if-condition it needs to evaluate the value of H(C, 'some string') But, we don't know the value after evaluation. Case 1: Say 'H' somehow determines that 'C' always halts. But this leads to an infinite loop being started, So we know 'H' was actually wrong. Case 2: Say 'H' somehow determines that 'C' will never halt. But this leads to a direct return statement, immediately halting C, So we know 'H' was actually wrong again. Therefore the function 'H' can't 'Decide' if 'C' halts or not. Therefore, the problem is proven undecidable, as there exists no function 'H' that can (algorithmically) solve the halting problem.
@yunfeichen9255
@yunfeichen9255 4 года назад
@@LasradoRohan "So when I pass 'f' to another function say 'g', by doing g(f), I'm giving it the "definition" of that function." How can you pass a function that has two parameters with none?? The compiler will say undefined function??
@LasradoRohan
@LasradoRohan 4 года назад
​@@yunfeichen9255 The thing is, H and C aren't defined as directly compilable code. They are actually a high-level encapsulation of some algorithm. So when we say, "we can define 'H'", it means some algorithm can possibly be written that will go through the given definition of a function and determine if it halts. Also, note that here we write the definition as an algorithm, which is not code (like in some programming language). So the parts of the algorithm may sometime become "high-level" thus ignoring some implementation details. You might be wondering, how is it ever possible to pass the definition of a function. One way to imagine would be, passing the exact code as a string. Now, there will be some "mini-compiler" inside function receiving the string which will help it to "understand" what the code from the string means, just like any compiler that you might be using. So when we say, the halting problem is decidable, we mean that the "assumed-to-be-existing-and-working-correctly" function 'H', has the ability to look at the definition (possibly as above) and use what it understands to "decide" between 'Halts' and 'Doesn't' halt. A side fun fact: it is actually possible to pass functions as I said, in some languages like C++, python (basically languages that treat functions as objects or allow objects to behave like functions). But, it is not the same as "passing code in a string" method I explained above. This is because these passed "function-objects" usually encapsulate and hide the code they run within themselves. Here's where, "passing code in a string" is more understandable.
@danielngan1051
@danielngan1051 4 года назад
What does it mean by undeciability?
@00x11
@00x11 3 года назад
Nice
@aydict
@aydict 4 года назад
Whoever is going to check my paper, get ready to be mindfucked
@shauryagupta8567
@shauryagupta8567 3 года назад
BRUHHHHHHHHHH XD
@youtubealgorithm2128
@youtubealgorithm2128 2 года назад
As youtube algorithm I'll recommend you to all
@ridwanulhasantanvir6456
@ridwanulhasantanvir6456 3 года назад
1:37: H(P,I) 2:15 C(X) ; X= any program 4:00 H(X,X) halt NA korle C(X) halt kore
@kowshicroy1418
@kowshicroy1418 3 года назад
kaka please explain loop forever part. why is it there?
@arvind7966
@arvind7966 3 года назад
@@kowshicroy1418 He used loop to prove that the program does not halt forever!!
@kowshicroy1418
@kowshicroy1418 3 года назад
@@arvind7966 guru thank you. but got S in the subject 😇😇😇
@arvind7966
@arvind7966 3 года назад
@@kowshicroy1418 I have to write exam today!!!
@kowshicroy1418
@kowshicroy1418 3 года назад
@@arvind7966 best of luck kaka!!!
@siddharthsingh5657
@siddharthsingh5657 6 лет назад
Da fuk
@rudranilkundu6114
@rudranilkundu6114 6 лет назад
exactly....Da fuk?? What is going on in this lecture???
@mohitshresthanep
@mohitshresthanep 6 лет назад
Siddharth Singh Theoretical CS is one of the most beautiful areas in the entirety of Computer Science, this property is one of the most central and classical properties of computer science that has large implications on the art of problem solving and computation in general.
@HellchOsen
@HellchOsen 6 лет назад
the whole thing is like trolling, we make the whole new TM C(ontradictor) that combine the halting machine H (that accept machine and input to simulate whether that machine will halt or loop with the input) to function that do the opposite result of H afterward, so when you feed input C into C machine for H, no matter the result H have reached, C will always gives the opposite result
@vinicius2699
@vinicius2699 6 лет назад
Exactly what i was going to comment
@Skandar0007
@Skandar0007 5 лет назад
Same
@tejaltatiwar4682
@tejaltatiwar4682 Год назад
Haven't got
@satya8411
@satya8411 3 года назад
Sir, is this not partially decidable
@cemc9005
@cemc9005 3 месяца назад
yea im failing this
@chethankudtarkar38
@chethankudtarkar38 5 лет назад
sir please explain this problem in automata theory subject not in the programming way
@GIT_Somya
@GIT_Somya 2 года назад
why're the captions in French???
@marvel438
@marvel438 5 лет назад
What the heck is this proof.
@gabrielpereiramendes3463
@gabrielpereiramendes3463 4 года назад
#Excelent!
@mfaraday4044
@mfaraday4044 4 года назад
I understand your all videos but one was .........
@thetruereality2
@thetruereality2 4 года назад
I am sorry but all of this is just PURE MANIPULATION. I mean we can always develop a contradictory logic for any generic problem. This doesn't prove that we cannot EVER design a program for a halting problem it just means if we tried to design it in this PARTICULAR WAY then it's undecidable. Honestly the introduction of "loop forever" clause itself is questionable. Because it seems unnecessary.
@nothingsksjsb
@nothingsksjsb 3 года назад
nanda korewa??
@MohitSingh-sf7yv
@MohitSingh-sf7yv 4 года назад
What if instead of writing LOOP FOREVER ------> FINITE LOOP
@OBSERVERfringe
@OBSERVERfringe 5 лет назад
or ip wallo jinka kal paper hai thoko like!!!
@LordSarcasticVlogger
@LordSarcasticVlogger 2 месяца назад
Upar se gya
@krox477
@krox477 3 года назад
inception 100
@vinayakrajvedi3764
@vinayakrajvedi3764 5 лет назад
it'd be much better if you explained this diagrammatically
@rahulrajendran5277
@rahulrajendran5277 2 года назад
💖
@karlchami4740
@karlchami4740 4 года назад
wha?
@chizhang7431
@chizhang7431 3 года назад
妙啊 妙啊
@uppuyt3649
@uppuyt3649 4 года назад
bruh........
@jhamunda7564
@jhamunda7564 6 лет назад
Complete lecture doesn't make sense
@abhilashnairp186
@abhilashnairp186 4 года назад
This doesn't make any sense🤥
@thetruereality2
@thetruereality2 4 года назад
It absolutely doesn't
@jusoneofdemgods
@jusoneofdemgods 5 лет назад
C(X) if (H(X,X)!=Halt) Loop Forever; else return;
@mimo89891
@mimo89891 5 лет назад
You're wrong, don't confuse people. If so, where is the contradiction?