Construct a regular expression

Multi tool use
up vote
2
down vote
favorite
The problem asks me to construct a regular expression for the set of strings in {a,b}* that have even number of a and b.
What I have tried is (aa)* + (bb)* + (aabb)* but I believe it does not cover a string like abbbaaba.
Many thanks,
discrete-mathematics regular-expressions
New contributor
Alan Bui is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
|
show 1 more comment
up vote
2
down vote
favorite
The problem asks me to construct a regular expression for the set of strings in {a,b}* that have even number of a and b.
What I have tried is (aa)* + (bb)* + (aabb)* but I believe it does not cover a string like abbbaaba.
Many thanks,
discrete-mathematics regular-expressions
New contributor
Alan Bui is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Where the $*$ in the post refers to a Kleene star for a finite alphabet: $A^* =cup_{n=1}^infty A^n$ ?
– Mason
Nov 20 at 1:14
Can you be more simple please, I am quite new to this :)
– Alan Bui
Nov 20 at 1:17
I have done anything yet. You use a $*$ in your post. What does it mean? It must mean kleene star?
– Mason
Nov 20 at 1:19
@Mason yes it is
– Alan Bui
Nov 20 at 1:21
1
Are you familiar with the procedure, given a deterministic finite state machine, to find a corresponding regular expression? If so, that's probably the approach I'd take - first, construct the state machine with states $EE,EO,OE,OO$ and then find the corresponding regular expression.
– Daniel Schepler
Nov 20 at 1:22
|
show 1 more comment
up vote
2
down vote
favorite
up vote
2
down vote
favorite
The problem asks me to construct a regular expression for the set of strings in {a,b}* that have even number of a and b.
What I have tried is (aa)* + (bb)* + (aabb)* but I believe it does not cover a string like abbbaaba.
Many thanks,
discrete-mathematics regular-expressions
New contributor
Alan Bui is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
The problem asks me to construct a regular expression for the set of strings in {a,b}* that have even number of a and b.
What I have tried is (aa)* + (bb)* + (aabb)* but I believe it does not cover a string like abbbaaba.
Many thanks,
discrete-mathematics regular-expressions
discrete-mathematics regular-expressions
New contributor
Alan Bui is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Alan Bui is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Alan Bui is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked Nov 20 at 1:04
Alan Bui
113
113
New contributor
Alan Bui is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Alan Bui is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Alan Bui is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Where the $*$ in the post refers to a Kleene star for a finite alphabet: $A^* =cup_{n=1}^infty A^n$ ?
– Mason
Nov 20 at 1:14
Can you be more simple please, I am quite new to this :)
– Alan Bui
Nov 20 at 1:17
I have done anything yet. You use a $*$ in your post. What does it mean? It must mean kleene star?
– Mason
Nov 20 at 1:19
@Mason yes it is
– Alan Bui
Nov 20 at 1:21
1
Are you familiar with the procedure, given a deterministic finite state machine, to find a corresponding regular expression? If so, that's probably the approach I'd take - first, construct the state machine with states $EE,EO,OE,OO$ and then find the corresponding regular expression.
– Daniel Schepler
Nov 20 at 1:22
|
show 1 more comment
Where the $*$ in the post refers to a Kleene star for a finite alphabet: $A^* =cup_{n=1}^infty A^n$ ?
– Mason
Nov 20 at 1:14
Can you be more simple please, I am quite new to this :)
– Alan Bui
Nov 20 at 1:17
I have done anything yet. You use a $*$ in your post. What does it mean? It must mean kleene star?
– Mason
Nov 20 at 1:19
@Mason yes it is
– Alan Bui
Nov 20 at 1:21
1
Are you familiar with the procedure, given a deterministic finite state machine, to find a corresponding regular expression? If so, that's probably the approach I'd take - first, construct the state machine with states $EE,EO,OE,OO$ and then find the corresponding regular expression.
– Daniel Schepler
Nov 20 at 1:22
Where the $*$ in the post refers to a Kleene star for a finite alphabet: $A^* =cup_{n=1}^infty A^n$ ?
– Mason
Nov 20 at 1:14
Where the $*$ in the post refers to a Kleene star for a finite alphabet: $A^* =cup_{n=1}^infty A^n$ ?
– Mason
Nov 20 at 1:14
Can you be more simple please, I am quite new to this :)
– Alan Bui
Nov 20 at 1:17
Can you be more simple please, I am quite new to this :)
– Alan Bui
Nov 20 at 1:17
I have done anything yet. You use a $*$ in your post. What does it mean? It must mean kleene star?
– Mason
Nov 20 at 1:19
I have done anything yet. You use a $*$ in your post. What does it mean? It must mean kleene star?
– Mason
Nov 20 at 1:19
@Mason yes it is
– Alan Bui
Nov 20 at 1:21
@Mason yes it is
– Alan Bui
Nov 20 at 1:21
1
1
Are you familiar with the procedure, given a deterministic finite state machine, to find a corresponding regular expression? If so, that's probably the approach I'd take - first, construct the state machine with states $EE,EO,OE,OO$ and then find the corresponding regular expression.
– Daniel Schepler
Nov 20 at 1:22
Are you familiar with the procedure, given a deterministic finite state machine, to find a corresponding regular expression? If so, that's probably the approach I'd take - first, construct the state machine with states $EE,EO,OE,OO$ and then find the corresponding regular expression.
– Daniel Schepler
Nov 20 at 1:22
|
show 1 more comment
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Alan Bui is a new contributor. Be nice, and check out our Code of Conduct.
Alan Bui is a new contributor. Be nice, and check out our Code of Conduct.
Alan Bui is a new contributor. Be nice, and check out our Code of Conduct.
Alan Bui is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3005788%2fconstruct-a-regular-expression%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
OLwzXvrp knBEn1Oxrq52fRFTD 7eOR5IpoGn CVrOP5w8s,Zc,OTsqO bvd1IlhxgG c8XLbJka LEiG,tTBci rf NtqrT jGf
Where the $*$ in the post refers to a Kleene star for a finite alphabet: $A^* =cup_{n=1}^infty A^n$ ?
– Mason
Nov 20 at 1:14
Can you be more simple please, I am quite new to this :)
– Alan Bui
Nov 20 at 1:17
I have done anything yet. You use a $*$ in your post. What does it mean? It must mean kleene star?
– Mason
Nov 20 at 1:19
@Mason yes it is
– Alan Bui
Nov 20 at 1:21
1
Are you familiar with the procedure, given a deterministic finite state machine, to find a corresponding regular expression? If so, that's probably the approach I'd take - first, construct the state machine with states $EE,EO,OE,OO$ and then find the corresponding regular expression.
– Daniel Schepler
Nov 20 at 1:22