简体   繁体   中英

Automata regular expression {0+1}*

I'm new in Automata concept AND In some papers I found {0,1}* .

  1. Is it same as (0+1)*

  2. Also can we generate 101 from the (0+1)*

  3. can we generate 101 from the {0,1}*
    if 1) answer is NO

PLEASE any one help me to solve this confusion..

If all of them are found in computer science paper and computational theory books , then yes, they are likely the same.

  • In the notation {0,1}* , set notation {0,1} is used to denote "0 or 1".

  • Alternatively, + is also used to denote alternation ( JFLAP , for example). So (0+1) can also mean "0 or 1".

  • | is also used to denote alternation (0|1) in theoretical computer science context. This is also the syntax for alternation in many regex engines.

The Kleene star * is, having the same notation in both theoretical regular expression (books, paper) and practical regex library, denotes repetition of 0 or more times of the preceding atom.

Since they mean "(0 or 1) repeated 0 or more times", both of them can generate the language 101 .

As @Bergi mentioned in the comment, you should take a step back when you see both syntax being used in the same book/paper. For example, @paarandika noted that + can actually means "repeat once or more times" in book/paper if it is in superscript.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM