Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Automata & Computation Expert

EXERCISE 1: REGULAR EXPRESSIONS

Question 1. Let R1 = a((b*c*) + a)b and R2 = a* ((bc) + a*)b* be two regular expressions.

(a) Give two words ω1 and ω2 such that {ω1 ω2} ⊆ L(R1) ∩ L(R2). Please type each word on a new line.

(b) Give two words ω3 and ω4 such that (ω3, ω4) ⊆ L(R1) \ L(R2). Please type each word on a new line.

(c) Give two words ω5 and ω6 such that {ω5, ω6} ⊆ L(R2) \ L(R1). Please type each word on a new line.

(d) Give a regular expression R3 such that L(R3) = L(R1) U L(R2).

(e) Give a regular expression R4 such that L(R4) = L(R1) ∩ L(R2).

Question 2. Give regular expressions for the following languages.

(a) L1 = {anbm | n ≥ 3, m is even}.

(b) L2 = L1' (where L' stands for the complement of L).

(c) L3 = {abnω | n > 3, ω  ∈ {a, b}*}.

(d) L4 = {ωanω | n > 0, ω ∈ {a, b}*} ∩ {bωb | ∈ {a, c}*}.

Question 3. Let R1 and R2 be regular expressions over a non-empty alphabet E.

(a) Determine, formally, whether L(R1(R1 + R2)*) = L((R1 + R2)*). That is, if it is true, provide a proof; otherwise provide a counter example.

(b) Prove that L(R1R2)Τ = L(RΤ2, R2)*) where if represents the reverse of regular expression R. For example, if abb ∈ L(R), then bba L(R'). Similarly, if X is a set of words, then XΤ = {ω|ωr ∈ X}.

EXERCISE 2: GRAMMARS

Question 4. In this exercise, we use operator R# to denote one or more repetitions of R, that is, R# is a compact way of writing RR' (remember we used + for alternation). Let L1 and L2 be the following two languages over alphabet {a, b, c}:

L1 = {anb2cm a2+n+m | n,m ≥ 1};

L2 = L(((a + b)*b(b + (c + a) (b + a)* )#.

(a) Give a grammar G1 such that L(G1) = L1.

(b) Give a grammar G2 such that L(G2) = L2.

(c) Provide a grammar G3 such that L(G3) = L1 U L2.

(d) Prove formally that L1 ∩ L2 = L1

Question 5. Let G = ({S, A}, {a, b}, Γ, S) be a grammar, where the set of rules r is defined as follows:

S -> aSbS
S -> bSaS

S -> ∈

(a) Is G an ambiguous grammar? Explain your answer.

(b) Is there a relationship between the number of a's and b's in L(G)?

(c) Does there exist a regular expression R such that L(R) = L(G)? If it exists, provide such R; otherwise, briefly explain the reason for its nonexistence.

(d) Does there exist a regular expression, DFA, or PDA over the alphabet Σ = {a, b} which is equivalent to the language L1 = L(G) ∩ L(a*b*)? For each, briefly explain why not or provide the expression/automaton.

EXERCISE 3: AUTOMATA
Question 6. Answer the following questions based on the finite state automaton M1 present in the JFLAP file DFA-3.6.jff available in Course Material section of the course website.
 
(a) Give four strings of length 3 accepted by M1. Please type each string on a new line.
(b) Give four strings of length 3 rejected by M1. Please type each string on a new line.
(c) Do you think M1 has more states than required to express its language? Explain briefly.
(d) Give the language of this machine M1 as a regular expression.
(e) Create an automaton M2 such that it accepts the language L2 where L2 = L(M1) ∩ L(a*c*(c+ b)*). Your machine should not accept words not in this language.
 
Question 7. Let M3 = ({q0, q1, q2, q3}, {a, b} , δ, q0, {q3}) be a deterministic finite state machine as shown below. Prove that if w is a string in L(M3), then the number of a's in ω is na,(ω) mod 3 = O.

1919_AUTOMATA.png

Question 8. Consider the pushdown automaton M4 over the alphabet Σ = {a, b, c} as shown below.

2105_AUTOMATA1.png

Notation x, A/X means a transition where X is the input symbol being read, A is the symbol on top of the stack that is popped, and X is the symbol pushed onto the stack. The symbol ∈ stands for the "empty" string. Acceptance is by final state and empty stack.
 
(a) Give 4 strings of length 6 over Σ that are accepted by PDA M4.
(b) Give 4 strings of length 6 over Σ that are rejected by PDA M4.
(c) Give the language of M4 in set notation.
(d) Let M5 be a PDA obtained from M4 by removing the transitions δ(q4, ∈, ∈) = (q5, ∈), δ(q5, a, B) = (q5, ∈) and δ(q5, a, C) = (q5, ∈), adding transition δ(q4, a, B) = (q4, ∈), removing state q5 and making state q4 a final state. Give the language of M5 in set notation.

(e) Is there a relation between the language of M4 and M5. Explain briefly.

(f) It is a well known result that every PDA with acceptance condition of an empty stack and reachability of a final state can be transformed to an equivalent PDA with acceptance condition requiring only reachability of a final state. Transform the PDA M4 to an equivalent PDA with acceptance requiring only reachability of a final state.

Automata & Computation, Computer Science

  • Category:- Automata & Computation
  • Reference No.:- M91232433
  • Price:- $70

Priced at Now at $70, Verified Solution

Have any Question?


Related Questions in Automata & Computation

Iot and data analytics1 analyse the taskanalyse what is

IOT and data analytics 1. Analyse the Task Analyse what is expected of you. This includes careful reading of the assignment task as specified in the Subject Outline. The executive summary of the research project is to be ...

Regular expressions automatacomputabilitytheory of

Regular expressions, automata/computability/theory of computation How would I go about interpreting regular expressions? For example, how would I interpret the following in English: (0+1)*011 0*1*2* 0^(+)1^(+)2^(+)

Question - design a task or function that will check the

Question - Design a task or function that will check the parity of a word for odd parity. The input to the task/function is a 5-bit word called data_in. If the parity of input data_in is not odd increment an error count ...

Question - design a state machine that will control a

Question - Design a state machine that will control a vending machine. The vending machine has 4 inputs, N, D indicating a nickel or dime was inserted as well as clk and an active high asynchronous reset. The vending mac ...

Models of computation assignment -purpose - to improve and

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 abo ...

Question 1hoare logic semantics for each of the parts below

Question 1 Hoare Logic Semantics For each of the parts below, justify your answer briefly. 1. For which programs S does {False} S {True} hold? 2. For which programs S does {True} S {False} hold? 3. For which programs S d ...

Question 1a digital computer has a memory unit with 16 bits

Question 1: A digital computer has a memory unit with 16 bits per word. The instruction set consists of 122 different operations. All instructions have an operation code part (opcode) and an address part (allowing for on ...

Solve the question given belowprove the following statement

Solve the question given below Prove the following statement using Hall's Theorem. For any bipartite graph G=(U, V, E), if every node (either a left node or a right node) has exactly d neighbors, where d is an arbitrary ...

Prove or disprove the following proposed inference rules

Prove or disprove the following proposed inference rules for functional dependencies. A proof should be made by using the reflexive, augmentation, transitive, decomposition, union, and pseudotransitive rules. A disproof ...

Prove or disprove the following proposed inference rules

Prove or disprove the following proposed inference rules for functional dependencies. A proof should be made by using the reflexive, augmentation, transitive, decomposition, union, and pseudotransitive rules. A disproof ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As