NFA to Regular Expression Conversion, and Example

Поділитися
Вставка
  • Опубліковано 19 січ 2025

КОМЕНТАРІ • 235

  • @EasyTheory
    @EasyTheory  4 роки тому +30

    Thanks to my supporters Yuri, vinetor, Ali (UA-cam) and Bruno, Timmy, Micah (Patreon) for making this video possible! If you want to contribute, links are in the video description.

  • @davidlancaster5804
    @davidlancaster5804 4 роки тому +122

    College professor spent 2 hours explaining this. Watched this video on double speed in 7 minutes.

  • @alisonlee8153
    @alisonlee8153 3 роки тому +34

    Wish textbooks had more examples because they help a lot more compared to just text and theorems. Thanks so much!

    • @EasyTheory
      @EasyTheory  3 роки тому +7

      I'm writing a textbook! See my latest video.

  • @kalastasgamingshack
    @kalastasgamingshack 4 роки тому +9

    I have a test tomorrow and didn't understand anything from my Lecturer . This video is a gold mine. Thank you!!!

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

      You're very welcome!

    • @gan7940
      @gan7940 9 місяців тому

      Same, 3y later

  • @laurenlin2
    @laurenlin2 3 роки тому +37

    Thank you so much for this easy to follow explanation! Was so confused by my professor but you're a life saver

  • @Computerix
    @Computerix 3 роки тому +5

    Didn't understand anything from my professor's book, watched this and understood everything thanks !

  • @michaeltaylor3552
    @michaeltaylor3552 2 роки тому +6

    Dude... I love you. The in and out list made this so easy. My college professor was just having us send it and I couldn't get it, you legitimately just saved me for my mid term. I wish you were my professor, thank you!

  • @ThangNguyen-ko5ze
    @ThangNguyen-ko5ze 4 роки тому +3

    I have an exam tomorrow and this just saved my life. Thank you for making my Computer Science life a bit easier.

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

      Good luck on your exam, and thanks!

  • @kavinanand5742
    @kavinanand5742 4 роки тому +9

    This is a fantastic explanation. The In/Out decomposition really helped!

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

    Thank u sir from INDIA, there r very few utubers who have covered this topic but from all those, ur explanation is outstanding.

  • @aadarshrajesh7485
    @aadarshrajesh7485 Рік тому +2

    searched entire youtube for such an example, thankyou so much 👍😁

  • @hashimmahmood3704
    @hashimmahmood3704 Рік тому

    hands down the best tutorial on FA to RE conversion using GNFAs

  • @ayushsharma397
    @ayushsharma397 9 місяців тому +1

    Hats off, tried 10+ resource and now this is the only video i will refer in future as well for NFA->RE. The Best, thanks

  • @luissuarez4773
    @luissuarez4773 3 роки тому +2

    I was reading the textbook like crazy and could not understand it at all but your video allowed me to grasp this much better . Thank you so much!!

  • @cagla3360
    @cagla3360 2 місяці тому

    Thank you soooo so much!! I didn't understand what my professor was doing in the lecture because he didn't explain what he did and why he did it. You saved me !

  • @mehrdadkiani8476
    @mehrdadkiani8476 3 роки тому +2

    Finally, I found a clear explanation for these kinds of questions, thank you.

  • @carloslisboa7402
    @carloslisboa7402 9 місяців тому +2

    im gonna buy you an eraser
    thank you for the videos saving me in college

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

    اقسم بالله فنان اول مره افهم التحويل بالسهولة دي ❤❤❤ Thanks. Your explanation is amazing

  • @azncookie1546
    @azncookie1546 3 роки тому +2

    My textbook's explanation for this was terrible, thank you so much this made so much sense!

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

    Huge thanks for this example. A much better explanation than my professor!

  • @CoolEngineering-nm7mi
    @CoolEngineering-nm7mi Рік тому

    I have a midterm tomorrow and this video literally are saving me!! thank you

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

    You explained it better than my college professor. U are amazing.

  • @egeergul3548
    @egeergul3548 Рік тому

    broo you really simplified it for me. thank you for saving me hours of unnecessary studying 👏

  • @henrygilchrist3793
    @henrygilchrist3793 Рік тому

    Really good video! Love the way you break things down into normal English. Appreciate it!

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

    Incredible. You are a great professor. I like it when you put it into steps. It is really easy theory. I think the biggest challenge is just explaining it and you do a very good job at it.

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

    Thank you so much. This is the easiest one to understand among all the other videos about this.

  • @abel5545
    @abel5545 4 роки тому +6

    Such a vivid and clear explanation ! Thank you so much for making this

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

      Thanks so much! Don't forget to check out our theory lectures series playlist.

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

    Marvelous video for DFA to regex! thx! I cant find such a vivid teaching video on Chinese Internet at all!

  • @victorrodriguezdorta1843
    @victorrodriguezdorta1843 7 місяців тому

    the best video i found, thanks, hello from spain

  • @19MusicIsLife95
    @19MusicIsLife95 4 роки тому +5

    Very nicely explained, thanks from Sweden!

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

    OMG! This is a lot easy than the language in the book. Thanks!

  • @raz9006
    @raz9006 2 роки тому +1

    WOW !! thanks a lot! I have an exam soon and it was very helpful!!!

  • @AngelOrtizMartinez-u2y
    @AngelOrtizMartinez-u2y Рік тому

    i love you so much, all your videos make so much sense and it will be the reason i pass this class

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

    best method that I ever seen! thanks for the explanation!! thank you so much ^^

  • @Coplanersirtax9
    @Coplanersirtax9 4 місяці тому +1

    Damn nice vid man!

  • @kmunkhuu
    @kmunkhuu Рік тому

    You are AWESOME! I am so so glad I found your channel!

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

    Thanks a ton! got more out of this 14 min than the 1 hour lecture

  • @bangvu2127
    @bangvu2127 Рік тому

    Many thanks. I owe my Automata & Compiler paper's credits to you

  • @pranavkulkarni2023
    @pranavkulkarni2023 3 місяці тому

    Finally, I got it. Thank you very much.

  •  2 роки тому +1

    Thank you so much! 😊
    I've finished the implementation of this using the IN-OUT trick 🥳

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

    Thank you so much! I have review the lecture and read the book more than 2 hours in order to undertand the GNFA, but I failed. I have watched this video about 7 mins, I figured it out.

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

      Thanks very much! Make sure to watch the other theory videos I've made

  • @hursantb7957
    @hursantb7957 4 роки тому +10

    Love this
    RIP Kleene Algorithm and Ardens rule

  • @CarlosMagno-uz8de
    @CarlosMagno-uz8de 2 роки тому

    Thank you so much! You are gifted at teaching!

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

    You are the best! I almost spend 2 hours to understand the ripping from the theory of computation book :(

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

    Thank you so much. you are saving me in my discrete 2 class.

  • @sajjadalvandkoohi2397
    @sajjadalvandkoohi2397 6 місяців тому

    it was helpful & clear, you saved my time & life😀thanks

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

    Super Sir
    ALMIGHTY bless you with all kinds of wealth

  • @Kipp3t
    @Kipp3t 4 місяці тому

    ILL SAY IT AGAIN YOU ARE THE GOAT!

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

    Very good explanation. Thank you!

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

    Thank you so much for making this!! Such a clear explanation!

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

    Thank you very much this has helped me understand how to use GNFA.

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

    this was SO HELPFUL

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

    sir, you are better than my professor

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

      Lol thanks! I should be your professor instead ;) kidding.

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

    How do you know when to combine different paths from a state to another state with a union? There were times where there were alternative paths from one state to another but they weren't included in the union. For example at 6:03, to go from q2 to F we could've taken the that q2 -> q0 -> q1 -> q3 -> F but we only chose the path shown in the video. I'm not sure if this is just intuition or there is some algorithmic and definitive way of doing this. At 7:15 you did a union here but I'm not sure why union wasn't done in the other case I mentioned?
    In other words how do you know which paths to choose to get from one state to another? There are some other paths you could've taken from one state to another but chose not to.

    • @EasyTheory
      @EasyTheory  3 роки тому +2

      You don't worry about that. You only focus on length-2 paths: the ones that go through the state you're trying to remove.

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

    This explanation was great! Thank you very much,

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

    thank you for the explanation! really easy to follow and understand :)

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

    Thanks for this clear explanation!

  • @abhishekkumar-ef1xj
    @abhishekkumar-ef1xj 4 роки тому +1

    wao man :) pictorial representation with great explanation makes it clearly understandable . Thanku :)

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

      abhishek kumar you're very welcome!

  • @kevinthomas2326
    @kevinthomas2326 10 місяців тому +1

    You are a godsend mate

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

    Great explanation, thank you!

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

    great video ! thanks from Germany !

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

    Thanks for the best explanation!

  • @alengospodinov
    @alengospodinov Рік тому +1

    Question: Is Union equivalent to "+". In my classes we use the + sign and not the U. If they are can i directly substitute to get the desired answer from my Uni?

  • @jamaluddin9158
    @jamaluddin9158 4 роки тому +3

    Hello this is a great technique! I had a doubt though. What to do in case we have a trap state? How to "rip" that state out? I don't see how to do this since trap state never comes in the path to final state. My gut is telling me to just ignore the path to trap state but I'm not sure if that's right.
    Edit: I figured it out! Since this method is agnostic to whether this is a DFA or NFA, we can just ignore the trap states before hand!

    • @stormanderson7942
      @stormanderson7942 Рік тому +1

      I had the same question. Thank you for coming back to your own question

  • @barney2120
    @barney2120 2 роки тому +1

    What if my start state is also my final state?

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

    Great explanation, thank you so much.

  • @codyelhard8012
    @codyelhard8012 4 роки тому +2

    Excellent video, too bad it doesn't have that many views

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

      Cody Elhard thanks! I hope it can get more popular too!

  • @marctreal
    @marctreal Рік тому

    Fantastic! Just one issue: the audio levels are quite low, it would be helpful if you brought them up

  • @zzzpr
    @zzzpr Рік тому

    Thank you this was so helpful!!

  • @Syssss-r1i
    @Syssss-r1i 3 місяці тому

    Love from India❤🇮🇳

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

    Great explanation!

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

      Julian Rahahleh thanks Julian :)

  • @awsafrafin1467
    @awsafrafin1467 Рік тому

    It was really helpful and very easy

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

    thank you!! very comprehensive

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

    thanks for the great explanation

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

    Sir if there is dummy state given in NFA how we treat it in converting to regular expression?

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

      Note that there would be no outgoing transition in that case. So the number of new transitions is 0 when you rip it! :) (There is a more formal proof of that but that's the basic idea)

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

      @@EasyTheory ok thank you sir

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

    You’re a literal god

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

    what do you do if the old start state is accepting? does the new start state become accepting?

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

    thank you for this cogent explanation. I hope that dog has calmed down in the video???

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

    yeah this video is a good one. thanks man!

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

    Dude you're a legend

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

    Fantastic video, thank you very much

  • @lionsenator
    @lionsenator 3 роки тому +3

    Thanks for the nice explanation. Why do you ignore the transition from q1 -> q2 -> q3 -> F when you're ripping q3? I think it doesn't make a difference but I just wonder because later you consider "longer" paths.

    • @EasyTheory
      @EasyTheory  3 роки тому +5

      Because of transitivity. If we know how to get from q2 to f, then we know how to get from q1 to f because that's just concatenating the two regexes along the way.

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

      @@EasyTheory kinda late to the party, but what if I considered this path? instead of only a*, it would be a* + (aba*)?

    • @khoadiep3774
      @khoadiep3774 3 місяці тому

      Same question

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

    Great work, thanks a lot!

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

    this is absolutely the best

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

    do you have to remove dead states? that is, nonaccepting states that have no outgoing arrows?

  • @MS-gt9yu
    @MS-gt9yu 3 роки тому

    Thank for the explanation

  • @redx121
    @redx121 10 місяців тому +1

    God I wish you were my professor

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

    Awesome Video !!

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

    Do you need to put the last part of the regular expression (a*+aba*) between parentheses?

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

      Paul good question. It's not necessary, but I would do it if I were you, because it reduces ambiguity that some people may have.

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

      @@EasyTheory Thank you!

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

    this ecplanation is brilliant

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

    Wow! Amazing! Ty so much :D

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

    where should i put to new final state if there is a non-final state after a final state?

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

    Greattt video dude!

  • @miliu99
    @miliu99 2 роки тому +1

    Thank you very much for your clear explanation. I have a question though. You mentioned that you can pick any state to get started. However, elimination states in different order will likely produce a different RE. E.g. if I eliminate states in this order: q2, q1, q3, q0, I will get the result as (a(bUaa))*(a(abUe)a*), where e is epsilon. Is there a way to convert that RE to a((bUaa)a)*(a*Uaba*) which is what you get? or prove those two are basically same?

    • @Persa12
      @Persa12 Рік тому

      i get same result as you

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

    You are my favorite person

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

    thank you my prof just complicated things via using phi transition also.

  • @dzbro1194
    @dzbro1194 2 місяці тому

    why do i get a different regex when removnig q1 before q0

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

    Great video, thanks! One question: How do I build pairs in the In-&-Out-list if there is a state with several Ins and several Outs? Do I have to treat this a cartesian product so that every In builds a pair with every Out?

    • @EasyTheory
      @EasyTheory  3 роки тому +3

      It's not exactly the Cartesian product, but some kind of product, yes (it's possible to formulate it as Cartesian though - the problem lies with the results being concatenations, not ordered tuples as the Cartesian product would give.)
      But yes, every "in" goes with an "out".

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

      @@EasyTheory Thank you!

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

    explained very well

  • @Kbro91
    @Kbro91 2 місяці тому

    Does this strategy work for DFAs as well?