Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is regularity?

This is more of a computer science question than a programming one, but I figure that this is the best place out of all the related sites to ask this.

When I discovered Regular Expressions and looked up the term I assumed that this property of "regularity" refers to the fact that the expression's language has a definable structural pattern. However, in reading about the subject and the theory behind this I learned that there are kinds of languages that are not regular, and yet from the way they are defined it's clear that a pattern can be matched to them. One such language is (a^n)(b^n). Clearly this is a pattern, and yet this is not a regular language. So now I'm left wondering what is it about regular languages that makes them regular, and this language not?

like image 874
EpsilonVector Avatar asked Jan 09 '10 01:01

EpsilonVector


People also ask

What is the word regularity mean?

Definition of regularity 1 : the quality or state of being regular. 2 : something that is regular.

What does regularity mean in fitness?

The principle of regularity means that you must participate in physical activity regularly for it to be effective. In other words “move it or lose it”. The principle of individuality means that your training program must meet your goals and objectives. Everyone starts at a different place.

What is a synonym for regularity?

Synonyms & Near Synonyms for regularity. chronicity, constancy, continuousness.

What is regular and example?

Regular is defined as someone or something that is standard, average, orderly or usual person or thing or something that is done habitually. An example of regular is a woman five feet five inches tall; the regular, average height for a woman.


1 Answers

Intuitively explaining computer science is... tricky. I'll give it a shot, but keep in mind that some of this is going to be "close enough" but not theoretically rigorous.

A regular language is one that can be decided by a machine that is computational equivalent to a finite automata (DFA/NDFA). A finite automata can be thought of as a machine that operates purely in states, no storage. So you can see that anbn cannot be regular as it requires a machine that can count the number of a's and b's (and thus must have infinite* storage capacity) in order to compare them.

For comparison, (abc)nis regular, because the number of repetitions is irrelevant.

For a more rigorous (and correspondingly denser view) check the wikipedia article and linked pages.

*The infinite doesn't matter here, but I mention it for completeness. It might be easier to think of it as "luckily, always just enough" storage.

like image 117
Kevin Montrose Avatar answered Sep 29 '22 09:09

Kevin Montrose