HiveBrain v1.2.0
Get Started
← Back to all entries
patternModerate

Is every language with a finite number of strings regular?

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
numberfinitewithregulareverylanguagestrings

Problem


  • Is every language with a finite number of strings regular?



  • Is the language of all strings regular?



I am new to this topic and got confused. Can any one please help me with this?

Solution

-
Yes. Assume the language is $L=\{w_1,w_2,\ldots, w_n\}$. then you can form the regular expression $w_1 + w_2 + \cdots + w_n$, which describes $L$.

You can also argue with finite automata or regular grammars.

-
Yes, if your alphabet is $\Sigma=(a_1,\ldots,a_k)$ then the regular expression $(a_1+a_2+\cdots +a_k)^*$ describes the languages of all possible strings over $\Sigma$.

Context

StackExchange Computer Science Q#9773, answer score: 11

Revisions (0)

No revisions yet.