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

  Рет қаралды 29,067

Easy Theory

Easy Theory

Күн бұрын

Пікірлер: 42
@kostastsaousis7445
@kostastsaousis7445 2 жыл бұрын
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 жыл бұрын
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.
@NuggzBii
@NuggzBii 3 жыл бұрын
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.
@Baraa_ali62
@Baraa_ali62 2 жыл бұрын
Thanks , Great job
@jussef2057
@jussef2057 2 жыл бұрын
That intro is a banger
@supamdeepbains5172
@supamdeepbains5172 3 жыл бұрын
Great video!!
@vimalathithand917
@vimalathithand917 10 ай бұрын
Awesome !
@elmerfuddpt2
@elmerfuddpt2 Ай бұрын
thank you so much !!!!
@volkanulker6432
@volkanulker6432 3 жыл бұрын
So clear
@fpsgod7259
@fpsgod7259 Жыл бұрын
Great video :)
@vincenzoriccardo138
@vincenzoriccardo138 4 ай бұрын
good job fratm
@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 ?
@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 жыл бұрын
@@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!
@Kbro91
@Kbro91 10 күн бұрын
What if the original initial state was also a final state?
@yusufaksoy3693
@yusufaksoy3693 2 жыл бұрын
Super.💪🤟
@satvikarya569
@satvikarya569 4 жыл бұрын
In 7:00 why it is not ( b* U ba*a)???
@selinamartinez8067
@selinamartinez8067 2 жыл бұрын
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?
@siddhantdash4955
@siddhantdash4955 4 жыл бұрын
Is there any way to find minimal regex?
@EasyTheory
@EasyTheory 4 жыл бұрын
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 жыл бұрын
@@EasyTheory wow!! Thanks.
@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.
@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.
@TheAmazingLife19
@TheAmazingLife19 Ай бұрын
goat 🐐🐐🐐
@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 ?
@beyinforum
@beyinforum 4 жыл бұрын
Can we do this for DFA`s?
@beyinforum
@beyinforum 4 жыл бұрын
you are the best lol
@EasyTheory
@EasyTheory 4 жыл бұрын
@@beyinforum Thanks! And yes you can. Just use the same idea as this video (the machine doesn't have to be deterministic)
@bloodthirstybutcher8365
@bloodthirstybutcher8365 2 жыл бұрын
I ripped q1 first and got a shorter, different result: (b∪ba*a)*a is it wrong?
@aysamvaysa6155
@aysamvaysa6155 3 жыл бұрын
Hiiiii
@QuynhNhu-gu5ql
@QuynhNhu-gu5ql Ай бұрын
mumum
@zeynepbasoglu3426
@zeynepbasoglu3426 11 ай бұрын
NFA to Regular Expression Conversion, and Example
14:46
Easy Theory
Рет қаралды 102 М.
Каха и лужа  #непосредственнокаха
00:15
2 MAGIC SECRETS @denismagicshow @roman_magic
00:32
MasomkaMagic
Рет қаралды 31 МЛН
СОБАКА ВЕРНУЛА ТАБАЛАПКИ😱#shorts
00:25
INNA SERG
Рет қаралды 3,1 МЛН
Walking on LEGO Be Like... #shorts #mingweirocks
00:41
mingweirocks
Рет қаралды 6 МЛН
Regular Expression (Regex) to NFA Conversion
10:39
Easy Theory
Рет қаралды 32 М.
What is the Pumping Lemma
5:11
lydia
Рет қаралды 128 М.
Conversion of NFA to Regex PROOF (GNFA Method)
33:14
Easy Theory
Рет қаралды 7 М.
Minimization of DFA (Example 1)
15:56
Neso Academy
Рет қаралды 1,7 МЛН
Conversion of Regex to DFA Directly with Brzozowski Derivatives
11:08
Regular Expression Examples
10:49
Easy Theory
Рет қаралды 9 М.
Conversion of NFA to DFA (Powerset/Subset Construction Example)
12:31
NFA to Regular Expression Conversion
13:37
Neso Academy
Рет қаралды 942 М.
Pumping Lemma (For Regular Languages) | Example 1
14:16
Neso Academy
Рет қаралды 1,2 МЛН
The "General" General NFA Method (NFA to Regex, GNFA)
17:03
Easy Theory
Рет қаралды 3,2 М.
Каха и лужа  #непосредственнокаха
00:15