NFA to Regex Conversion Example #1, "Simple" (GNFA Method)

Sdílet
Vložit
  • čas přidán 7. 09. 2024

Komentáře • 38

  • @kostastsaousis7445
    @kostastsaousis7445 Před 2 lety +5

    After having to search for hours to find a clear and simple explanation of NFA to regex with state eliminaiton, your video clearly beats everything else! Thank you very much and continue your amazing job!

  • @rushilpunya2552
    @rushilpunya2552 Před 2 lety +2

    Dude you are an absolute beast. Thanks so much for helping me get through CSE 355

  • @adityap613
    @adityap613 Před rokem

    Amazing video, understood how to do the conversion in 5 minutes.

  • @NuggzBii
    @NuggzBii Před 2 lety +13

    In your example around the 2 minute mark, you claim the automaton is a DFA. That is incorrect, because in a DFA, a state can never transition on two of the same symbol. I.e., q_2, cannot self loop, and transition to q_0 on the same input. That implies the automaton has guessing power, which is a prime characteristic of an NFA

    • @skmanoop
      @skmanoop Před 11 měsíci

      It is a typo. the self loop on q_2 is for input b instead of a.

  • @vincenzoriccardo138
    @vincenzoriccardo138 Před 2 měsíci

    good job fratm

  • @jussef2057
    @jussef2057 Před 2 lety

    That intro is a banger

  • @Baraa_ali62
    @Baraa_ali62 Před rokem

    Thanks , Great job

  • @satvikarya569
    @satvikarya569 Před 3 lety +8

    In 7:00 why it is not ( b* U ba*a)???

    • @selinamartinez8067
      @selinamartinez8067 Před 2 lety +3

      It's quite late, but I will answer it for you! In 7:00 , you should write b instead of b*. The reason is because it is still on the self loop transition(which is from qo to qo)! The sign '*' means that you're gonna use it instead of self loop transaction! You can use ( b U ba*a)* instead of ( b U ba*a) when you rip q0. Then now you can use * on the whole thing 'b U ba*a'. But 'b*' instead of 'b' what you said, can't be!

    • @rohanhaldiya6890
      @rohanhaldiya6890 Před rokem

      @@selinamartinez8067 Can you explain more?

  • @volkanulker6432
    @volkanulker6432 Před 2 lety

    So clear

  • @vimalathithand917
    @vimalathithand917 Před 8 měsíci

    Awesome !

  • @MLOasis
    @MLOasis Před 7 měsíci

    Shouldn't it be (b U (b a*)*) since we can loop as many times as we wish over q0 after removing q2 ?

  • @supamdeepbains5172
    @supamdeepbains5172 Před 2 lety

    Great video!!

  • @fpsgod7259
    @fpsgod7259 Před rokem

    Great video :)

  • @yusufaksoy3693
    @yusufaksoy3693 Před rokem

    Super.💪🤟

  • @Lexaugd
    @Lexaugd Před 3 lety

    I love your videos!
    I'd also like to ask a question:
    If the start state is also an accepting state and there is no more accepting states, do we draw an arrow from the universe to this start/accept state and back to the universe (Start/Finnish states)?

    • @EasyTheory
      @EasyTheory  Před 3 lety

      Thanks! What do you mean by "universe"?

    • @Lexaugd
      @Lexaugd Před 3 lety

      @@EasyTheory start is the state that goes to the accept state(state q0) with the empty string and the Finnish state to which the accept state arrives at with an empty string.

    • @EasyTheory
      @EasyTheory  Před 3 lety +1

      @@Lexaugd Ok then yes that's true. If the original NFA's start state was final, then in the "fixed" NFA there will be an epsilon transition from this state to a *brand new* final state. The reason to do this is that whatever the final state is, it cannot have any transitions "leaving" it.

    • @Lexaugd
      @Lexaugd Před 3 lety

      @@EasyTheory thank you, I really appreciate your response!

  • @mediaofhogwarts
    @mediaofhogwarts Před 3 lety

    Hello, can anyone tell me how i can write regex for the trap states ??? Do i just omit them and not take them into account ?

  • @ezhilvathani4669
    @ezhilvathani4669 Před 3 lety

    Sir why did you put whole * in last step (rip q0) but why no * for a in Rio q1

    • @EasyTheory
      @EasyTheory  Před 3 lety

      There was no self-loop for q1, so no * is added there.

  • @rheabhatia6607
    @rheabhatia6607 Před 4 lety

    How do you find regex given an nfa with multiple accepting states?

    • @EasyTheory
      @EasyTheory  Před 4 lety

      Rhea Bhatia good question! The idea is to put epsilon transitions from all accepting states to a new accepting state, and make all of the other accepting states now non-accepting. Should be easy to prove that it works.

  • @bloodthirstybutcher8365

    I ripped q1 first and got a shorter, different result: (b∪ba*a)*a is it wrong?

  • @siddhantdash4955
    @siddhantdash4955 Před 4 lety +1

    Is there any way to find minimal regex?

    • @EasyTheory
      @EasyTheory  Před 4 lety +9

      Good question! This is actually quite complicated, but there is: first, generate a regex for the corresponding NFA (and convert this NFA into an equivalent DFA D). Then, enumerate all possible regexes that are smaller than the one generated. For each, convert them to an equivalent DFA, and then check if the language of this DFA is the same as D's. Then keep the smallest regex that you found to be equivalent to D.
      The "interesting" question is whether we can make this algorithm faster. It turns out that, unless P = NP, there is no polynomial-time algorithm to find the smallest regex. In fact, the smallest regex *cannot even be approximated* in polynomial time.

    • @siddhantdash4955
      @siddhantdash4955 Před 4 lety +1

      @@EasyTheory wow!! Thanks.

  • @beyinforum
    @beyinforum Před 3 lety

    Can we do this for DFA`s?

    • @beyinforum
      @beyinforum Před 3 lety

      you are the best lol

    • @EasyTheory
      @EasyTheory  Před 3 lety +2

      @@beyinforum Thanks! And yes you can. Just use the same idea as this video (the machine doesn't have to be deterministic)

  • @aysamvaysa6155
    @aysamvaysa6155 Před 3 lety

    Hiiiii

  • @zeynepbasoglu3426
    @zeynepbasoglu3426 Před 9 měsíci