Construct a regular expression











up vote
2
down vote

favorite
3












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,










share|cite|improve this question







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















up vote
2
down vote

favorite
3












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,










share|cite|improve this question







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













up vote
2
down vote

favorite
3









up vote
2
down vote

favorite
3






3





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,










share|cite|improve this question







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






share|cite|improve this question







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.











share|cite|improve this question







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.









share|cite|improve this question




share|cite|improve this question






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


















  • 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















active

oldest

votes











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






Alan Bui is a new contributor. Be nice, and check out our Code of Conduct.










 

draft saved


draft discarded


















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






























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.










 

draft saved


draft discarded


















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.















 


draft saved


draft discarded














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





















































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







Popular posts from this blog

To store a contact into the json file from server.js file using a class in NodeJS

Redirect URL with Chrome Remote Debugging Android Devices

Dieringhausen