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

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

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

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

    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 2 ปีที่แล้ว +3

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

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

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

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

    Thanks , Great job

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

    That intro is a banger

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

    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 ปีที่แล้ว

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

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

    Great video!!

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

    good job fratm

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

    Awesome !

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

    Great video :)

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

    thank you so much !!!!

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

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

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

    So clear

  • @Kbro91
    @Kbro91 19 วันที่ผ่านมา

    What if the original initial state was also a final state?

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

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

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

      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 ปีที่แล้ว

      @@selinamartinez8067 Can you explain more?

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

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

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

    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  4 ปีที่แล้ว

      Thanks! What do you mean by "universe"?

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

      @@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  4 ปีที่แล้ว +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 4 ปีที่แล้ว

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

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

    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 ?

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

    Super.💪🤟

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

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

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

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

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

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

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

      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.

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

    Is there any way to find minimal regex?

    • @EasyTheory
      @EasyTheory  4 ปีที่แล้ว +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 4 ปีที่แล้ว +1

      @@EasyTheory wow!! Thanks.

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

    goat 🐐🐐🐐

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

    Can we do this for DFA`s?

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

      you are the best lol

    • @EasyTheory
      @EasyTheory  4 ปีที่แล้ว +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 3 ปีที่แล้ว

    Hiiiii

  • @QuynhNhu-gu5ql
    @QuynhNhu-gu5ql หลายเดือนก่อน

    mumum

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