b04902xxx 板


LINE

※ [本文转录自 NTU-Exam 看板 #1Kkthzyp ] 作者: irritum (働いたら 负け) 看板: NTU-Exam 标题: [试题] 103上 林智仁 自动机与形式语言 第二次期中考 时间: Sun Jan 18 17:20:56 2015 课程名称︰ 自动机与形式语言 课程性质︰ 必修 课程教师︰ 林智仁 开课学院: 电资学院 开课系所︰ 资讯工程 考试日期(年月日)︰ 2014/12/16 考试时限(分钟): 试题 : ‧ Please give details of your answer. A direct answer without explanation is not counted. ‧ Your answers must be in English. ‧ Please carefully read problem statements. ‧ During the exam you are not allowed to borrow other's class notes. ‧ Try to work on easier question first. Problem 1 (5 pts) Consider the following DFA, a ┌─┐────→╔═╗─┐b start →│q1│←────║q2║←┘ └─┘ a ╚═╝ ↑│ ↑ ││ │ b ││b │a ││ ╔═╗ │ │└─→║q3║─┘ └───╚═╝ Give a CFG with ≦ 8 rules to describe the above language. Problem 2 (10 pts) Consider the following language, i j k {a b c │i = j or i = k, i ≧ 0, j ≧ 0, k ≧ 0} Give a CFG with ≦ 10 rules for this language. Problem 3 (15 pts) Consider the following CFG, SS1S2 S1 → 0 S1 1│ε S2 → 1 S2 0│ε Convert the CFG to CNF by following the procedure in the textbook. Your number of rules should be ≦ 13 . ( Hint : you can remove redundant rules after the procudure. ) Problem 4 (20 pts) Consider the following state diagram of a PDA. ╔═╗─┐ 0,ε → 0 start ─→║q1║←┘ ╚═╝ │ │1,0 → ε │ ↓ ╔═╗─┐ 1,0 → ε ║q2║←┘ ╚═╝ AssumeΣ = {0, 1} (a) What is the corresponding language ? Give the formal definition of this PDA including a table for the δ function. (b) Give a CFG with ≦ 3 rules for this language. (c) We would like to have a DPDA for the same language. Give the formal definition including a table for the δ function. Problem 5 (30 pts) Use the language and diagram in Problem 4. (a) Modify the DFA to satisfy: 1. Each link is either push or pop; 2. Single accept state; 3. Stack is empty before accepting a string. Your diagram should have ≦ 4 states. ( Hint : you may introduce extra symbols in the stack. ) (b) Use (a) and the procedure in Lemma 2.27 to generate a CFG for the language. (c) Is it possible to simplify results in (b) to those in Problem 4 (b) ? (d) Give two strings s1 and s2 with │s1│=│s2│= 3, s1, s2 ∈ {0,1}*, and s1 is accepted while s2 is rejected. Use the PDA obtained in (a) to simulate the two strings. Note that you must draw trees like what we did in the lecture (it is similar to how we simulate NFA). Problem 6 (20 pts) Consider the language 2^n {0 │ n ≧ 0} We would like to a 2-tape TM to recognize the language by following procedure: Repeat 1. Copy half of tape 1 to tape 2 and make tape 1 empty; 2. Copy tape 2 back to tape 1; until tape 1 is empty. (a) Please give a state diagram for this TM. The number of states should be ≦6 (including q_a and q_r). (b) Simulate the strings "ε" (i.e., empty string), "0000", and "000000" Please note that the movement of the head can be L, R, and S. --



※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 111.250.116.228
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/NTU-Exam/M.1421572861.A.F33.html ※ 编辑: irritum (111.250.116.228), 01/18/2015 17:23:44
1F:→ rod24574575 : 已收资讯系! 01/18 18:16



※ 发信站: 批踢踢实业坊(ptt.cc)
※ 转录者: w4a2y4 (140.112.25.121), 11/30/2017 17:07:26







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:e-shopping站内搜寻

TOP