Regular Expression in Theory of Automata and Computation

Click For Summary

Discussion Overview

The discussion revolves around the interpretation and correctness of regular expressions in the context of automata theory. Participants analyze specific regular expressions, their implications, and potential errors in provided solutions.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant argues that the provided regular expression does not correctly represent the requirement that every block of 4 consecutive symbols contains at least 2 'a's, citing the example of "aabbbbaa" as a counterexample.
  • Another participant agrees that the expression admits "aabbbbaa" and suggests that the question may be poorly worded or the answer incorrect.
  • Participants discuss two proposed regular expressions: ((a+b)2)* + ((a+b)3)* and ((a+b)2)**((a+b)3)*, questioning whether they are equivalent.
  • It is noted that the second expression accepts strings of certain lengths (e.g., 5, 7) that the first does not, indicating a difference in their acceptance criteria.
  • There is a call for clarification on what the correct regular expression should be for the first part of the question.

Areas of Agreement / Disagreement

Participants generally agree that the initial question or provided solution may be misleading or incorrect. However, there is no consensus on what the correct regular expression should be, and multiple competing views remain regarding the proposed expressions.

Contextual Notes

Participants express uncertainty regarding the definitions and interpretations of the regular expressions, particularly in relation to the syntax used and its alignment with common practices in automata theory.

Crystal037
Messages
167
Reaction score
7
Homework Statement
Find the regular expression to accept strings following the conditions given below:
(i)strings of a's and b's such that every block of 4 consecutive symbols contains at least 2 a's
(i)strings of a's and b's whose length is either even or a multiple of 3 or both
Relevant Equations
I will use E to denote epsilon that is empty string
In first part,since every block of 4 consecutive symbol contain at least 2 a's
The answer in notes is given
(aa(a+b)(a+b)+a(a+b)a(a+b)+a(a+b)(a+b)a+(a+b)aa(a+b)+(a+b)a(a+b)a+(a+b)(a+b)aa)+
But this wont be true since if we choose aabbbbaa which is possible according to the above regular expression, it wont be correct since there's a block with 4 consecutive b's
In 2nd part,
I have come up with 2 answers, are both of these same
((a+b)2)*+((a+b)3)*
and ((a+b)2)**((a+b)3)*
 
Physics news on Phys.org
In 2022 when we use the term "regular expression" most people think of "Perl compatible regular expressions" (PCRE); the syntax you are using is not PCRE, nor is it the same as anything else I have seen before. In particular it is more complicated than we usually use in the theory of automata.

Anyway, for your answers:
(i) I agree that the given expression admits aabbbbaa; either the question is poorly worded or the answer is wrong
(ii) Assuming (a+b) means "a or b" and R2 means "RR" then (a+b)2 admits "aa", "ab", "ba" or "bb" which is not going to help.
 
Last edited:
  • Like
Likes   Reactions: FactChecker
pbuk said:
In 2022 when we use the term "regular expression" most people think of "Perl compatible regular expressions" (PCRE); the syntax you are using is not PCRE, nor is it the same as anything else I have seen before. In particular it is more complicated than we usually use in the theory of automata.

Anyway, for your answers:
(i) I agree that the given expression admits aabbbbaa; either the question is poorly worded or the answer is wrong
(ii) Assuming (a+b) means "a or b" and R2 means "RR" then (a+b)2 admits "aa", "ab", "ba" or "bb" which is not going to help.
This would give string of length 2, I have used a * kleen star above the whole thing, which will give multiples of 2
 
$$((a+b)^2)^*+((a+b)^3)^*$$
$$((a+b)^2)^*((a+b)^3)^*$$

If the above is what you meant, the two aren't equivalent, because, as an example, the second one accepts strings of length 5, or 7, or ##2k+3j## in general.

I agree with pbuk that the first question is either worded in a misleading way or the solution in the notes is incorrect. I think they mean each block $$x_{4i}x_{4i+1}x_{4i+2}x_{4i+3}$$ contains 2 a's.
 
Last edited:
Jarvis323 said:
$$((a+b)^2)^*+((a+b)^3)^*$$
$$((a+b)^2)^*((a+b)^3)^*$$

If the above is what you meant, the two aren't equivalent, because, as an example, the second one accepts strings of length 5, or 7, or ##2k+3j## in general.

I agree with pbuk that the first question is either worded in a misleading way or the solution in the notes is incorrect. I think they mean each block $$x_{4i}x_{4i+1}x_{4i+2}x_{4i+3}$$ contains 2 a's.
ok and for the first part for the given question what should be the correct regular expression
 
Crystal037 said:
ok and for the first part for the given question what should be the correct regular expression
It wouldn't help to just give you an answer.

If there is a TA or instructor you can contact, I would ask them for clarification.
 

Similar threads

  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 21 ·
Replies
21
Views
3K