past_exam_03-solutions only

.pdf

School

Royal Melbourne Institute of Technology *

*We aren’t endorsed by this school

Course

1107

Subject

Computer Science

Date

Oct 30, 2023

Type

pdf

Pages

6

Uploaded by ChefLionPerson918

Report
RMIT School of Computer Science and Information Technology 2006 COSC1105/1107 COMPUTING THEORY EXAM DATE: 13th June TIME ALLOWED: 2 hours TIME: 2.00pm - 4.00pm NUMBER OF PAGES: X TOTAL NUMBER OF MARKS: 100 Questions may be answered in any order; hence you should start with the questions you consider easiest, and end with the ones you consider hardest. If you do not understand what is required to answer a particular question, ask for clarification during the reading time. When asked to “briefly explain” something, or to describe something “informally”, an answer of one or two English sentences is expected. When asked to “explain” or “justify” something, an answer of one or two English paragraphs is expected. The following may be of use to you. Pumping Lemma Let L be a regular language. The pumping lemma asserts that there is a p such that for all w L with | w |≥ p then w = xyz , | xy |≤ p , | y | > 0 and xy i z L for all i 0.
1. Complexity and Cryptography (3+4 = 8 marks) (a) Explain the complexity classes P , NP and NP complete . Answer: P is the class of all problems that can be solved within polynomial time. NP is the class of all problems which can be solved in non-deterministic polynomial time. NP complete problems are NP prob- lems that can be reduced to any other NP problem within polynomial time. (b) Briefly describe the impact developments in quantum computing could have on the tractablity of NP class problems. Answer: A quantum computer with enough qubits could solve an NP problem in polynomial time. 2. Chomsky Hierarchy (6+3+8 = 17 marks) (a) Classify the languages below as either regular context-free but not regular recursively enumerable but not context-free i. { a i b i + j c j | i j } Answer: recursively enumerable but not context free ii. { a i b i + j c j + k | i, j, k 0 } Answer: context-free but not regular iii. { w ∈ { a, b } | w contains an even number of a ’s } Answer: regular iv. { a i b j | i negationslash = j } Answer: context-free but not regular (b) Which of the following statements are true? Briefly explain your answer. i. DFA’s are less powerful than NFA’s. Answer: false, they have equal power ii. Unrestricted gammars are more powerful than non-deterministic PDA’s. Answer: true, unrestricted grammars are as powerful as Turing machines, and so more powerful than any type of PDA iii. Context-sensitive grammars are less powerful than Turing machines. Answer: true, context sensitive grammars are equivalent to PDA’s, which are less powerful than Turing machines. (c) Prove there is no FSA for { a i b j c j | i > j } Answer: let s = xyz = a p +1 b p c p . For | y | > 0 and | xy | < = p to be true, y must consist only of a ’s and z must consist of ab p c p . x may or may not be null. So y = a q , x = a p q where 1 < = q < = p . The pumping lemma says we can have xy k z for k > = 0 e.g. k = 2 gives xyyz = a p q a q a q ab p c p = a p + q +1 b p c p which is in L . However k = 0 should also be legal: xz = a p q ab p c p = a p +1 q b p c p . Since 1 < = q < = p , we don’t have i > j - so xz is not in L . Since we have failed a condition of the pumping lemma, s is not regular and so there is no FSA. 3. Grammars (3+3+3+9+5 = 23 marks) Consider the grammar G below: S bSb | aX X aX | Y Y Y Z | Z Z bZc | cZb | a 1
(a) Give a derivation of baaacbbaccbb from G . Answer: S bSb baXb baaXb baaaXb baaaY b baaaZb baaacZbb baaacbZcbb baaacbbZccbb baaacbbaccbb (b) Is aabcabccab derivable from G ? If yes, give a derivation, if not explain why. Answer: Yes. S aX aaX aaY aaY Z aaZZ aabZcZ aabcZbcZ aabcabcZ aabcabccZb aabcabccab (c) Is bacbab derivable from G ? If yes, give a derivation, if not explain why. Answer: No. We can get to: S bSb baXb baY b baY Zb baZZb bacZbZb but can’t turn cZb into cb . (d) Draw a machine (FSA, PDA, or Turing) to accept G . (e) Consider the grammar H below: S SaS | SbS | cSa | c Is grammar H ambiguous? Explain why. Answer: Yes it is ambiguous. For example, consider the legal string cacbc , there are two parse trees for this string: S a S S S S c c c b S S S S c c a b S c 2
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help

Browse Popular Homework Q&A

Q: Given C= 122", a= 25, and c = 18, use the Law of Sines to solve the triangle (if possible) for the…
Q: A cannonball is fired from a gun and lands 560 meters away at a time 20 seconds. What is the…
Q: Find the arc length parameter along the curve from the point where t=0 by evaluating the integral s=…
Q: Rosewood Company made a loan of $9,000 to one of the company's employees on April 1, Year 1. The…
Q: On the graph that follows, shift one of the curves to illustrate the impact of the increase in…
Q: Liquid n-Hexane + oxygen react to to form carbon dioxide + water vapor.  delta Hr= __? Kj Liquid…
Q: One might argue that mediated communication works just as effectively without nonverbal cues as…
Q: a current of 3.25A is passed through a Ni(NO3)2 solution how long in hours would this current have…
Q: For the following expression, find the correct partial fraction decomposition. -3x² 10x 38 (3x − 1)…
Q: Use the binomial square pattern to multiply (m^3-n)^2
Q: Solve for if-14 sin 0+ 24 = 38 and 0 ≤ 0 < 2TT. Provide your answer below: 0 =
Q: The physician orders Tetracycline 0.25g twice daily for acne.  On hand are 250mg capsules.  How many…
Q: Initially contains Air: P1 = 30 lbf/in^2 T1 = 540 °F V1 = 4 ft^3 Second phase of process involving…
Q: Procedures and Problem Solving Solving a Right Triangle In Exercises 5-14, solve the right triangle…
Q: An array with more than one index is called a/an: O partially filled array. multidimensional array.…
Q: Find the support reactions for the simple beam below у X 750 lbs. A 4 ft. 750 lbs. 6 ft. B
Q: namespace CS3358_FA2022_A04_sequenceOfChar { template class sequence { public: // TYPEDEFS and…
Q: Determine the discriminant of each quadratic equation. Use the value of the discriminant to…
Q: Block 1 (7 kg) is setting on the floor of an elevator. A hand pushes vertically down on block 1 with…
Q: Required information Skip to question   [The following information applies to the questions…
Q: Describe the factors that can cause an application developer to pick UDP over TCP while running…
Q: 4. The public debt - Ownership The following table contains approximate figures for gross domestic…