Analysis and formal reasoning about complex concepts

Assignment Help Theory of Computation
Reference no: EM132127225

Models of Computation Assignment -

Purpose - To improve and consolidate your understanding of regular and context-free languages, finite-state and pushdown automata. To develop skills in analysis and formal reasoning about complex concepts, and to practise writing down formal arguments.

Challenge 1 - This challenge is to design eight finite relations and submit them via Grok. Let D = {1, 2, 3}. We can think of a binary relation on D as a subset of D × D. For example, the identity relation is {(1, 1),(2, 2),(3, 3)}. There are 9 elements in D×D, so there are 29 = 512 different binary relations on D.

Construct eight of these, r0, . . . , r7, satisfying the criteria given in the table below. Each relation should be presented as a Haskell list of pairs, that is, an expression of type [(Int, Int)]. For full marks, each relation has to be as small as it can be.

 

Reflexive

Symmetric

Transitive

r0

no

no

no

r1

no

no

yes

r2

no

yes

no

r3

no

yes

Yes

r4

yes

no

no

r5

yes

no

Yes

r6

yes

yes

no

r7

yes

yes

Yes

Challenge 2 - This challenge is to design three DFAs and a regular expression and submit them via Grok. An expression such as (01 ∪ 1)* ∩ (0*11)* is not a regular expression, since ∩ is not a regular operation. Nevertheless, the expression denotes a regular language.

a. Give a 3-state DFA Da for (01 ∪ 1)*.

b. Give a 4-state DFA Db for (0∗11)*.

c. In tute exercise 61 we constructed "product" automata for the intersection of languages. Now find a minimal DFA Dc for (01 ∪ 1)* ∩ (0∗11)*. You can build the DFA that is the "product" of Da and Db, but be aware that the result may not be minimal, so you may have to apply minimisation.

d. Use the NFA-to-regular-expression translation shown in Lecture 12, to turn Dc into a regular expression r for (01 ∪ 1)* ∩ (0*11)*.

Challenge 3 - This challenge is to complete, on Grok, some Haskell functions that will allow us to test for membership of languages given as regular expressions. You have probably used regular expression features in your favourite programming language, and this challenge will help you understand how such features are implemented.

Let us call a language A volatile iff ε ∈ A. For example, L(10 ∪ (11)*) is volatile, but L((0 ∪ 1)(11)*) is not. Another useful concept is that of a derivative of a language with respect to a (finite) string. The derivative of A with respect to s,

d(A, s) = {w | sw ∈ A}

For example, if A = {0, 02, 102, 111, 1102} then d(A, 11) = {1, 02}. For another example, if B is the language given by the regular expression (00)* then d(B, 0) = L((00)*0) = L(0(00)*).

We can extend the definition of "volatile" to regular expressions r: We say that r is volatile iff ε ∈ L(r). Similarly we extend d so that the function takes, and produces, regular expressions. Let us first handle the case where the string s is of length 1, that is, s is a single symbol x. We define

d1(∈, x) = ∅

d1(∅, x) = ∅

d1(y, x) = ∅ if y is a symbol and y ≠ x

d1(x, x) = ∈

d1(r1 ∪ r2, x) = d1(r1, x) ∪ d1(r2, x)

d1(r1 r2, x) = d1(r1, x) r2 ∪ d1(r2, x) if r1 is volatile

d1(r1 r2, x) = d1(r1, x) r2 if r1 is not volatile

d1(r*, x) = d1(r, x) r*

Now we can define the general case, that is, the derivative of r with respect to an arbitrary string s. We define d(r, ∈) = r and, for k ≥ 1: d(r, x1x2 · · · xk) = d1((. . . d1(d1(r, x1), x2), . . .), xk)

You should think about why the above recursive definitions are correct, before you complete their Haskell implementations on Grok. On Grok you will find a Haskell type RegExp for regular expressions.

a. Write a Haskell function volatile :: RegExp -> Bool that determines whether a regular expression is volatile.

b. Complete a Haskell function derivative :: RegExp -> String -> RegExp so that you can use Haskell to calculate derivatives of regular expressions.

c. Write a function contains :: RegExp -> String -> Bool which takes a regular expression r and a string w and decides whether w ∈ L(r). This function must use the functions volatile and derivative.

Challenge 4 - Let Σ be a finite non-empty alphabet and let x ∈ Σ be a symbol. For every w ∈ Σ* and x ∈ Σ, let omit(x, w) be the string w with all occurrences of x removed. For example, if Σ = {a, b, c} and w = baabca then omit(a, w) = bbc. Similarly, omit(b, bb) = ∈.

We now "lift" this function to languages: To "drop" a symbol from a language L will mean to "omit" it from every string in L. That is, for L ⊆ Σ*, define

drop(x, L) = {omit(x, w) | w ∈ L}.

For example, if L = {aa, baabca, bbaac, bbc} then drop(a, L) = {∈, bbc} and drop(b, L) = {aa, aac, aaca, c}.

a. Show that if R is a regular language then drop(a, R) is a regular language.

b. Assuming {a, b} ⊆ Σ, provide a language L such that drop(a, L) is context-free and non-regular, while drop(b, L) is regular.

Challenge 5 - Every regular language can be recognised by a push-down automaton which has only three states, qI , qR, and qA. Show in detail how to systematically translate an arbitrary DFA to a PDA with only three states. Try to answer this question precisely, that is, make use of the formal definitions of DFAs and PDAs. So, given an arbitrary DFA (Q, Σ, δ, q0, F), define precisely each component of the corresponding PDA (Q′, Σ′, Γ, δ′, q′0, F′).

Hints: (a) A PDA does not have to have an empty stack in order to accept a string; (b) its stack alphabet Γ can be whatever (finite) set of symbols you choose; and (c) we named the states qI, qR, and qA for a reason.

Challenge 6 - Let us fix the alphabet Σ = {0, 1}. Define a substring of w ∈ Σ* to be any string x ∈ Σ* such that w = uxv for some u, v ∈ Σ*. Now consider the language

A = {w ∈ Σ*| 001 is not a substring of w}

For example, ∈, 01, 1111, 10101, and 0111010101 are in A, but 10001 and 11001011 are not.

Consider the context-free grammar G = ({S}, Σ, R, S), where the rules R are: S → ∈

| S 0

| 1 S

| 0 1 S

Show that L(G) = A.

Hint: Show L(G) ⊆ A using structural induction and show A ⊆ L(G) by induction on the length of strings in A.

Attachment:- Assignment File.rar

Reference no: EM132127225

Questions Cloud

Example of a psychic prison : Describe an example of a "psychic prison" experienced in an organization
Nashville has decided to build botanical garden : The City Commission of Nashville has decided to build a botanical garden and picnic area in the heart of the city for the recreation of its citizens.
If you were assembling a change team : If you were assembling a change team, what would be your key considerations when selecting your team? Why?
How marketers attempt to sell children specific products : What are the ethical implications of target marketing in terms of reaching specific groups of consumers? describe how marketers attempt to sell children.
Analysis and formal reasoning about complex concepts : COMP30026 Models of Computation Assignment, The University of Melbourne, Australia. To develop skills in analysis and formal reasoning about complex concepts
Discuss the law requirements : Imagine that you are a HR manager within that organization. You have been tasked with developing a training to help prevent future violations of the HR law.
Reflect on what you have learned about deontological : A textile manufacturer is closing its North Carolina plant and moving the production of its products to a developing nation in Southeast Asia.
What is sustainability : What is 'sustainability'? Is there a relationship or link to stakeholder theory and social responsibility?
Compute the takt time for a system : Compute the takt time (minutes per unit) for a system given the following data: There is a single worker per shift with a total time per shift of 460 minutes.

Reviews

len2127225

9/30/2018 10:41:46 PM

Submission and assessment - Some of the problems are harder than others. All should be solved and submitted by students individually. Your solution will count for 12 marks out of 100 for the subject. Each question is worth 2 marks. Marks are primarily allocated for correctness, but elegance and how clearly you communicate your thinking will also be taken into account. The deadline is Late submission will be possible, but a late submission penalty will apply: a flagfall of 1 mark, and then 1 mark per 12 hours late.

len2127225

9/30/2018 10:41:39 PM

For challenges 1–3, submit files on Grok. The required format for submitted solutions will be clear when you open the Grok modules, but briefly, for Challenge 1 we want Haskell expressions of type [(Int,Int)], for Challenge 2, we use the Haskell representations for DFAs and regular expressions used in Worksheets 3 and 4, and for Challenge 3, you will need to write some Haskell code. To submit, you need to click “mark”. The feedback you will receive at submission time is limited to well-formedness checking; the correctness of your solutions is something you will need to test and be confident about. You can submit as many times as you like. What gets marked is the last submission you have made before the deadline.

len2127225

9/30/2018 10:41:32 PM

For challenges 4, 5, and 6, submit a PDF document via the LMS. This document should be no more than 1 MB in size. If you produce an MS Word document, it must be exported and submitted as PDF, and satisfy the space limit of 1 MB. We also accept neat handwritten submissions, but these must be scanned and provided as PDF, and again, they must respect the size limit. If you scan your document, make sure you set the resolution so that the generated document is no more than 1 MB. The assignment submission site on the LMS explains what you can do if you find it hard to satisfy this space requirement. You can submit as many times as you like, unless the deadline has arrived.

len2127225

9/30/2018 10:41:25 PM

Once again, for those who want to use the assignment to get some LATEX practice, the source of this document will be available in the LMS, in the content area where you find the PDF version. Make sure that you have enough time towards the end of the assignment to present your solutions carefully. A nice presentation is sometimes more time consuming than solving the problems. Start early; note that time you put in early usually turns out more productive than a last-minute effort. Individual work is expected, but if you get stuck, email Matt or Harald a precise description of the problem, bring up the problem at the lecture, or (our preferred option) use the LMS discussion board. The discussion forum is both useful and appropriate for this; soliciting help from sources other than the above will be considered cheating and will lead to disciplinary action.

Write a Review

Theory of Computation Questions & Answers

  Construct a table for this weighted code

It is possible to have negative weights in a weighted code for the decimal digits, e.g.,8,4, -2, and -1 can be used. Construct a table for this weighted code. Ifd is a decimal digit in this code, how can the code for 9 -d be obtained?

  Show that all binary strings generated

Show that all binary strings generated by the following grammar have values divisible by 3.- Does the grammar generate all binary strings with values divisible by 3?

  All binary strings with at least

Give and FA for each of the languages all binary strings with at least three 1''s and all binary strings with at an odd number of 1''s

  Show that there is no language s

Show that there is no language S such that S* is the language of all strings of a's and b's that do not contain the substring bb.

  A coinductive calculus of binary trees

The assignment consists of writing an extended abstract of the article  - A coinductive calculus of binary trees

  Translate the following argument using truth tables

Translate the following argument and use truth tables to test for validity.

  Considering a single programmed operating system

Considering a single programmed operating system, what is the minimal total time required to complete executions of the two processes? You should explain your answer with a diagram.

  Productions of nonterminals as right regular grammars

Rewrite the productions for each of the following nonterminals as right regular grammars: Identifier, Float. Show the moves made using the DFSA for identifiers in accepting.

  What is the equilibrium of the game

Consider the nonatomic routing game shown in the left figure (i). What is the "equilibrium" of the game in (i) and the corresponding travel time of all traffic?

  How to search for that data and has the ability to read

How to search for that data and has the ability to read, understand, and interpret it - how the proper and relevant information can be found.

  Prove the problem by contradiction

Let n > 1 be an integer. Prove by contradiction that if n is a perfect square, and then n + 3 cannot be a perfect square.

  How the growth of certain types of plants can be modeled

Describe how the growth of certain types of plants can be modeled using a Lidenmeyer system. Such a system uses a grammar with productions.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd