Real questions for software designers, special exercises in programming language (9)

Video explanation

Software Designer Morning Questions Programming Topic

formal form

The set of strings constructed from a and b and containing only an even number of a's is expressed in a regular form as (49). (First half of 2009)
Insert image description here

In the regular expression, the symbol means repetition several times (including 0 times), so the regular expression "(aa)" in >a)*" it is guaranteed that an even number of a's appear. " and "(a/b)* (aa)b)" cannot guarantee an even number. a. In the same way, "(a* (ba*)ba)

Insert image description here

(50)
A. The beginning and end must be 0 B. 1 must appear an even number of times
C. 0 cannot appear continuously D. 1 cannot appear continuously

The closure operator "" connects its operands several times, so 0 represents a string composed of several Оs, and ( 10*l)* represents a string composed of an even number of 1's.

Insert image description here

Insert image description here

The characteristics of the string represented by aa bb’ are: several a followed by several b, both a and b appear at least once. The characteristics of the string represented by a bb* are: several a's followed by several b's, a may not appear, and b appears at least once.
The characteristics of the string represented by aa b are: several a followed by several b, a appears at least once, and b does not need to appear.
The characteristics of the string represented by ab are: several a's followed by several b's, and both a and b do not need to appear.
In language L= {a"b" |m≥0,n>l, several a's are followed by several b's, a may not appear, and b appears at least once.

In a string consisting of characters a and b, if each a is followed by at least one b, then the string set can be expressed in a regular form as (48). (Second half of 2016)
Insert image description here

Among all strings consisting only of characters a and b, the set of strings ending with b can be expressed in a regular form as (21). (First half of 2017)
Insert image description here

Guess you like

Origin blog.csdn.net/weixin_50843918/article/details/134990197