Non-Deterministic Finite Automata (Solved Example 3)

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ธ.ค. 2024

ความคิดเห็น • 599

  • @rajeshprajapati4863
    @rajeshprajapati4863 3 ปีที่แล้ว +122

    Answer to Assignment at 08:16
    Ex 1 : 2 States (A is Starting State, A on 1 goes to B, A on 0 stays in A, B is Final State, B on 1 stays in B, B on 0 goes to A)
    Ex 2 : 2 States (A is Starting State, A on 1 stays in A, A on 0 goes to B, B is Final State, B on 0,1 stays in B)
    Ex 3 : 4 States (A is Starting State, A on 1 goes to B, A on 0 goes to D, D is Dead State, B on 1 goes to D, B on 0 goes to C, C is Final State, C on 0,1 stays in C)
    Ex 4 : 3 States (A is Starting State, A on 0 goes to B, A on 1 stays in A, B on 1 goes to C, C is Final State, B on 0 stays in B, C on 0,1 stays in C)
    Ex 5 : 3 States (A is Starting State, A on 0 stays in A, A on 1 goes to B, B on 1 goes to C, C is Final State, B on 0 goes to A, C on 0,1 goes to A)

    • @lonlyyfans
      @lonlyyfans 2 ปีที่แล้ว +4

      In ex 4 C on 1 should go to C (self loop) and C on 0 should go to B no?

    • @nishanthraodugyala4956
      @nishanthraodugyala4956 2 ปีที่แล้ว

      @@lonlyyfans Hey, but in the question they said they should only contain "01" , so if you assume 10010 will not be accepted even though your string is valid, so rajesh answer is true.

    • @dimitriskk3613
      @dimitriskk3613 2 ปีที่แล้ว +45

      In ex 5, C on 1 should go to C

    • @ishantkasana97
      @ishantkasana97 ปีที่แล้ว +3

      ​@@dimitriskk3613exactly

    • @ishantkasana97
      @ishantkasana97 ปีที่แล้ว +6

      Great work brother ✨.... But in ex 5 C on 1 should go to C as we want a string which should end with '11' so it doesn't matter that at end how many 1's occur as example like 110111 will not be accepted if we take your solution to consideration.

  • @sivasaip5531
    @sivasaip5531 3 ปีที่แล้ว +70

    Thanks Neso academy for clear cut videos you don't know how many students u have saved from head aches Tq Neso and the Sir💙

  • @ndougiven3097
    @ndougiven3097 5 ปีที่แล้ว +254

    Neso makes me feel like deactivating my ad blocker when I watch all his videos

    • @veedjohnson
      @veedjohnson 4 ปีที่แล้ว +14

      Lol but you don't

    • @ritishmadan3730
      @ritishmadan3730 4 ปีที่แล้ว +13

      I did bro, at least if I am not donating, I would not stop them from video monetization.

    • @Suraj6642
      @Suraj6642 3 ปีที่แล้ว +9

      i turned down the brave shield, because the quality of content given by neso is just out of the room.

    • @darkwarrior6767
      @darkwarrior6767 3 หลายเดือนก่อน

      But the time remaining for my exam makes me not do it

    • @rudrakshpangotra8835
      @rudrakshpangotra8835 หลายเดือนก่อน

      literally i bought yt premium at the last video
      i swear

  • @chrisrey2516
    @chrisrey2516 5 ปีที่แล้ว +225

    Didn't show up to my Theory of Computation class in 3 weeks and your lectures got me a 92/100 on the test.

    • @pranaygupta5845
      @pranaygupta5845 5 ปีที่แล้ว +10

      Weren't you detained for not attending classes that long?

    • @chrisrey2516
      @chrisrey2516 5 ปีที่แล้ว +26

      @@pranaygupta5845 In the United States, some classes don't care about attendance

    • @_xxx_mlg_pingu_xxx_1725
      @_xxx_mlg_pingu_xxx_1725 2 ปีที่แล้ว +23

      @@pranaygupta5845 There is something like 75% minimum attendance in India according to my family there, but here in Portugal, and in many other countries, the only thing that matters is your scores in tests/exams and projects.

    • @monstercoder3665
      @monstercoder3665 2 ปีที่แล้ว

      @@chrisrey2516 OK you are telling that you're in USA..,

    • @vrajparikh8630
      @vrajparikh8630 2 ปีที่แล้ว +3

      @@monstercoder3665 so what ?

  • @francisdubois5136
    @francisdubois5136 3 ปีที่แล้ว +4

    Thanks!

  • @reshma3787
    @reshma3787 4 ปีที่แล้ว +86

    According to DFA:
    a) 2 states
    b) 2 states
    c) 4states( one state will be dead or trap state)
    d) 3 states
    e) 3 states

    • @prediction-baba
      @prediction-baba 3 ปีที่แล้ว +2

      Shi ho aap 👍

    • @gauravghosh6562
      @gauravghosh6562 2 ปีที่แล้ว +7

      e) i think will have 4 states ( 3 +1 dead)

    • @w1ch3r29
      @w1ch3r29 ปีที่แล้ว +3

      @@gauravghosh6562 i think you added a dead state at the end which is incorrect because 011011 is also valid so for the final state if 0 is encountered jump to initial state if 1 is encountered give it a self loop at the final state cause 01111 is also accepted

    • @Rohit_GenAI
      @Rohit_GenAI ปีที่แล้ว

      @@gauravghosh6562 yes

    • @Ovicron
      @Ovicron ปีที่แล้ว +1

      @@w1ch3r29 You're correct!

  • @katyayini8445
    @katyayini8445 4 ปีที่แล้ว +68

    Thank you.. You are like our life savior.. Really!!! Thank you so much.. Tomorrow is my sem. Xam.. And m watching it really faster..
    I hope I could get all my CS subjects taught by you.. You are really our life savior.. Thank you..

    • @chandra-hx2cw
      @chandra-hx2cw 3 ปีที่แล้ว +1

      hei do you know how to solve this?
      Design a Non-deterministic Finite Automata (NFA) for the syntax of the chosen construct. Note that the NFA must cover the generic syntax of the construct, and not be limited to just a specific sample code. The syntax covers all valid code for the construct, hence the NFA must accept all valid code, whilst rejecting all invalid code.

    • @rabbiipictures7505
      @rabbiipictures7505 3 ปีที่แล้ว +1

      @@chandra-hx2cw hey, did you find the answer to this?

  • @rahuldalkari4285
    @rahuldalkari4285 3 ปีที่แล้ว +27

    NOTE:
    Example 4:
    Upon getting input "0" at state B, it should go to state B and not "phi". Therefore, a self-loop at B for input "0" is required. The self-loop at A for input "0" is redundant. Also, the self-loop at B is required only when the self-loop at A is removed.
    Example 5:
    Upon getting input "0" at state B, it should go to state A and not "phi". Self-loop at A for input "1" is not redundant. Solve for string 111, you will understand why the self-loop is required. Also, B should go to state A at input "0" only when the self-loop at A for "1" is removed.

    • @druthi9700
      @druthi9700 3 ปีที่แล้ว +5

      It works fine for 111. See, there are 2 ways first for A(A,B). Then for A(A,B), for B(C,phi). Again for A(A,B), for B(C). There, you've reached state C for 111. Hope you get my point :)(A->A->B->C)

    • @shauryaverma292
      @shauryaverma292 ปีที่แล้ว +2

      @@druthi9700 ig he was mentioning the DFA for the respective NFA, in that case his points are valid.

    • @noyasan7378
      @noyasan7378 ปีที่แล้ว +1

      @@shauryaverma292 i dont think he meant those for DFA, because DFA does not allow 'phi'

    • @hemantrawat414
      @hemantrawat414 ปีที่แล้ว

      example 4 : i think at b state it goes like this (b,1)->c and (b,0)->a try with eg 00101 with both nfa's
      example 5 : also in this example at b state (b,0)->a and (b,1)->c and at c state also (c,1)->c and (c,0)-> phi try to validate this with example 01011011

  • @ChristianBurnsShafer
    @ChristianBurnsShafer 6 ปีที่แล้ว +8

    In example four it makes more sense if A does not go back to itself when '0' is the input. Rather, move to state B and in state B if another '0' is inputted stay in state B.

    • @tyroneslothdrop9155
      @tyroneslothdrop9155 6 ปีที่แล้ว +4

      I'm glad someone else thought this to be problematic as well. The way it's stated in the video, one would think that final state C could never be reached if 0 is input at state B.

    • @bullyversal5313
      @bullyversal5313 ปีที่แล้ว +1

      That's why it is called NFA
      because one input can have many states
      Also the problem says that it should contain with 01 so their can be any number of string symbols before 01 comes and it can be done both ways.. with loop to A itself or move to B

  • @shridharnaik6459
    @shridharnaik6459 6 ปีที่แล้ว +11

    My answer for assignment: (i) 3States (ii) 2 states (iii) 5 states (iv) 3 states (v) 3 states.
    Thanks for the lectures. Very easy to understand and doesn't get bore at all.

    • @Sitron_
      @Sitron_ 3 ปีที่แล้ว +5

      (i) 2 States (A0A, A1B, B0A, B1B, with B as final state). And (iii) 4 States (A0D, A1B, B0C, B1D, C0C, C1C, D0D, D1D, with C as final state and D as a trap state).

    • @AyanKhan-fe4qc
      @AyanKhan-fe4qc 3 ปีที่แล้ว

      correction *
      1>2states, 2> 2 states ,3> 4states ,4> 3 state ,5> 3 state

    • @mdkashifreza_it_2138
      @mdkashifreza_it_2138 3 ปีที่แล้ว

      @@AyanKhan-fe4qc 5 ka 4 state hoga ends with 11 bola hai .. toh agr 0 pe end hua tb toh dead state mei chla jayega na

  • @sillysspot6016
    @sillysspot6016 3 ปีที่แล้ว +1

    At 6:48, why we are not looping the zero to B again, because 001 will also be selected by the machine, but acc. To your NFA, if 00 comes, it'll go to fi after B

    • @nicomarcelino9439
      @nicomarcelino9439 9 หลายเดือนก่อน

      ik this comment is 2 years old, but for anyone curious, it's bc it's nfa. it's possible to run the machine such that the first 0 goes back to A and the second 0 goes to B. no need to find alternative ways to run the machine, when you've confirmed that at least one way is accepted.
      as mentioned in the nfa solved example 1, "If there is any way to run the machine that ends in any set of states out of which at least one state is a final state, then the nfa accepts".

  • @varunvarun6022
    @varunvarun6022 7 ปีที่แล้ว +48

    Neso.........is the best

  • @jeffmathew6238
    @jeffmathew6238 2 ปีที่แล้ว +7

    I think most people have a doubt in L4 where you are saying that shouldn't B self-loop in 0, the answer is no because there will be a path where 0's will get looped in A. For eg in 10001, path can be A->A->A->A->B->C

  • @geolegacy2
    @geolegacy2 5 ปีที่แล้ว +212

    Just a side note, these are not constant answers he is just giving us an idea. The NFA can look different.

    • @Quiet_Wanderer015
      @Quiet_Wanderer015 3 ปีที่แล้ว +10

      I also felt the same. like for L3 = {Set of all strings that starts with '10'}. I had diff answer than him. See if we can discuss it.

    • @sriinithareddy3674
      @sriinithareddy3674 3 ปีที่แล้ว +7

      yep even I felt the same, in the 1st example where we have to construct an NFA that accepts string that end with 1, in the final state probably we could just give a self loop(i.e on accepting 1 the state b stays in the final state) I guess even that's right.

    • @mohd.hanzalasalimjafferstu5793
      @mohd.hanzalasalimjafferstu5793 3 ปีที่แล้ว +5

      @@sriinithareddy3674 no that isn't correct. We want the strings that end in 1.

    • @jarvis1881
      @jarvis1881 3 ปีที่แล้ว +1

      thanks mann

    • @sehejwahla5437
      @sehejwahla5437 3 ปีที่แล้ว +5

      thanx man, that's reassuring. I was kinda worried why im getting wrong answers tho.

  • @ashishghosh4735
    @ashishghosh4735 7 ปีที่แล้ว +154

    why can't we restrict the self loop on A to only 1 instead of 0,1? Because if one 0 is encountered then it will jump to the final state and that should work fine .

    • @ChristianBurnsShafer
      @ChristianBurnsShafer 6 ปีที่แล้ว +8

      Correct.

    • @douglaswiliam4147
      @douglaswiliam4147 6 ปีที่แล้ว +31

      Because he wants an NFA. Yes, he could but the matter is about NFA and if he did do it would be a DFA in some cases.

    • @pranavmarla
      @pranavmarla 6 ปีที่แล้ว +8

      @mansharkpig The point of the machine is to detect the occurrence of the zero and not it's position right?
      I think the instructor has drawn the diagram just to reinforce the concept of an NFA. A simple DFA would work fine as well.

    • @SuperHamzamadrid
      @SuperHamzamadrid 6 ปีที่แล้ว +1

      @mansharkpig incorrect , it will work fine also for the string you mentioned :)

    • @zyro9922
      @zyro9922 5 ปีที่แล้ว

      @mansharkpig Makes sense

  • @vasanthakumark8502
    @vasanthakumark8502 4 ปีที่แล้ว +14

    If this video were 0 dislikes,surely you are the no 1 educational youtuber. Helped me lot.No words to describe your efforts.Do more videos bro...

  • @youucanexamprep
    @youucanexamprep ปีที่แล้ว +19

    DFAs :
    a) L1 = = Minimum 2 states ( All strings that end with '1' )
    b) L2 = Minimum 2 states ( All strings that contain '0' )
    c) L3 = Minimum 3 states, 1 dead state ( All strings that start with '10' )
    d) L4 = Minimum 3 states ( All strings that contain '01' )
    e) L5 = Minimum 3 states ( All strings that end with '11' )
    I checked all possible strings and All are accepted. And all invalid strings are not accepted.

    • @ranggagumilang7890
      @ranggagumilang7890 9 หลายเดือนก่อน

      why l3 have mininum 3 state n 1 dead state. why l3 n l5 cant have it to? what the diff?

    • @respect-editz6918
      @respect-editz6918 4 หลายเดือนก่อน

      ​@@ranggagumilang7890l3 have dead state because if we get 0 I/p at starting where it will go and l5 doesn't have it because it has loop to keep it in self

  • @joseph6855
    @joseph6855 2 ปีที่แล้ว +163

    remember, every DFA is a NFA, but not every NFA is a DFA

    • @vasudev3744
      @vasudev3744 ปีที่แล้ว

      true

    • @sattwikroy6977
      @sattwikroy6977 ปีที่แล้ว

      @@GoogleAccount-kj7bq NICE ONE

    • @asanitian6218
      @asanitian6218 9 หลายเดือนก่อน

      Ha..for those ending with 11, 01 I think dfa is not possible

    • @Ahnos
      @Ahnos 9 หลายเดือนก่อน +1

      Not true

    • @joseph6855
      @joseph6855 9 หลายเดือนก่อน

      @@AhnosIs true

  • @turrinaga8533
    @turrinaga8533 7 ปีที่แล้ว +10

    great videos very easy to understand each topic is covered in depth...keep going

  • @official.satya.
    @official.satya. 5 ปีที่แล้ว +85

    a)2 states
    b)2
    c)4
    d)3
    e)3

    • @Farahat1234
      @Farahat1234 5 ปีที่แล้ว +1

      How?

    • @MyAsdfqwe
      @MyAsdfqwe 5 ปีที่แล้ว +3

      @@Farahat1234 you need dead state or trap state in dfa

    • @Farahat1234
      @Farahat1234 5 ปีที่แล้ว +3

      @@MyAsdfqwe yeah but now my paper is done😭

    • @abhinavs03
      @abhinavs03 5 ปีที่แล้ว

      @@Farahat1234 hahahaa

    • @Farahat1234
      @Farahat1234 5 ปีที่แล้ว

      @@abhinavs03 ky h

  • @deblinadas8504
    @deblinadas8504 5 ปีที่แล้ว +8

    Thank you sir...for all the lessons...
    Answer of the assignment-
    L1) 3
    L2) 2
    L3) 4
    L4) 3
    L5) 4

  • @GajananPatange-kj7fh
    @GajananPatange-kj7fh 2 หลายเดือนก่อน

    its one of the best toc playlist and that to in english on youtube

  • @viveksolapure1493
    @viveksolapure1493 ปีที่แล้ว

    Eg:5) Can have only 2 state namely A,B
    ....Make B as final sate and self loop 1 for state B

  • @huidadou
    @huidadou 3 ปีที่แล้ว +8

    My answers for DFA are
    L1:2
    L2:2
    L3:4
    L4:3
    L5:3

  • @StuffSnuff
    @StuffSnuff 4 ปีที่แล้ว +8

    In EX 2) why is there a 0 from state A to state A?
    It should not have a 0 from state A to state A since on a string containing 0 it should go to the final state B?

    • @sargun_narula
      @sargun_narula 3 ปีที่แล้ว +1

      yes , don't know why he included it .. it would have worked without that extra 0 in state A

  • @swm7f137
    @swm7f137 7 ปีที่แล้ว +1

    no one teach better than you really thank of you

  • @TravellerNg
    @TravellerNg 7 ปีที่แล้ว +28

    Hello, in example 2 can we remove input 0 for self loop to first state A and only keep input 1 because it says that the strings should contain zero. So if we get zero input even once we can transition to final state?

    • @qwerty5850
      @qwerty5850 7 ปีที่แล้ว +6

      i think we can it will run successfully

    • @swarup765
      @swarup765 7 ปีที่แล้ว

      Nope, he has already clarified what you are asking here. Listen again.

    • @swarup765
      @swarup765 7 ปีที่แล้ว

      Nope, he has already clarified what you are asking here. Listen again.

    • @pratikwagh2089
      @pratikwagh2089 7 ปีที่แล้ว +2

      As far as the question is concerned i guess u r right and what he did is the case when the string is having more than one zeros. But also it is not told in the question if the string could contain one or more than one zeros, so his case also pretty well satisfies the condition.

    • @solomonblack7190
      @solomonblack7190 7 ปีที่แล้ว

      Considering the requirements of the language , His Automata is inefficient considering time, it may take too long before we know if the language is accepted by the AUTOMATA

  • @ShubhamGupta-me6bh
    @ShubhamGupta-me6bh 4 ปีที่แล้ว +9

    Assignment:-
    Ex 1:- 2 states
    Ex 2:- 2 states
    Ex 3:- 4 states
    Ex 4:- 3 states
    Ex 5:- 3 states

  • @Nomnomnom165
    @Nomnomnom165 ปีที่แล้ว +10

    In example 5, there should be a loop back to C when input is 1

  • @aaliakhan002
    @aaliakhan002 10 หลายเดือนก่อน +1

    In example 2 on giving input 0 on state A there should be only one transiotion from A to B only ,as after getting 0 as input we go on final state only.

  • @mnaresh3382
    @mnaresh3382 9 หลายเดือนก่อน +4

    I think for L2, redirecting the state to A on zero is redundant, since if the number starts with zero and has any thing after that it will eventually end up in state B, kindly correct me if I am wrong though

    • @JunaidAnsari-my2cx
      @JunaidAnsari-my2cx 9 หลายเดือนก่อน

      Same question, but ig its NFA so it doesnt matter.

    • @abdullahahmed5363
      @abdullahahmed5363 8 หลายเดือนก่อน +1

      Wow, your analysis is spot on, I didn't notice it before reading your comment.

  • @SaatvikPandey-t2y
    @SaatvikPandey-t2y 20 วันที่ผ่านมา

    No. of states in DFA of each of the 5 examples -
    1- 2
    2- 2
    3- 4
    4- 3
    5- 4

  • @kiwsuparerk440
    @kiwsuparerk440 2 ปีที่แล้ว +1

    You saved my life from the tomorrow test Tysm

  • @Ayushk11
    @Ayushk11 6 ปีที่แล้ว +2

    consider this example 10001 for ex4 from state B it will go to FI or null state

    • @moviescope8340
      @moviescope8340 3 ปีที่แล้ว

      Yeah that what i see...what if state B give zero where it will go so..self loop need to satisfy the condition i guess.. correct me if i am wrong!

  • @shawnlouis10
    @shawnlouis10 4 ปีที่แล้ว +10

    In the 2nd and 4th example, I feel that the self-pointing link of A (A -> A) should be only for the input '1'. Why is it for input {0, 1}?

    • @prajwalp8070
      @prajwalp8070 4 ปีที่แล้ว +3

      No we cant do like that, try 1001011 for eg 4. even though the string contains 01 it will not accepts and goes to dead configuration. Hope this helps.

    • @skandermahfoudh1838
      @skandermahfoudh1838 4 ปีที่แล้ว +3

      @@prajwalp8070 why tho?
      trying 1001011 works fine without A pointing to itself. Because once there is a 0, it should just go to the final state B. Because it means the string contains 0, which is what we need.

    • @ritabrotoganguly5729
      @ritabrotoganguly5729 3 ปีที่แล้ว

      @@skandermahfoudh1838 Shawn is right about eg 2 but that doesn't apply to eg4

  • @abhinavdixit9310
    @abhinavdixit9310 4 ปีที่แล้ว +4

    L1-3
    L2-2
    L3-4
    L4-3
    L5-3

  • @yourcodehelper1111
    @yourcodehelper1111 2 ปีที่แล้ว +1

    8:45 in dfa we add one more state is called death state or trap state.

    • @Sam-he4up
      @Sam-he4up 2 ปีที่แล้ว

      is it always mandatory to have a dead state ?

    • @mehulsingh1216
      @mehulsingh1216 2 ปีที่แล้ว

      @@Sam-he4up In DFA, it is mandatory to have a dead state.

    • @Sam-he4up
      @Sam-he4up 2 ปีที่แล้ว +4

      @@mehulsingh1216 no bro it is not but what is mandatory is for all the states to know where to go with certain inputs we might not need a dead state sometimes

    • @nashimbiswakarma
      @nashimbiswakarma 2 ปีที่แล้ว

      @@Sam-he4up No need of death/trap state in NFA. It is only needed in DFA.

    • @Sam-he4up
      @Sam-he4up 2 ปีที่แล้ว

      @@nashimbiswakarma we are talking about dfa man

  • @zerobit778
    @zerobit778 3 ปีที่แล้ว +2

    I think Neso just give construct which is prone to have branches when he construct the NFA (Which may add unnecessary confusion). I think it is better to construct the necessary step first is more easy to understand. Neso do enlighten me, thanks~

  • @gonzalocordova5934
    @gonzalocordova5934 4 ปีที่แล้ว +3

    In Ex 2 the arrow from A to A with input 0 is not needed. Thanks for the video!!

    • @shanmugapriyam8771
      @shanmugapriyam8771 3 ปีที่แล้ว

      That's correct but it is an nfa...so it can any possible ways... it just our wish and thinking...if want more possible way..we can add self loop anywhere..it's not an error 😁✨

    • @whalidmahabub2774
      @whalidmahabub2774 2 ปีที่แล้ว

      @@shanmugapriyam8771 error in example 2.For 011 you can't reach final state.

  • @anupamabidargaddi7177
    @anupamabidargaddi7177 3 ปีที่แล้ว +2

    L1- 2 states
    L2- 2 states
    L3- 4 states ( one state for dead state)
    We need one extra state for dead state if condition says strings starting with “substring”.ie n+1+1(dead state) here n is length of substring, in this example it’s 10 so n is 2..
    total number of states=2+1+1=4
    L4- 3 states
    L5- 3 states

  • @suyashsreekumar3031
    @suyashsreekumar3031 6 ปีที่แล้ว +9

    In ex5 shouldn't there be a loop of one in the final state since there can be 111 ,11111 in the end?

    • @mohitthaker1195
      @mohitthaker1195 6 ปีที่แล้ว +7

      ya but all the previous 1s can be contained in the 0,1 self loop of A

    • @suyashsreekumar3031
      @suyashsreekumar3031 6 ปีที่แล้ว +2

      mohit thaker Yes i didn't account the fact he was doing it for Nfa.

  • @ayushanand2022
    @ayushanand2022 5 ปีที่แล้ว +3

    3:40 in ex 2 is a DFA but we have to draw NFA?

  • @khadijausman-uq2nu
    @khadijausman-uq2nu ปีที่แล้ว

    My English is not so good but i am able to understand your lecture.....i am glad that i got 2 opportunities Automata as well as English

  • @evaggelosantypas5139
    @evaggelosantypas5139 5 ปีที่แล้ว +10

    in example 4 when on state B if we read '0' we need to stay on state B otherwise a string like '100001' would get rejected while containing '01'

    • @niceBroKen360
      @niceBroKen360 4 ปีที่แล้ว +5

      for 100001 AAAABC would work, the other fails will not matter

    • @cse-a-056niranjansaha4
      @cse-a-056niranjansaha4 3 ปีที่แล้ว

      @@niceBroKen360 noice

    • @legend7890
      @legend7890 3 ปีที่แล้ว +1

      No 1000 would be consumed by A and them 0->B->1->C

  • @RishikavsAnnie
    @RishikavsAnnie 4 ปีที่แล้ว +15

    In the 4th one, shouldn't there also be a self-loop on state B for input 0, 1
    and in the 5th one, a transition from B to A for input 0 ?

    • @fenilpatel4932
      @fenilpatel4932 4 ปีที่แล้ว +8

      @Rishika Garg there is clearly specified that the string should contain '01' so you can not put self loop on B because there after maybe it won't contain exact '01' in it.. and in the 5th example, there is no need to have transition of 0 from B to A because it is a NFA.. in NFA u don't need to specify dead state or any other extra transition of input..

    • @siddhanthallan2259
      @siddhanthallan2259 4 ปีที่แล้ว +5

      @@fenilpatel4932 input '001' is valid for the 4th one, hence there should be a loop on b

    • @siddhanthallan2259
      @siddhanthallan2259 4 ปีที่แล้ว

      that's what i thought,

    • @yashmor6203
      @yashmor6203 4 ปีที่แล้ว +10

      @@siddhanthallan2259 We do not need to counter every possible input, '001' will be tackled when A loops back to itself on the first '0' and then proceeds to B and C on the next '0' and '1'. In NFA we just need to make 1 such path that will surely reach final state, it can still have multiple dead paths. Hope this helped.

    • @SimonOkwori
      @SimonOkwori 4 ปีที่แล้ว +1

      Right, In the 4th, I think A should have a self-loop of just 1, B should have a self-loop of 0 and all others stay the same should be a better solution

  • @teenaevangelin8082
    @teenaevangelin8082 3 ปีที่แล้ว +2

    Thank you soo much. it's very clear explanation

  • @hemantrawat414
    @hemantrawat414 ปีที่แล้ว +1

    example 4 : i think at b state it goes like this (b,1)->c and (b,0)->a try with eg 00101 with both nfa's
    example 5 : also in this example at b state (b,0)->a and (b,1)->c and at c state also (c,1)->c and (c,0)-> phi try to validate this with example 01011011
    correct me if i am wrong

  • @miku4j
    @miku4j 4 ปีที่แล้ว +5

    I need n+1 states to construct DFA version of those NFA, with n is the amount of states possible in NFA ( or, amount of Q in NFA )

    • @neajmorshadashik
      @neajmorshadashik 3 ปีที่แล้ว

      Are you sure that is the minimum? I don't think so.

    • @debosmitachatterjee1096
      @debosmitachatterjee1096 3 ปีที่แล้ว

      Yes, I have got n+1 states in dfa except for question 2 . Can you please explain how did you get n+1 states in q2 for dfa ?

  • @tudorgorea8824
    @tudorgorea8824 3 ปีที่แล้ว +3

    I solved the problems with DFA and I have exactly the same number of states as solved with NFA, except ex 3, where I had to add a trap state

    • @shahsam5609
      @shahsam5609 3 ปีที่แล้ว

      Can u tell me how did u get for ex3

    • @shanmugapriyam8771
      @shanmugapriyam8771 3 ปีที่แล้ว

      Yeah crt😁....I were searching for the ans all over the comment... finally seen yours😉..

    • @daveaniket
      @daveaniket ปีที่แล้ว

      also for the problem 1 when doing it with dfa there will be 4 states right (1extra dead state)?

  • @chaytanyakadam1595
    @chaytanyakadam1595 ปีที่แล้ว +1

    Bhai shortcut mil gaya hai
    DFA required n+2 state or NFA required n+1 states in case 3. n is the length of string

  • @cruxrobot7034
    @cruxrobot7034 ปีที่แล้ว +2

    In example 5, can't there be a self arrow of value '1' from C to points itself?
    It doesn't make change in final answer tho

    • @HarshSingh-qq2jf
      @HarshSingh-qq2jf ปีที่แล้ว

      No, in NFAs you only mention transition states and self loop at the starting or ending depending whether the asked patter is in start (then self loop at end), in the end (then self loop at the beginning), in between (then self loop at the start as well as at the end)

  • @nabhavlogs371
    @nabhavlogs371 6 ปีที่แล้ว +5

    In example 2, if we donot include 0 in the self loop around A, will our NFA be correct?

    • @vedanshsharma1156
      @vedanshsharma1156 3 ปีที่แล้ว +1

      i think it should but can u answer it now after 2 years?

    • @vijesh_dewasi
      @vijesh_dewasi 2 ปีที่แล้ว

      by the way did YOU find the answer in span of a year WILL U REPLY AFTER A YEAR

    • @overseer9246
      @overseer9246 3 หลายเดือนก่อน

      after 5 whole years, yes i think it would still be a valid nfa when removing the 0 on the self loop on A

  • @PrashantSingh-py6ye
    @PrashantSingh-py6ye 6 ปีที่แล้ว +4

    sir, in example 4.If we want to accept the string 001,how how the NFA will accept?Explanation:present we are at A and if 0->B,now we are at B and if we again take 0 then where we will go???..if nothing is there we assume it to dead configuration ,right?..so how the 001 is accepted??

    • @vipulsharma4702
      @vipulsharma4702 5 ปีที่แล้ว

      See ,in nfa u have to see all the possible outcomes of a string being given as an input and if atleast 1 of them leads to final state ,then the string is accepted.
      So for string 001 ::::
      A -> B -> C ,this way gets us to final state hence it is accepted

    • @Eswarsai245
      @Eswarsai245 4 ปีที่แล้ว

      @@vipulsharma4702 where it goes after getting input o at b. it cant go to c right?

    • @Eswarsai245
      @Eswarsai245 4 ปีที่แล้ว

      ya bro same doubt

    • @vipulsharma4702
      @vipulsharma4702 4 ปีที่แล้ว

      @@Eswarsai245 no ,if 0 is given as input on b it can't go to c..
      But in 001, the first 0 can change the state from A to A due to the self loop,.. ,second 0 :A to B.., then 1:B to C.... this is 1 of the possible configurations and it gets us to final state. Thus it is accepted even if the other paths cannot make us reach the final state.
      Hope it helps.:)

  • @Punjabkings11
    @Punjabkings11 9 หลายเดือนก่อน +1

    For l1 total 4 states a ,ab,ac and abc

  • @nehagupta-qd7dg
    @nehagupta-qd7dg 4 ปีที่แล้ว +7

    according to me in example 2 there is no need of giving input 0 for self loop to first state A and only keep input 1 because it says that the strings should contain zero. So if we get zero input even once we can do the transition to final state . e.g. if i get 11101 here as soon as i got 0 , the string can now be accepted , i understand there can be more than one next step for each state , but that next step should make sense. if on getting first 0 , i keep it in state A only , then on taking the self loop it stays in state A only and would not be accepted .

    • @friendsitcom2312
      @friendsitcom2312 2 ปีที่แล้ว +1

      You give your explanation correct if it was DFA but it is NFA it will correct it doesn't a problem sister😊

    • @mohammadzaid9189
      @mohammadzaid9189 2 ปีที่แล้ว

      @@friendsitcom2312 what do you mean? that in in self loop at state A can we only mention 1 , to make it a legal NFA?

    • @insahey
      @insahey 2 ปีที่แล้ว

      @@friendsitcom2312 to my eyes, it is already a NFA without the self loop on A .
      I think we don't need that self loop to make it NFA. As it is not defined where the State transitions on getting input one.

  • @missraa.g
    @missraa.g 6 ปีที่แล้ว +1

    in example 4, b should have self loop of 0, as it will not affect the sequence '01'

    • @tygonmaster
      @tygonmaster 6 ปีที่แล้ว

      Incorrect. You are giving an example of 010, but you are not accounting for ALL possible 01 combinations. You need the loop to illustrate that there are an infinite number of solutions as long as the sequence of 01... is continued.

    • @sachiiinnnn9734
      @sachiiinnnn9734 5 ปีที่แล้ว

      @@tygonmaster it is confusing

    • @sachiiinnnn9734
      @sachiiinnnn9734 5 ปีที่แล้ว

      @@tygonmaster what if B gets input 0

  • @vrushaligholap6647
    @vrushaligholap6647 3 ปีที่แล้ว +1

    VERY INFORMATIVE SESSION, WORTH LISTENING TO IT!

  • @soorajhegde
    @soorajhegde 2 หลายเดือนก่อน +1

    Can’t we add a self loop for C of input 1,??at L5

    • @yiitalp
      @yiitalp หลายเดือนก่อน

      You can, I think. But it will be unnecessary, because it is a NFA.

  • @Yes-uu6pv
    @Yes-uu6pv 8 หลายเดือนก่อน +1

    Wouldn't the first example (set of string ends in 1) be wrong? As I understand, NFA can move both ways so a "010" string would move to the final state when it get to "1". Is it because the final can be considered a dead state (ie. in the case of "010", when the NFA reach the last "0" the NFA would reject the input)?

    • @survpriyabansal
      @survpriyabansal 8 หลายเดือนก่อน

      When you take the example 010, so the machine is made to reject this string cause it doesn't ends with 1..... The example is correct maybe you need to watch that part again...

    • @survpriyabansal
      @survpriyabansal 8 หลายเดือนก่อน

      This 010 string will move like this......
      A --0-> A --1-> A --0->A
      Now Ais not final state... So, this string will get reject

  • @charantejmaruthi4327
    @charantejmaruthi4327 3 ปีที่แล้ว +1

    assignment L1=4;L2=2;L3=5;L4=4;L5=5

  • @corneliswiredu9846
    @corneliswiredu9846 10 หลายเดือนก่อน +1

    You are good Neso

  • @Skumar43-l7c
    @Skumar43-l7c ปีที่แล้ว

    total state corrosponding to the sequence of questions are 2,2,4,3,2 respectively

  • @yt_souvik
    @yt_souvik 2 ปีที่แล้ว +1

    DFA :
    min no of states needed =>
    L1 - 2
    L2 - 2
    L3 - 4(consists of dead state)
    L4 - 3
    L5 - 3
    Do not hesitate to correct me if I am wrong 🎈

    • @Ovicron
      @Ovicron ปีที่แล้ว

      @Aryan Yadav Can't you send it back to initial state instead of a trap state?

  • @AnshVahinipati
    @AnshVahinipati 7 หลายเดือนก่อน

    Example 5, I think there'll be one more transition from State B to State A, because consider 1011 as a string, it wont get accepted as it would end up on the 'phi' state

  • @curias7
    @curias7 6 ปีที่แล้ว +7

    can we make an initial state as a final state as well? Example #2

    • @neiljohn2637
      @neiljohn2637 3 ปีที่แล้ว +1

      initial state can be made into final state... Anyways not of much use after 3 years I guess

    • @Ovicron
      @Ovicron ปีที่แล้ว

      @@neiljohn2637 Your comment helped me, so definitely of use loool

  • @avinashgondi4142
    @avinashgondi4142 6 ปีที่แล้ว +1

    Tq for all u r lectures it really helped me a lot

  • @ixc-06biswaranjanmohanty84
    @ixc-06biswaranjanmohanty84 2 ปีที่แล้ว +5

    Assignment Answer
    L1, L2, L4 & L5 have same states as NFA except L3 - 4 states
    Btw you are a great teacher
    Please write your name if you see this comment
    Thank you 😊

  • @bellajames7913
    @bellajames7913 5 ปีที่แล้ว +3

    1) 2
    2) 2
    3) 4
    4) 3
    5) 3
    Pls, Sir do reply if the answers are correct.

  • @debanjanghosal618
    @debanjanghosal618 6 หลายเดือนก่อน

    In question 2, I think we can also design a NFA with no self loop on state A for symbol 0.

  • @aryansrivastava7331
    @aryansrivastava7331 ปีที่แล้ว +1

    can anyone help me resolve this doubt , in example 1 , should there be a input 1 on state B which stays in itself ?

  • @eimaldorani
    @eimaldorani 7 ปีที่แล้ว +2

    If you design instead of a NFA a DFA, is it a complete answer?

  • @fzehra9515
    @fzehra9515 4 ปีที่แล้ว +4

    are they unique solutions or could there be other solutions as well? because in some examples i have some differences and they seem to work as well

    • @lapidations
      @lapidations 2 ปีที่แล้ว +1

      No, there are many possible solutions

  • @zyro9922
    @zyro9922 5 ปีที่แล้ว +4

    For example 1 we could have also written as A is final and start state with a loop of 1 on A

  • @nanajijeshwanth2753
    @nanajijeshwanth2753 4 หลายเดือนก่อน

    For the ex 5 we can also 1 input can loop to c again

  • @somethingnotspecified
    @somethingnotspecified 2 ปีที่แล้ว +2

    A question. In L5, we can also draw an arrow from C to C with the value 1 right? It would still be correct.

    • @aryanraj7671
      @aryanraj7671 2 ปีที่แล้ว +1

      you can ..but it is of no use..
      as you can get all combinations of required strings without using self loop in C.

  • @neupanenetra
    @neupanenetra 6 ปีที่แล้ว +1

    In example first considering string 1101, why transition doesn't go to state B when input is 1 and to dead configuration.How compiler know about which state to go when input is 1 since when there is input 1 in state A ,transition can go either state A or B.If it goes to state B how such strings are accepted?? Please answer it.

  • @user-dz6zd9zk2f
    @user-dz6zd9zk2f ปีที่แล้ว +1

    in the first example, instead of writing 0, 1 on A's self loop can we also draw a self loop on B for an input 1

  • @gauravdev5884
    @gauravdev5884 2 ปีที่แล้ว +2

    In example 4, can we have a self loop on B with value '0'?

    • @pranjalsinghkatiyar4972
      @pranjalsinghkatiyar4972 2 ปีที่แล้ว

      i think no need as you need not worry as 01 must be together all before strings can be traversed using the self loop in state A

    • @gauravdev5884
      @gauravdev5884 2 ปีที่แล้ว

      @@pranjalsinghkatiyar4972 ok thanks :)

  • @adityaralhan1154
    @adityaralhan1154 4 หลายเดือนก่อน

    In the second example if A will have self loop of only 1 and not 0,1 then also it would work right?

  • @coddycamp1405
    @coddycamp1405 5 ปีที่แล้ว +8

    For my case:
    ans for assignment may be like
    L1 = 2
    L2 = 2
    L3 = 4
    L4 = 3
    L5 = 3

  • @ppsreejith
    @ppsreejith 7 ปีที่แล้ว +14

    A)2
    B)2
    C)4
    D)3
    E)3

  • @anshjain257
    @anshjain257 5 ปีที่แล้ว +1

    how will the machine decide if by getting 1st 0 it should remain on a or move to b . as by opting the latter if it again encounters 0 it will go to dead or fi state

  • @gundlasowjanya884
    @gundlasowjanya884 3 ปีที่แล้ว +1

    In L5 can we have the self loop as1 at B

  • @shubhamrajput9363
    @shubhamrajput9363 2 ปีที่แล้ว

    धन्यवाद सर जी 🙏

  • @saikumar9856
    @saikumar9856 3 ปีที่แล้ว +2

    3,3,4,4,4 (minimum no of states)

  • @scottzeta3067
    @scottzeta3067 2 ปีที่แล้ว +1

    I think ex5 State B should have a link 0 go back to A. Or when you input 0 in State B, things become irreparable but actually it can be.

    • @thewatcher3564
      @thewatcher3564 2 ปีที่แล้ว

      Was just looking for a commend mentioning this. Ex4 also seems to have the same issue, if B gets 0 is should stay at current state

    • @maxxubs
      @maxxubs ปีที่แล้ว

      that would be the case if it was a DFA

  • @Pronoob88990
    @Pronoob88990 8 หลายเดือนก่อน

    Very good video, sometimes the professor go through things too quick, this video helped me a lot, I could pause and have time to understand the material

  • @neetutiwari1324
    @neetutiwari1324 3 ปีที่แล้ว +1

    Sir in question 5 it can be 011111 also as it also ends with 11

    • @huidadou
      @huidadou 3 ปีที่แล้ว

      Yes, and it will be accepted by the given NFA, as you will loop at A four times before it goes on to B and the final stage C.

  • @ironization7864
    @ironization7864 3 ปีที่แล้ว +1

    Thank you! Very clear explanation

  • @simranjain7284
    @simranjain7284 7 ปีที่แล้ว +15

    1) 2 States
    2) 2 States
    3) 4 States
    4) 3 States
    5) 3 States

    • @abb8493
      @abb8493 6 ปีที่แล้ว

      this is the correct one I believe:)

    • @AmineZyad
      @AmineZyad 6 ปีที่แล้ว +1

      3) is only 3 states

    • @osamakamil116
      @osamakamil116 6 ปีที่แล้ว +1

      @@AmineZyad i think 3 states because in case if we get 0 in example#1 so it will go to dead or trap state so if we count all states so,it will be 3 states.

    • @akshaypritmani3703
      @akshaypritmani3703 6 ปีที่แล้ว

      @@AmineZyad why 3 state in dfa we have to make dead state also and this are ans. of dfa's

    • @gxgaming7560
      @gxgaming7560 5 ปีที่แล้ว

      Thanx... 3 is 3, but I could get them right

  • @dasarianitha1651
    @dasarianitha1651 6 ปีที่แล้ว +2

    In eg:3, what will happen when i give a string that starts with 0

    • @henryemce
      @henryemce 6 ปีที่แล้ว +1

      i think the example 3 is DFA unless we put 0,1 in state A it will loop and cannot end with 10

  • @mohdezazulhaq1654
    @mohdezazulhaq1654 3 ปีที่แล้ว

    In example 4 state B, what if we get input 0 where it should go and string not accept like 0001

    • @bookssky
      @bookssky 3 ปีที่แล้ว

      look at another branch

  • @nabhavlogs371
    @nabhavlogs371 6 ปีที่แล้ว +6

    In example 4, shouldnot there be a self loop for 0 around B?

  • @simaosantos4111
    @simaosantos4111 3 ปีที่แล้ว +1

    Can there be a DFA and an NFA solution to the same problem?

  • @nikhilhaspe2734
    @nikhilhaspe2734 3 ปีที่แล้ว

    A Teacher....🖤Neso🖤😉

  • @yashkumardhawan6961
    @yashkumardhawan6961 6 ปีที่แล้ว +1

    In L4 how will 001, 1001, 10001 or 000000001 be acceptable?
    State ‘B’ needs to have a self loop for ‘0’.

    • @alexmercer5847
      @alexmercer5847 5 ปีที่แล้ว

      Exactly My Thoughts!

    • @Farahat1234
      @Farahat1234 5 ปีที่แล้ว

      You are right!😑😐😐

    • @vijetagoel5263
      @vijetagoel5263 5 ปีที่แล้ว +2

      0 of 001 will be accepted at A

  • @Vaibhavj1994
    @Vaibhavj1994 6 ปีที่แล้ว

    The answer for assignment is:
    L1= 3 states
    L2= 2 states
    L3= 4 states
    L4= 3 states
    L5= 4 states
    Sir, Please do Confirm :-)

    • @dabobrotosarkar7266
      @dabobrotosarkar7266 5 ปีที่แล้ว +1

      You can do the L1 with 2 states and L5 with 3 states.

  • @rudranshsharma2074
    @rudranshsharma2074 2 ปีที่แล้ว

    In example 4, should it not a self loop on B on getting input 0?

    • @jeffmathew6238
      @jeffmathew6238 2 ปีที่แล้ว

      no need because there will be a path where 0's will get looped in A. For eg for 10001, path can be A->A->A->A->B->C

  • @deepaklucky1413
    @deepaklucky1413 3 ปีที่แล้ว

    How can machine decide which state to go if there are more than 1 possibility on getting input??Like in L5 if it gets input 1 either it goes to A itself or B as well.For input 11, If it goes to A on getting input-1 and again goes to A on getting input-1,It will never reach final state and it becomes wrong NFA. Can anyone clarifies this...

  • @tayyab.sheikh
    @tayyab.sheikh 5 หลายเดือนก่อน +1

    Pause the video and try to solve the questions on your own and then compare them with his solutions!