Regex to NFA Conversion Isn't Hard! (Sipser 1.28a)

Поділитися
Вставка
  • Опубліковано 15 жов 2024
  • Here we do an example of the regular expression to nondeterministic finite automaton (NFA) conversion. The basic idea is to make a small NFA for the "indivisible" pieces, then combine them using union, concatenation, and star as the case may be.
    Easy Theory Website: www.easytheory...
    Discord: / discord
    If you like this content, please consider subscribing to my channel: / @easytheory
    ▶SEND ME THEORY QUESTIONS◀
    ryan.e.dougherty@icloud.com
    ▶ABOUT ME◀
    I am a professor of Computer Science, and am passionate about CS theory. I have taught many courses at several different universities, including several sections of undergraduate and graduate theory-level classes.

КОМЕНТАРІ • 41

  • @cristianiorga6393
    @cristianiorga6393 Рік тому +26

    You are amazing! It`s a shame I only discovered your channel in the night before the exam :D

  • @dawidbania7903
    @dawidbania7903 Рік тому +22

    There is a mistake in constructing the expression (abb)*. With the way you described it, you can make expressions that are of form (abb)^n where n>=1. There should be a returning loop between last state (that we get into by reading 'b' for the second time) and the state before we read 'a' with 'epsilon' read. And there should be a forward path from starting state to end state with 'epsilon' read.

    • @rusokemarvin
      @rusokemarvin 7 місяців тому +1

      yes, this is very right. I was looking out for a comment that matches my thought. Thanks

    • @chongwan4712
      @chongwan4712 6 місяців тому +1

      I think what Easy Theory had was correct.
      First, you're saying that "There should be a returning loop between last state (that we get into by reading 'b' for the second time) and the state before we read 'a' with 'epsilon' read" but this is equivalent to linking the last state to the beginning state because epsilon transitions don't take up any string.
      Second, responding to the statement "And there should be a forward path from starting state to end state with 'epsilon' read.", this is redundant because the starting state is already a final state, so we don't need the epsilon transition to the end state.
      Please correct me if you think I am wrong.

    • @louis9116
      @louis9116 16 днів тому

      It's a standard procedure. Don't make things more complicated

  • @benjaminwatkinson6464
    @benjaminwatkinson6464 2 роки тому +19

    If NFAs are like onions and ogres are like onions can you convert directly from NFAs to ogres?

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

    Very helpful. Thank you. This converted the regex into an epsilon-NFA. Now I could convert this epsilon-NFA into an NFA but this would take even more time. Do you have any tips on how to convert this regex into an NFA without epsilon-transitions?

  • @deepakjain4481
    @deepakjain4481 10 місяців тому

    thanks a lot thanks a lot you are my saviour i was so stressed

  • @carina.zip2002
    @carina.zip2002 9 місяців тому

    this made so much sense than you so much!! really helping me in my algo analysis class :))

  • @CK-od6ig
    @CK-od6ig Рік тому +1

    If we had the regular expression a(abb)* U c and instead of b we put c in place of the corresponding b in the NFA how would the NFA accept for example the string αc ?

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

      It doesn't. The strings accepted would be {EMPTY, c, a, aabb, aabbabb,...}. It's the union of the unitary string 'c' and the strings generated bu the regular expression a(abb)*, that is, string that start with 'a' and has any amount of 'abb's, even none.

  • @taha5539
    @taha5539 8 місяців тому

    Can we get rid of some of the epsilons?

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

    You are my savior.

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

    Thank you so much! Very good explanation and procedure!

  • @Karim-nq1be
    @Karim-nq1be Рік тому

    That was easy indeed and brilliantly explained.

  • @annafebland4460
    @annafebland4460 Місяць тому

    Thank you! Very easy to understand ❤❤❤

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

    Thank you, I'd request please more pumping lemmas problems :)

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

    how would you convert this to left linear grammar? with all the Epsilons?

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

    great explanation as always!

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

    simple and well explained

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

    Awesome and explained clearly, thank you!

  • @KevinGarcia-ws1kt
    @KevinGarcia-ws1kt Рік тому +1

    is the union and the Plus sign the same ??

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

    Thanks, very helpful!!

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

    Thanks I learnt a lot from your videos

  • @golden-jungoo655
    @golden-jungoo655 7 місяців тому

    Thank you so much ^^

  • @최현아-i4n
    @최현아-i4n Рік тому

    this video will be my source for compiler class lmao

  • @camdenwyeth316
    @camdenwyeth316 10 місяців тому

    Thanks! This was helpful :D

  • @MiguelMartinez-yj7yu
    @MiguelMartinez-yj7yu 2 роки тому

    You're amazing, man!

  • @zeynepbasoglu3426
    @zeynepbasoglu3426 10 місяців тому

    great video 😍

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

    Thank you!

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

    Amazing thank u so so much

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

    THANK U MAN U ROCK

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

    ty

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

    barra yarham bouk

  • @THEoneandonlystika
    @THEoneandonlystika 5 місяців тому

    complicated thiongs

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

    that was eazzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzi

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

    Go to an indian teacher they are very good in teaching..

  • @ConradRobert-y3q
    @ConradRobert-y3q 22 години тому

    6997 Jerrod Overpass