Skip to main content
deleted 2 characters in body; edited title
Source Link
Yuval Filmus
  • 279.1k
  • 27
  • 316
  • 512

regular Regular expression for binary language haswords over $\{0,1\}$ containing at least one 1

So I had an exam in the subject "Theory Of Computation"on Theory of Computation, and one of the questions was to write down a regular expression of a binaryfor the language that hasover $\{0,1\}$ consisting of all words containing at least one (1) , my1. My answer was  :

0* 1 0* (0* 1 0*)*$$ 0^* 1 0^* (0^* 1 0^*)^* \, . $$

My teacher gave me one mark out of 5 on in, yet i cantI can't find a possible string that will give false output here! hisHis answer, which was $(0+1)^*1(0+1)^*$, was better, but mine works as well(i think)

his answer :

(0+1)* 1 (0+1)*, I believe.

Please someone tell me if my answer is correct or not?

Is my answer correct?

regular expression for binary language has at least one 1

So I had an exam in the subject "Theory Of Computation" and one of the questions was to write down a regular expression of a binary language that has at least one (1) , my answer was  :

0* 1 0* (0* 1 0*)*

My teacher gave me one mark out of 5 on in yet i cant find a possible string that will give false output here! his answer was better but mine works as well(i think)

his answer :

(0+1)* 1 (0+1)*

Please someone tell me if my answer is correct or not?

Regular expression for words over $\{0,1\}$ containing at least one 1

I had an exam on Theory of Computation, and one of the questions was to write down a regular expression for the language over $\{0,1\}$ consisting of all words containing at least one 1. My answer was:

$$ 0^* 1 0^* (0^* 1 0^*)^* \, . $$

My teacher gave me one mark out of 5, yet I can't find a possible string that will give false output here! His answer, which was $(0+1)^*1(0+1)^*$, was better, but mine works as well, I believe.

Is my answer correct?

Tweeted twitter.com/#!/StackCompSci/status/541728842323615744
edited tags
Link
Raphael
  • 72.9k
  • 30
  • 181
  • 393
Source Link

regular expression for binary language has at least one 1

So I had an exam in the subject "Theory Of Computation" and one of the questions was to write down a regular expression of a binary language that has at least one (1) , my answer was :

0* 1 0* (0* 1 0*)*

My teacher gave me one mark out of 5 on in yet i cant find a possible string that will give false output here! his answer was better but mine works as well(i think)

his answer :

(0+1)* 1 (0+1)*

Please someone tell me if my answer is correct or not?