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

Is $\{w_1xw_2\mid w_1,w_2\in \{a,b\}^* \text{ and } x \in \{a,b\}\}$ regular or not?

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

Problem

The language given is $L = \{w_1xw_2\mid w_1,w_2\in \{a,b\}^* \text{ and } x \in \{a,b\}\}$. Is this language regular or not?

Since there is no pattern, so it should be non-regular?

Kindly help!

Solution

The language is regular and a possible regular expression for $L$ is $(a\mid b)^ (a \mid b) (a \mid b)^ = (a \mid b)^+$.

Context

StackExchange Computer Science Q#142565, answer score: 17

Revisions (0)

No revisions yet.