How can I continue to find a regular expression?

  • Context:
  • Thread starter Thread starter evinda
  • Start date Start date
  • Tags Tags
    Expression Regular
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
8 replies · 3K views
evinda
Gold Member
MHB
Messages
3,741
Reaction score
0
Hello! :)
I have a question:
Suppose that $\Sigma=\{0,1\}$.Is the language $\{0^{m}1^{n}:m+n \geq 2\}$ regular?
I tried to find a regular expression.I checked the case $m+n=2$ and I found that the possible words are $00,01,11$ .But..how can I continue? :confused:
 
Physics news on Phys.org
Re: How can I continue?

evinda said:
Hello! :)
I have a question:
Suppose that $\Sigma=\{0,1\}$.Is the language $\{0^{m}1^{n}:m+n \geq 2\}$ regular?
I tried to find a regular expression.I checked the case $m+n=2$ and I found that the possible words are $00,01,11$ .But..how can I continue? :confused:

Perhaps you can concatenate an arbitrary number of zeroes to the left side of each of those possible words?
And also concatenate an arbitrary number of ones on the right side?
 
Re: How can I continue?

I like Serena said:
Perhaps you can concatenate an arbitrary number of zeroes to the left side of each of those possible words?
And also concatenate an arbitrary number of ones on the right side?

So,you mean that the regular expression is
$$ \{0^{*} \cdot 00 \cdot 1^{*}|0^{*} \cdot 01 \cdot 1^{*}|0^{*} \cdot 11 \cdot 1^{*}\}$$
?
 
Re: How can I continue?

evinda said:
So,you mean that the regular expression is
$$ \{0^{*} \cdot 00 \cdot 1^{*}|0^{*} \cdot 01 \cdot 1^{*}|0^{*} \cdot 11 \cdot 1^{*}\}$$
?

We'll have to verify! (Wondering)
All words in the regular expression should be contained in the language, and conversely all words in the language should match with the regular expression.

Are all words formed by the regular expression part of the language?

For the other direction, suppose we pick m=0, that is, no zeroes, are all words with only $1$'s matched by the regular expression?
How about m=1, m=2, and m>2?
 
Re: How can I continue?

I like Serena said:
We'll have to verify! (Wondering)
All words in the regular expression should be contained in the language, and conversely all words in the language should match with the regular expression.

Are all words formed by the regular expression part of the language?
Since,each word has at least 2 symbols and the sequence of $0$ precedes the sequence of $1$,all words formed by the regular expression are part of the language.Or am I wrong? :confused:

I like Serena said:
For the other direction, suppose we pick m=0, that is, no zeroes, are all words with only $1$'s matched by the regular expression?
How about m=1, m=2, and m>2?

When $m=0$,we get a sequence only of $1$'s,from $0^{*} \cdot 11 \cdot 1^{*}$,for $m=1$ we get a word from $0^{*} \cdot 01 \cdot 1^{*}$ or from $0^{*} \cdot 11 \cdot 1^{*}$, for $m \geq 2$ we get a word from $0^{*} \cdot 00 \cdot 1^{*} $ or from $0^{*} \cdot 01 \cdot 1^{*}$ or from $0^{*} \cdot 11 \cdot 1^{*}$ .

So,the expression is correct?? :confused:
 
Re: How can I continue?

evinda said:
Since,each word has at least 2 symbols and the sequence of $0$ precedes the sequence of $1$,all words formed by the regular expression are part of the language.Or am I wrong? :confused:
When $m=0$,we get a sequence only of $1$'s,from $0^{*} \cdot 11 \cdot 1^{*}$,for $m=1$ we get a word from $0^{*} \cdot 01 \cdot 1^{*}$ or from $0^{*} \cdot 11 \cdot 1^{*}$, for $m \geq 2$ we get a word from $0^{*} \cdot 00 \cdot 1^{*} $ or from $0^{*} \cdot 01 \cdot 1^{*}$ or from $0^{*} \cdot 11 \cdot 1^{*}$ .

So,the expression is correct?? :confused:

Without the :confused: sentences it is all correct. :p
 
Re: How can I continue?

I like Serena said:
Without the :confused: sentences it is all correct. :p

Great! ;)

So,could I write it like that?
The possible words with length 2 are $00,01,11$.
To have words with length greater than 2,we concatenate an arbitrary number of zeroes to the left side of each of those possible words and an arbitrary number of ones on the right side.So,the expression is $\{0^{*} \cdot 00 \cdot 1^{*}|0^{*} \cdot 01 \cdot 1^{*}| 0^{*}\cdot 11 \cdot 1^{*} \}$ and then I will show that it is valid?
 
Re: How can I continue?

evinda said:
Great! ;)

So,could I write it like that?
The possible words with length 2 are $00,01,11$.
To have words with length greater than 2,we concatenate an arbitrary number of zeroes to the left side of each of those possible words and an arbitrary number of ones on the right side.So,the expression is $\{0^{*} \cdot 00 \cdot 1^{*}|0^{*} \cdot 01 \cdot 1^{*}| 0^{*}\cdot 11 \cdot 1^{*} \}$ and then I will show that it is valid?

Yep! (Whew)
 
Re: How can I continue?

I like Serena said:
Yep! (Whew)

Nice!Thank you very much for your help! :)