LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-03-2023, 05:14 AM   #1
ajiten
Member
 
Registered: Jun 2023
Posts: 377

Rep: Reputation: 4
No DFA for the regular language 0*1*.


Find the DFA for the regular language 0*1*

Even in JFLAP, there is no option seemingly to convert NFA for the above regular language to DFA,
as ε transitions are not allowed in DFA.

So, can conclude that there are no DFA for this particular type of regular language(s).
 
Old 11-03-2023, 07:37 AM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,874
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
Code:
State Type       Transition on '0' Transition on '1'
A     Start,Stop A                 B
B     Stop       Error             B
 
1 members found this post helpful.
Old 11-03-2023, 07:41 AM   #3
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,786

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
Quote:
no option seemingly to convert NFA for the above regular language to DFA,
as ε transitions are not allowed in DFA.
https://www.geeksforgeeks.org/conver...on-nfa-to-nfa/
 
Old 11-03-2023, 09:30 PM   #4
ajiten
Member
 
Registered: Jun 2023
Posts: 377

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by NevemTeve View Post
Code:
State Type       Transition on '0' Transition on '1'
A     Start,Stop A                 B
B     Stop       Error             B
Your transition table seems for 0*1+, as don't need ε-transition to move from the state A to the state B.

Last edited by ajiten; 11-03-2023 at 09:47 PM.
 
Old 11-03-2023, 09:36 PM   #5
ajiten
Member
 
Registered: Jun 2023
Posts: 377

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by ntubski View Post
Where is given in the stated link, that ε-transition can be represented by a transition, on a symbol in the alphabet (Σ)?
Please note that the stated regular language is not: 0* + 1*; in which case it was quite easy to build DFA, with 1 state as both the initial & the final state.

Last edited by ajiten; 11-03-2023 at 09:51 PM.
 
Old 11-04-2023, 12:04 AM   #6
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,874
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
> Your transition table seems for 0*1+

That would be the case is 'A' weren't a stop-state. Please check every state again, and verify which ones are stop-states.

Note: it might help if we rewrite the expression as (ε|0+)(ε|1+) =
ε | 0+ | 1+ | 0+1+

Last edited by NevemTeve; 11-04-2023 at 12:46 AM.
 
2 members found this post helpful.
Old 11-04-2023, 02:39 AM   #7
ajiten
Member
 
Registered: Jun 2023
Posts: 377

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by NevemTeve View Post
> Your transition table seems for 0*1+

That would be the case is 'A' weren't a stop-state. Please check every state again, and verify which ones are stop-states.

Note: it might help if we rewrite the expression as (ε|0+)(ε|1+) =
ε | 0+ | 1+ | 0+1+
Thanks for that, but seems this simple example is dealt nowhere, in literature, or online.
Also, based on your example; can take the regular expression for the regular language: 0* + 1*; as: ε | 0+ | 1+ | (0 U 1)+
 
Old 11-04-2023, 04:52 AM   #8
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,874
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
I don't get your point, 0* | 1* can be rewritten as ε | 0+ | 1+

Note: here '+' means 'one or more occurances', '|' means alternatives
If you don't like this notattion, then write it this way:

0*+1* = ε+00*+11*

I.e. let's not use plus sign for two different things in the same expression.
 
1 members found this post helpful.
Old 11-04-2023, 08:05 AM   #9
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,786

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
Quote:
Originally Posted by ajiten View Post
Where is given in the stated link, that ε-transition can be represented by a transition, on a symbol in the alphabet (Σ)?
A single ε-transition can't necessarily be represented by a single transition on an alphabet symbol. The link shows how to convert a whole ε-NFA to an equivalent NFA with no ε-transitions. Hence the title "Conversion of Epsilon-NFA to NFA".
 
3 members found this post helpful.
Old 11-04-2023, 02:23 PM   #10
ajiten
Member
 
Registered: Jun 2023
Posts: 377

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by ntubski View Post
A single ε-transition can't necessarily be represented by a single transition on an alphabet symbol. The link shows how to convert a whole ε-NFA to an equivalent NFA with no ε-transitions. Hence the title "Conversion of Epsilon-NFA to NFA".
Sorry, that was there in the link.

Request more details on your opening sentence, as to when it is not possible (it is possible in the given regular language):
'A single ε-transition can't necessarily be represented by a single transition on an alphabet symbol.'

Last edited by ajiten; 11-04-2023 at 02:25 PM.
 
Old 11-05-2023, 12:21 AM   #11
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,786

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
Quote:
Originally Posted by ajiten View Post
Sorry, that was there in the link.

Request more details on your opening sentence, as to when it is not possible (it is possible in the given regular language):
'A single ε-transition can't necessarily be represented by a single transition on an alphabet symbol.'
If you follow the algorithm in the link, and an ε-transition gets turned into multiple alphabet transitions, then it can't be represented by a single one.
 
2 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to understand the theorem, for NFA to DFA conversion, in context of actual conversion, in gfg site. ajiten Programming 4 10-21-2023 04:02 PM
Find the number of lookahead characters, needed by Lex for given DFA, for scanning input. ajiten Programming 25 10-17-2023 02:58 AM
Check if dfa recognizes email addresses. ajiten Programming 7 08-07-2023 12:41 PM
XML to DFA converter lalitcoep Linux - Software 4 10-20-2010 04:02 AM
need to know how to copy a DFA onto a matrics matthew d Programming 1 05-03-2006 08:51 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration