题目
题目

COMP30026_2025_SM2 2025 sample exam - Requires Respondus LockDown Browser

匹配题

Select the language generated by CFG #5 G = 0G0 | 1G1 | 0H1 | 1H0 H = AHA | A A = 0 | 1  1: Language of CFG #5

选项
A.L₁ ∩ L₂
B.
C.L₁ \ L₂
D.L₂
E.L₁
F.L₁^c ∩ L₂^c (where c = complement)
G.L₁ ∪ L₂
H.Σ*
查看解析

查看解析

标准答案
Please login to view
思路分析
We are given a matching question about the language generated by CFG #5, with the provided answer indicating the correct match is L₁ \ L₂. First, recall what the CFG #5 grammar produces. The productions are: - G = 0G0 | 1G1 | 0H1 | 1H0 - H = AHA | A - A = 0 | 1 This construction starts from H (which can be a single symbol A, i.e., 0 or 1) and applies either wrap-around with matching ends (0G0 or 1G1) or wrap-around with differing ends (0H1 or 1H0). From this, you can see that the strings generated by G have a clear pattern in length: H yields strings of length 1, and every subsequent application of 0G0, 1G1, 0H1, or 1H0 increases the length by 2. Therefore, all strings produced by CFG #5 have odd length (1, 3, 5, …). Moreover, the alphabet is {0,1}. Now let’s analyze the answer options in light of this understanding. Option 1: L₁ ∩ L₂ - If we intersect two languages, the result contains o......Login to view full explanation

登录即可查看完整答案

我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!