首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
讲解CS 310编程、Java,Python程序设计辅导 解析Java程序|讲解SPSS
项目预算:
开发周期:
发布时间:
要求地区:
MID-TERM EXAMINATION
16 March 2021
Instructions
• You have 24 hours to turn in your solution which is hereby due on 17 March at 9 am. There are several
ways to provide your answers: Fill in the exam PDF and send it back, print the exam paper, fill it in
by hand, and then scan the result back to PDF, or provide your answers in a standalone document
typeset to PDF. If you choose the latter option then please provide your answers in the same order as
the questions in the exam paper.
• PDF is the only acceptable format for submitting your answers.
• The number of marks awarded for each question appear in square brackets right after the question
number. If this were a regular exam then it would have been 90 minutes in length and the number of
marks for each question would have given you an estimate on how much time you are supposed to
spend on the respective question. However, this estimate is not terribly useful in the current format.
• To obtain full marks provide all the pertinent details.
• You are not supposed to communicate with anybody about the exam questions. Identical answers to
any question found on two or more papers will result in the complete forfeiture of the examination for all the
students involved.
• Make sure that your name and student number appear at the top of the first page of each document
that you are sending.
1 15 / 15
2 5 / 5
3 5 / 5
4 10 / 10
5 (a,b) 15 / 15
6 10 / 10
7 (a,b,c,d) 20 / 20
8 10 / 10
Total: 90 / 90 = 30 / 30
1. [15] For each question below check one answer. Your response is a priori incorrect if more
than one answer is checked.
• Which of the following statements is true:
Some deterministic finite automata do not have equivalent regular expressions.
Some nondeterministic finite automata do not have equivalent regular expressions.
Some regular expressions do not have equivalent nondeterministic finite automata.
X The above three statements are all false.
• Which of the following statements is true:
Some finite languages are not regular.
X Some context-free languages are not regular.
Some regular languages are not context-free.
The above three statements are all false.
• Let L = (a + aba + abba)
∗
(bb + bbb). Which of the following strings is in L:
X aaabaabb
aaaabaab
abaabbbb
None of the above strings is in L.
• The language {0
k1
2n0
3k
: k, n ≥ 1}:
is both regular and context-free
X is context-free but is not regular
is regular but is not context-free
is neither regular nor context-free
• The language {0
2k1
n
: 0 ≤ k ≤ n} is denoted by the regular expression:
(00)∗1
∗
0
∗
(00)∗1
∗
0
∗
(001 + 000011 + 000000111)∗
X None of the above.
2. [5] Give a regular expression over Σ = {0, 1} that defines exactly all the well formed binary
numbers that are divisible by 4. A well formed binary number has no leading zeroes (except
for the number 0 itself).
ANSWER:
The number 0 is a special case, else everything must start with one and end with a double
zero. The regular expression is thus 0 + 1(1 + 0)∗00.
Page 1 of 6
3. [5] The definition of regular languages in the textbook is:
A regular language is a formal language definable using only union, concatenation,
and closure from alphabet elements, ε, and ∅.
Even if we eliminate ε from the definition we still define regular languages. Explain why.
ANSWER:
ε can be produced using ∅ and closure as follows: ∅
∗ = ε. So any occurrence of ε can be
replaced in any regular expression by ∅
∗ without changing the language being generated.
4. [10] Using the systematic method described in the course convert the nondeterministic state
transition diagram below into a deterministic state transition diagram. Label the states of
the deterministic diagram with sets of states of the nondeterministic diagram.
5. [15] Let L be the language of exactly all the strings over Σ = {0, 1} of even length that end
with the symbol 0.
(a) [10] Draw the deterministic state transition diagram that recognizes L.
(b) [5] Give a grammar that generates the language L.
ANSWER:
We follow the conversion from finite automaton: G = ({A, B, C}, {0, 1}, R, A), where
R = { A → 0B,
A → 1B,
B → 1A,
B → 0C,
C → 0B,
C → 1B,
C → ε }
Page 3 of 6
6. [10] Draw a state transition diagram that recognizes the language (1 + 01∗0)∗
. Justify your
answer.
ANSWER:
(a) Automata for 0 and 1:
0 1
(b) Automaton for 1
∗
(from 6a):
1
ε
ε
(c) Automaton for 01∗
(from 6a and 6b):
(d) Automaton for 01∗0 (from 6a and 6c):
(e) Automaton for 0 + 01∗0 (from 6a and 6d):
(f) Automaton for (0 + 01∗0)∗
(from 6e) = the answer to the question:
7. [20] Consider the language L = {wcwR : w ∈ {d, e}
∗}, where w
R denotes the reversal of the
string w (such that for example (abc)
R = cba).
(a) [5] Give a context-free grammar that generates L.
ANSWER:
S → dSd S → eSe S → c
(b) [5] Draw a deterministic push-down automaton that recognizes the language L.
ANSWER:
A C
d, ε 7→ d
e, ε 7→ e
c, ε 7→ ε
d, d 7→ ε
e, e 7→ ε
(c) [5] Give a derivation for the string deeceed using your grammar from Question 7a.
ANSWER:
S ⇒ dSd ⇒ deSed ⇒ deeSeed ⇒ deeceed
(d) [5] Draw a table that traces the computation of your push-down automaton from Question
7b on input dece. The table should list the current state, currently remaining input,
and current stack contents at each step of the computation. Is this string accepted by
the automaton?
ANSWER:
State Input Stack
At the end we are in a final state but the stack is not empty, so the input is rejected.
Page 5 of 6
8. [10] Let L be the language of strings over {0, 1} in which both the number of 1’s and 0’s are
multiples of 3. Is L regular? Justify your answer.
ANSWER:
Let L1 = (1 + 01∗01∗0)∗
(all strings with 3n 0’s) and L2 = (0∗ + 10∗10∗1)∗
(all strings with 3n
1’s). Both these languages are regular (being defined by regular expressions), so L1 ∩ L2 is
regular (since regular languages are closed under intersection). However, L1 ∩ L2 = L, and
therefore L is regular.
Page 6 of 6
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代写dts207tc、sql编程语言代做
2024-12-25
cs209a代做、java程序设计代写
2024-12-25
cs305程序代做、代写python程序...
2024-12-25
代写csc1001、代做python设计程...
2024-12-24
代写practice test preparatio...
2024-12-24
代写bre2031 – environmental...
2024-12-24
代写ece5550: applied kalman ...
2024-12-24
代做conmgnt 7049 – measurem...
2024-12-24
代写ece3700j introduction to...
2024-12-24
代做adad9311 designing the e...
2024-12-24
代做comp5618 - applied cyber...
2024-12-24
代做ece5550: applied kalman ...
2024-12-24
代做cp1402 assignment - netw...
2024-12-24
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!