代写comp2022、代做c/c++,Python程序设计
comp2022 Assignment 3 (70 marks) s2 2024
This assignment is due in Week 10 and should be submitted to Gradescope.
All work must be done individually without consulting anyone else’s solutions in accordance
with the University’s “Academic Dishonesty and Plagiarism” policies.
Go to the last page of this document and read the Submission Instructions. For clariffcations
and updates, monitor “Assignment FAQ”.
Problem 1. (10 marks) Consider the following deterministic Turing Machine M
over input alphabet Σ = {a, b}:
0 _ _ L 1
0 * * R 0
1 b _ L 2
2 a _ L 3
1 _ _ * halt_accept
3 _ _ R 0
3 * * L 3
1. (5 marks) State ffve strings that are in L(M), and ffve that are not. The
strings should be over Σ.
2. (5 marks) Provide a low level description in Morphett notation of a (1-tape
deterministic) Turing Machine for the language that has time complexity at
most 5n + 5.
Problem 2. (10 marks) Consider the following nondeterministic Turing Machine
N over input alphabet Σ = {a, b}:
0 _ _ * halt-reject
0 a a r 0
0 b b r 0
0 b x l 1
1 x x l 1
1 a x r 2
1 b x r 2
1 _ _ r 4
1comp2022 Assignment 3 (70 marks) s2 2024
2 x x r 2
2 a x r 3
2 b x r 3
2 _ _ * halt-reject
3 x x r 3
3 a x l 1
3 b x l 1
3 _ _ * halt-reject
4 x x r 4
4 a a * halt-reject
4 b b * halt-reject
4 _ _ * halt-accept
1. (5 marks) State ffve strings that are in L(N), and ffve that are not. The
strings should be over Σ.
2. (5 marks) Provide a low level description in Morphett notation of a (1-tape
deterministic) Turing Machine for the language.
Note: Morphett’s simulator of nondeterministic TMs uses randomness to resolve
nondeterminism. This is not the semantics of NTMs.
Problem 3. (30 marks) For each of the following languages over the input alphabet
Σ = {a, b, c}, provide a low level description in Morphett notation of a
(1-tape deterministic) TM for the language.
1. The language of non-empty strings where the ffnal character appears at
most 3 times in the string (including the ffnal character).
E.g., abccaba is in the language, while abcbcbab is not.
2. The language of strings of the form a
E.g., aabbccaa is in the language, while abc is not.
3. The language of strings that can be turned into a palindrome by replacing
at most two characters by other characters.
E.g., aba is in the language because it is a palindrome, abb is in the language
because we can change one character to get a palindrome (e.g., aba),
and aabc is in the language because we can change two characters to get a
palindrome (e.g., aaaa); however aabbccc is not in the language.
4. The language of strings for which the longest substring that matches a

is
longer than the longest substring that matches b

.
E.g., caaaccbbaabaaac, baaacbbcaaabb and aaaa are in the language, while
aabbbcacacacaca is not.
2comp2022 Assignment 3 (70 marks) s2 2024
5. The language of strings of the form uvcvu where u, v ∈ {a, b}

.
E.g., aabbacbaaab is in the language (take u = aab, v = ba), while aabbcabab
is not.
6. The language of strings of the form uvw where v is a non-empty string with
the same number of as, bs, and cs. E.g., bbaabbbccaccbc is in the language,
while bbaabbbcc is not.
Problem 4. (5 marks + 5 bonus marks)
Your robot buddy GNPT-4 has come up with a revolutionary new strategy to
prove that it is in fact equal in computational power to its more well-known
cousin. It has a simple yet brilliant proof strategy: it will start by proving that
P in fact equals the set of Turing-decidable languages, by showing that every
decider runs in polynomial time. Once it has done this, it will obtain as a corollary
that NP is also equal to this set, and the result will follow. GNPT-4 would
like you to check its generated proof, and has generously offered you half of the
million dollar bounty for doing so.
Unfortunately, you’re starting to have some concerns about the claim that every
decider runs in polynomial time. GNPT-4’s proof of this claim is 2123 pages
long, so you don’t really feel like checking it in detail for a ffaw. Instead, you
have a much better idea: you’ll provide an explicit counterexample of a machine
that does not run in polynomial time.
1. (5 marks) Provide a low level description in Morphett notation of a (1-tape
deterministic) TM over input alphabet Σ = {a} that accepts every string, has
at most 20 states, and has time complexity f(n) such that 2
n ≤ f(n) ≤ 2
2n+1
for all n.
2. (5 bonus marks) Provide a low level description in Morphett notation of a
(1-tape deterministic) TM over input alphabet Σ = {a} that accepts every
string, has at most 40 states, and has time complexity exactly 2
n
.
Problem 5. (15 marks)
You’re a budding cartoonist, trying to create the next great TV animation. You’ve
come up with the perfect idea, but now you need to pitch it to the executives.
You know from your experience in the industry how the process works: you
make a proposal with a string over Σ = {a, b} and the network runs a Turing
machine Q on it. If Q accepts, your show will be ready for broadcast, but if
it doesn’t, you will be shown the door, fflled with eternal regret at what could
have been. Of course, as Q is a Turing machine, there is also the possibility that
Q will diverge. (For example, this is what happened after season 7 of Futurama.)
One of your shady contacts (apparently they’re a secret agent who uses ffnite automata,
or something?) has managed to obtain a copy of the network’s machine
Q for you. You now want to analyse Q to ffgure out how to pitch your show
3comp2022 Assignment 3 (70 marks) s2 2024
so it will be accepted. Furthermore, you’ve heard that it’s considered especially
fortuitous if Q runs in a number of steps that is a multiple of 77, and such shows
will be given air during the network’s prime timeslots. So you’d like a machine
that will analyse Q and your proposal to see if that will be the case.
1. (5 marks) Prove that the language {M, x: M halts on x in exactly 77n steps
for some integer n > 0} is undecidable.
Okay, so that was a bust. You’ve set your sights lower: at this point you just want
any description that will be accepted, and you’re willing to retool your proposal
to make it work. Rather than focusing on your speciffc string, you’d like a
machine that will analyse just Q, and ffnd some string, any string, that it will
accept. There is, however, the possibility that Q doesn’t accept any string. (That
would explain why there are no decent new shows these days.) In this event,
your endeavour is doomed and you don’t care about the output, but you’d like
the analysing machine to at least halt, so you’re not stuck waiting forever.
2. (10 marks) Consider the following speciffcation. The inputs are Turing machines
over input alphabet Σ = {a, b}.
(a) If the input is a Turing machine M that accepts some input, the output
should be any string x that M accepts.
(b) If the input is a Turing machine M that does not accept any input, the
output should be any string x. (There still must be an output, ie. the
machine satisfying this speciffcation must halt.)
Prove or disprove whether there exists a Turing Machine that halts on every
input and satisffes this speciffcation.
4comp2022 Assignment 3 (70 marks) s2 2024
Submission Instructions
You will submit answers to all the problems on Gradescope.
Problems 1, 2, 3 and 4 are autograded.
It is essential that you ensure that your submission is formatted so that the autograder can
understand it. Upon submitting your responses, you should wait for the autograder to provide
feedback on whether your submission format was correct. An incorrectly formatted submission
for a question will receive zero marks for that question. A scaffold will be provided on Ed
with the ffle names the autograder expects.
Problem 1.1, 2.1 format:
The ffrst line of each answer should contain a comma separated sequence of ffve strings that are
in the language, and the second line should contain a comma separated sequence of ffve strings
that are not in the language. For example, if the language consists of all strings that only contain
b’s, an example of a correct text ffle would be:
epsilon, b, bb, bbb, bbbb
a, aa, aaa, aaaa, aaaaa
Problem 1.2, 2.2, 3, 4 format (TMs):
All TMs that you are required to provide in this assignment are deterministic and have a single
tape, and that tape is doubly-inffnite. When asked to give a low-level description use Morphett’s
format. The initial state must be 0
Note that your machine should use an explicit transition to halt-reject when rejecting a string. If
the machine has no transition on a (state, input) pair, this will be treated as an error, and will not
be treated as rejecting the string. You may wish to include the following line in your machines,
to treat all undeffned transitions as rejects: * * * * halt-reject
Problem 5 format:
Problem 5 is handgraded. You will submit a single typed pdf (no pdf containing text as images,
no handwriting). Start by typing your student ID at the top of the ffrst page of each pdf. Do not
type your name. Do not include a cover page. Submit only your answers to the questions. Do
not copy the questions. Your pdf must be readable by Turnitin.
5

热门主题

课程名

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
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图