问题 单项选择题

下图所示的有限自动机中,s0是初始状态,s3为终止状态,该自动机不能识别 (31)

A.abab
B.aaaa
C.babb
D.abba

答案

参考答案:A

解析: 本题考查程序语言基础知识。
一个有限自动机所识别的语言是从开始状态到终止状态所有路径上的字符串的集合。要判断一个字符串能否被指定的自动机识别,就看在该自动机的状态图中能否找到一条从开始状态到达终止状态的路径,且路径上的字符串等于需要识别的字符串。
对于字符串“abab”,其识别路径为s0→s1→s2→s1→s2,字符串结束时的状态不是终止状态,所以该自动机不能识别“ahab”。
对于字符串“aaaa”,其识别路径为s0→s1→s3→s3→s3,字符串结束时的状态是终止状态,所以该自动机可以识别“aaaa”。
对于字符串“babb”,其识别路径为s0→s2→s1→s2→s3,字符串结束时的状态是终止状态,所以该自动机可以识别“babb”。
对于字符串“abba”,其识别路径为s0→s1→s2→s3→s3,字符串结束时的状态是终止状态,所以该自动机可以识别“abba”。

不定项选择
单项选择题

B

Many animals recognize their food because they see it. So do humans. When you see an apple or a piece of chocolate you know that these are things you can eat. You can also use other senses when you choose your food. You may like it because it smells good or because it tastes good. You may dislike some types of food because they do not look, smell or taste very nice. Different animals use different senses to find and choose their food. A few animals depend on only one of their senses, while most animals use more than one sense.

Although there are many different types of food, some animals spend their lives eating only one type. The giant panda(大熊猫) eats only one particular type of bamboo(竹子). Other animals eat only one type of food even when given the choice. A kind of white butterfly(蝴蝶)will stay on the leaves of a cabbage, even though there are plenty of other vegetables in the garden. However, most animals have a more varied diet(多样化饮食). The bear eats fruits and fish. The fox eats small animals, birds and fruits. The diet of these animals will be different depending on the season.

Humans have a very varied diet. We often eat food because we like it and not because it is good for us. In countries such as France and Britain, people eat food with too much sugar. This makes them overweight, which is bad for their health. Eating too much red meat and animal products, such as butter, can also be bad for the health. Choosing the right food, therefore, has become an area of study in modern life.

Which of the following eats only one type of food().

A. The white butterfly.

B. The small bird.

C. The bear.

D. The fox.