Exercises Chapter 1. Exercise 1.1. Let Σ be an alphabet. Prove wv = w + v for all strings w and v.

Similar documents
Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages

Harvard University Computer Science 121 Midterm October 23, 2012

Formal languages, automata, and theory of computation

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS

Closure Properties of Regular Languages

Homework 3 Solutions

Worked out examples Finite Automata

Designing finite automata II

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages

First Midterm Examination

Context-Free Grammars and Languages

Minimal DFA. minimal DFA for L starting from any other

Talen en Automaten Test 1, Mon 7 th Dec, h45 17h30

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

Chapter 2 Finite Automata

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9.

Formal Languages and Automata

First Midterm Examination

Theory of Computation Regular Languages

CSE : Exam 3-ANSWERS, Spring 2011 Time: 50 minutes

Nondeterminism and Nodeterministic Automata

CSC 311 Theory of Computation

CS 275 Automata and Formal Language Theory

1.4 Nonregular Languages

Convert the NFA into DFA

CS:4330 Theory of Computation Spring Regular Languages. Equivalences between Finite automata and REs. Haniel Barbosa

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

Lexical Analysis Finite Automate

Overview HC9. Parsing: Top-Down & LL(1) Context-Free Grammars (1) Introduction. CFGs (3) Context-Free Grammars (2) Vertalerbouw HC 9: Ch.

CISC 4090 Theory of Computation

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

In-depth introduction to main models, concepts of theory of computation:

CMSC 330: Organization of Programming Languages

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2016

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

Let's start with an example:

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama

CHAPTER 1 Regular Languages. Contents

CS 311 Homework 3 due 16:30, Thursday, 14 th October 2010

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2

Converting Regular Expressions to Discrete Finite Automata: A Tutorial

CHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA)

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

1 Nondeterministic Finite Automata

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science

CS 275 Automata and Formal Language Theory

Some Theory of Computation Exercises Week 1

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun:

Fundamentals of Computer Science

3 Regular expressions

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1

Regular Language. Nonregular Languages The Pumping Lemma. The pumping lemma. Regular Language. The pumping lemma. Infinitely long words 3/17/15

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers

Revision Sheet. (a) Give a regular expression for each of the following languages:

SWEN 224 Formal Foundations of Programming WITH ANSWERS

Finite Automata-cont d

CS375: Logic and Theory of Computing

Regular expressions, Finite Automata, transition graphs are all the same!!

Myhill-Nerode Theorem

Automata and Languages

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2014

80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES. 2.6 Finite State Automata With Output: Transducers

The University of Nottingham

Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-*

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata

ɛ-closure, Kleene s Theorem,

CS 330 Formal Methods and Models

FABER Formal Languages, Automata and Models of Computation

Parse trees, ambiguity, and Chomsky normal form

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS

1.3 Regular Expressions

Non Deterministic Automata. Linz: Nondeterministic Finite Accepters, page 51

Lecture 6 Regular Grammars

More on automata. Michael George. March 24 April 7, 2014

CS 330 Formal Methods and Models

Finite-State Automata: Recap

Table of contents: Lecture N Summary... 3 What does automata mean?... 3 Introduction to languages... 3 Alphabets... 3 Strings...

CS 330 Formal Methods and Models

Deterministic Finite Automata

CS S-12 Turing Machine Modifications 1. When we added a stack to NFA to get a PDA, we increased computational power

Non-deterministic Finite Automata

For convenience, we rewrite m2 s m2 = m m m ; where m is repeted m times. Since xyz = m m m nd jxyj»m, we hve tht the string y is substring of the fir

CS 330 Formal Methods and Models Dana Richards, George Mason University, Spring 2016 Quiz Solutions

a,b a 1 a 2 a 3 a,b 1 a,b a,b 2 3 a,b a,b a 2 a,b CS Determinisitic Finite Automata 1

Thoery of Automata CS402

GNFA GNFA GNFA GNFA GNFA

NFAs continued, Closure Properties of Regular Languages

Coalgebra, Lecture 15: Equations for Deterministic Automata

Lecture 08: Feb. 08, 2019

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

DFA minimisation using the Myhill-Nerode theorem

Languages & Automata

Formal Languages and Automata Theory. D. Goswami and K. V. Krishna

NFA DFA Example 3 CMSC 330: Organization of Programming Languages. Equivalence of DFAs and NFAs. Equivalence of DFAs and NFAs (cont.

Transcription:

1 Exercises Chpter 1 Exercise 1.1. Let Σ e n lphet. Prove wv = w + v for ll strings w nd v. Prove # (wv) = # (w)+# (v) for every symol Σ nd every string w,v Σ. Exercise 1.2. Let w 1,w 2,...,w k e k strings, for some k 0 over the lphet Σ, such tht w 1 w 2 w k. Put w 0 = ε. Prove, (w 1 /w 0 )(w 2 /w 1 ) (w k /w k 1 ) = w k. Exercise 1.3. The reverse w R of string w is given y ε R = ε nd (w) R = (w R ). Prove tht (wv) R = (v R )(w R ) for every two strings w nd v. Exercise 1.4. A full inry tree is tree where ech node s either 0 or 2 children. Proof tht full inry tree with n leves hs t most 2 n 1 nodes. Exercise 1.5. (The Towers of Hnoi) See, e.g., http://it.ly/1c4qsuf. Suppose you hve three posts nd stck of n different sized disks, initilly plced on one post with the lrgest disk on the ottom nd with ech disk ove it smller thn the disk elow. You re to move the disks so they end up ll on nother post, gin in decresing order of size with the lrgest disk on the ottom. The only moves you re llowed involve tking the top disk from one post nd moving it so tht it ecomes the top disk on nother post, without eing put on smller disk. () Show tht for ny n there must e sequence of moves tht does indeed end with ll the disks on post different from the originl one in the desired configurtion. () How mny moves re t lest required given n initil stck of n disks in the sequence of moves reveled y your nswer to the previous question? Exercise 1.6. Let Σ e n lphet. () Clculte the lnguge conctentions {,cd} {e,ef} nd {} {}. () Prove tht {ε} L = L {ε} = L for every lnguge L Σ. (c) Prove tht L = L = nd = {ε}. (d) Give counter exmple for (L 1 L 2 ) = L 1 L 2 for two lnguges L 1,L 2 Σ. Exercise 1.7. The shuffle w v of two strings w,v Σ yields set of strings, nd is given y (1) ε ε = {ε} (2) w ε = {w} (3) ε v = {v} (4) w v = {} (w v ) {} (w v )

2 () Clculte nd c def. () Prove w v = v w. (c) Does it lwys hold tht wv,vw w v?

3 Exercises Chpter 2 Exercises for Section 2.1 Exercise 2.1. Construct DFA D 1 with lphet {,} (with no more thn three sttes) for the lnguge L 1 = { n n 0} nd prove with the help of pthsets tht L(D 1 ) = L 1. Exercise 2.2. Construct DFA D 2 with lphet {0,1} (with no more thn four sttes) for the lnguge L 2 = {w {0,1} the second lst element of w is 0} nd prove with the help of pthsets tht L(D 2 ) = L 2. Exercise 2.3. () Construct DFA for the lnguge {,c,c,} over the lphet {,,c}. () If L {,,c} is finite, does there exists DFA D such tht L(D) = L? Exercise 2.4. () Construct DFA D 3 with lphet {0,1} (with no more thn eight sttes) for the lnguge L 3 = {w {0,1} w hs sustring 00 nd sustring 11} nd prove tht L(D 3 ) = L 3. () Construct DFA D 4 with lphet {0,1,2} (with no more thn eight sttes) for the lnguge L 4 = {w {0,1,2} w hs sustring 00 nd sustring 11} nd prove tht L(D 4 ) = L 4. Exercise 2.5. Construct DFAs D 5 nd D 6 ccepting the following lnguges () L 5 = {w {,} w mod 3 = 0} (c) L 6 = {w {0,1} w s inry numer is divisile y 3} Exercise 2.6. Suppose lnguge L Σ is ccepted y DFA D. Construct DFA D C tht ccepts the lnguge L C = {w Σ w / L}. Exercise 2.7. Let D 1 nd D 2 e two DFAs, sy D i = (Q i, Σ, δ i, q0 i, F i) for 1 i 2. () Give DFA D with set of sttes Q 1 Q 2 nd lphet Σ such tht L(D) = L(D 1 ) L(D 2 ). () Prove, y induction on the length of string w, tht ((q 1,q 2 ),w) n D ((q 1,q 2),w ) (q 1,w) n D (q 1,w ) (q 2,w) n D (q 2,w ) (c) Conclude tht indeed L(D) = L(D 1 ) L(D 2 ).

4 Exercises for Section 2.2 Exercise 2.8. Consider the lphet Σ = {,, c}. () Construct n NFA tht ccepts the lnguge L = { n m c l n,m,l 0} nd hs no more thn three sttes. () Derive DFA ccepting L from the NFA constructed in prt (). Exercise 2.9. Consider the lphet Σ = {,, c}. () Construct single NFA tht ccepts string w Σ iff (i) w is of the form c n for some n 0, or (ii) w is of the form m c for some m 0, or (iii) w is of the form c l for some l 0 () Derive DFA ccepting L from the NFA constructed in prt (). Exercise 2.10. Give n utomton overthe lphet {,,c,d} tht ccepts ll strings in which t lest one symol of the lphet does not occur. Exercise 2.11. Suppose the lnguge L Σ is regulr. () Show tht L\{ε} is regulr. () Let w Σ e n ritrry string. Prove tht L {w} is regulr. Exercise 2.12. () Prove tht the lnguge L = {c,c,,c} is regulr. () Construct DFA ccepting L. (c) Prove tht every finite lnguge over some lphet Σ is regulr.

5 Exercises for Section 2.3 Exercise 2.13. (Sipser 1997) For the lnguge of ech of the following regulr expressions over the lphet {,}, give two strings tht re memers nd two strings tht re not memers. () () () (c) (+) (+) (+) (+) (d) (1+) Exercise 2.14. Provide regulr expression for ech of the following lnguges. () {w {,} w strt with nd ends in } () {w {,,c} w contins t most two s nd t lest one } (c) {w {,} w 3} Exercise 2.15. (Sipser 1997) Construct regulr expressions for the lnguges ccepted y the following DFAs: () () q 0 q 1, q 0 q 1 q 2 Exercise 2.16. Guess regulr expression for ech of the following lnguges. Next provide DFA for ech lnguge nd construct regulr expression vi elimintion of sttes. () {w {,} in w, ech mximl sustring of s of length 2 or more is followed y symol } () {w {,} w hs no sustring } (c) {w {,} # (w) = # (w) if v w then 2 # (v) # (v) 2} Exercise 2.17. (Sipser 1997) Convert the following regulr expression to n equivlent NFA: () (+) (+) () ((() ())+)

6 Exercises for Section 2.4 Exercise 2.18. Prove tht the following lnguges re not regulr. () { k k k 0} () { k l k > l > 0} (c) { k l c k+l k,l 0} Exercise 2.19. Prove tht the lnguge {ww R w {0,1} } is not regulr. Exercise 2.20. Prove tht the lnguge { n n is prime} is not regulr. Exercise 2.21. () Prove, y induction on m, tht m < 2 m for m 0. () Prove tht the lnguge { n n = 2 k for some k 0} is not regulr. Exercise 2.22. Prove tht the following lnguges re not regulr. () {w {0,1} # 0 (w) = # 1 (w)} () {w {0,1} # 0 (w) # 1 (w)} Exercise 2.23. Prove tht the clss of regulr lnguges is closed under reversl, i.e. if the lnguge L is regulr, then so is L R = {w R w L}. Exercise 2.24. The symmetric difference X Y of two sets X nd Y is given y X Y = {x X x / Y } {y Y y / X } Prove tht the clss of regulr lnguges is closed under symmetric difference, i.e. if the lnguges L 1 nd L 2 re regulr, then so is L 1 L 2.

7 Exercises Chpter 3 Exercises for Section 3.1 Exercise 3.1. (Hopcroft, Motwni & Ullmn, 2001) Consider the following PDA. [ /1] [1/11] [1/1] [1/11] [1/ε] [1/ε] q 0 q 1 Compute ll mximl derivtion sequences for the following inputs: () ; () ; (c). A mximl derivtion sequence of PDA P for string w is sequence (q 0,w 0,x 0 ) P (q 1,w 1,x 1 ) P...(q n 1,w n 1,x n 1 ) P (q n,w n,x n ) P where q 0,q 1,...,q n 1,q n re sttes of P with q 0 its initil stte, w 0,w 1,...,w n 1,w n strings over the input lphet of P with w 0 equl to w, nd x 0,x 1,...,x n 1,x n strings over the stck lphet of P with x 0 equl to ε, the empty stck. Exercise 3.2. Construct push-down utomton nd give n invrint tle for the following lnguges over the input lphet Σ = {,,c}. () L 1 = { n m c n+m n,m 0}; () L 2 = { n+m n c m n,m 0}; (c) L 3 = { n n+m c m n,m 0}; Exercise 3.3. Give push-down utomton nd invrint tle for ech of the following lnguges: () L 4 = { n 2n n 0}; () L 5 = { n m m n 1}; (c) L 6 = { n m 2n = 3m+1}; (d) L 7 = { n m m,n 0, m n}. Exercise 3.4. () Give push-down utomton for the lnguge L 8 = {w {,} # (w) # (w)} () Give push-down utomton for the lnguge L 9 = {w {,,c} # (w) # (w) # (w) # c (w)}

8 Exercises for Section 3.2 Exercise 3.5. (Hopcroft, Motwni & Ullmn 2001) Consider the context-free grmmr G given y the production rules S XY X ε X Y ε Y Y tht genertes the lnguge of the regulr expression (+). Give leftmost nd rightmost derivtions for the following strings: () ; () ; (c). Exercise 3.6. Consider the context-free grmmr G given y the production rules () Prove tht L G (A) = { n n 0}. S A B A ε A B ε B () Prove tht L(G) = { n n 0} { n n 0}. Exercise 3.7. Give context-free grmmr for ech of the following lnguges nd prove them correct. () L 1 = { n m n,m 0, n m}; () L 2 = { n m c l n,m,l 0, n m m l}; Exercise 3.8. Give construction, sed on the numer of opertors, tht shows tht every the lnguge of every regulr expression cn e generted y context-free grmmr. Exercise 3.9. (Hopcroft, Motwni & Ullmn 2001) Consider the context-free grmmr G given y the production rules S S S () Prove tht no string w L(G) hs sustring. () Give description of L(G) tht is independent of G. (c) Prove tht your nswer for prt () is correct.

9 Exercise 3.10. (Hopcroft, Motwni& Ullmn 2001) Consider the context-free grmmr G given y the production rules S SS SS ε Prove tht L(G) = {w {,} # (w) = # (w)}. Exercise 3.11. A context-free grmmr G = (V, T, R, S, ) is clled liner if ech production rule is of either of the following two forms: A B or A ε for A,B V, not necessrily different, nd T. Argue tht every regulr lnguge is generted y liner context-free grmmr. Argue tht every liner context-free grmmr genertes regulr lnguge.

10 Exercises for Section 3.3 Exercise 3.12. Consider gin the the grmmr of Exercise 3.5 with production rules S XY X ε X Y ε Y Y Provide prse trees for this grmmr with yield,, nd. A context-free grmmr G is clled miguous if there exist two different complete prse trees PT 1 nd PT 2 of G such tht yield(pt 1 ) = yield(pt 2 ). Otherwise G is clled unmiguous. Exercise 3.13. () Show tht the grmmr G given y the production rules is miguous. S AB B A A B () Provide n unmiguous grmmr G tht genertes the sme lnguge s G. Argue why G is unmiguous nd why L(G ) = L(G). Exercise 3.14. () Show tht the grmmr G given y the production rules is miguous. S ε SS SS () Provide n unmiguous grmmr G tht genertes the sme lnguge s G. Argue why G is unmiguous nd why L(G ) = L(G).

11 Exercises for Section 3.4 Exercise 3.15. (Hopcroft, Motwni & Ullmn 2001) Convert the context-free grmmr G S AA A S S to PDA P tht ccepts on empty stck with N(P) = L(G). Exercise 3.16. Consider the PDA P ccepting on empty stck elow. [D/ε] [X/XX] [D/XD] [X/X] q 0 q 1 [D/D] [X/ε] Give context-free grmmr G such tht L(G) = N(P). Exercise 3.17. (Hopcroft, Motwni & Ullmn, 2001) Consider gin the PDA of Exercise 3.1 repeted elow. [ /1] [1/11] [1/1] [1/11] [1/ε] [1/ε] q 0 q 1 Provide context-free grmmr tht genertes the sme lnguge s this PDA ccepts.

12 Exercises for Section 3.5 Exercise 3.18. Show tht the clss of context-free lnguges is closed under reversl, i.e. if L is contextfree lnguge then so is L R = {w R w L}. Show tht the clss of context-free lnguges is not closed under set difference, i.e. if L 1 nd L 2 re context-free lnguges, then L 1 \L 2 = {w L 1 w / L 2 } is not context-free in generl. Exercise 3.19. Show tht the lnguge L 1 = { n2 n 0} is not context-free. Exercise 3.20. Show tht the lnguge L 2 = {ww R w w {,} } is not context-free. Exercise 3.21. Show tht the lnguge L 3 = {0 n 10 2n 10 3n n 0} is not context-free. Exercise 3.22. Show tht the lnguge L 4 = { n l c m n,l m} is not context-free.

13 Exercises Chpter 4 Exercises for Section 4.1 Exercise 4.1. ConstructrectiveTuringmchinefor the lngugel = { n m c l n,m,l 0}. Give n ccepting computtion sequence for the string ccc. Argue why the strings cc nd c re not ccepted. A proof of correctness is not sked for. Exercise 4.2. Construct, for the lnguge L = { n m c n+m n,m 0 }, rective Turing mchine. Give n ccepting computtion sequence for the string cccc. Argue why the strings cc nd ccc re not ccepted. A proof of correctness is not sked for. Exercise 4.3. Construct rective Turing mchine for the lnguge L = {ww R w {,} }. Give n ccepting computtion sequence for the string. Argue why the strings nd re not ccepted. A proof of correctness is not sked for. Exercise 4.4. Construct rective Turing mchine for the lnguge L = { n n n n n 0}. Give n ccepting computtion sequence for the string. Argue why the strings nd re not ccepted. A proof of correctness is not sked for. Exercise 4.5. ConstructrectiveTuringmchineforthelngugeL = {ww R w w {,} }. Give computtion sequence for the string. Argue why the strings nd re not ccepted. A proof of correctness is not sked for. Exercise 4.6. Construct Turing mchine for the lnguge L = { n n c n n > 0} tht hs t most one -move. A proof of correctness is not sked for. Exercise 4.7. ConstructrectiveTuringmchineforthelngugeL = {w {,} # (w) = 2 # (w)} with t most 4 sttes. A proof of correctness is not sked for.

14 Exercises for Section 4.2 Exercise 4.8. Construct clssicl Turing mchine tht computes function p : {,} {Y,N} such tht p(w) = Y if w is plindrome, nd p(w) = N if w is not plindrome. Give computtion sequence for the strings nd producing Y, nd for the strings the strings nd producing N. A proof of correctness is not sked for. Exercise 4.9. Construct clssicl Turing mchine for the Dutch ntionl flg prolem, i.e. Turing mchine tht computes the function dnf : {R,W,B} {R,W,B} such tht, for ny string w {R,W,B}, dnf(w) = R n W m B l where n = # R (w), m = # W (w), nd l = # B (w). Give computtion sequence for the strings RWBRW, BBWWWRRR nd BWB. A proof of correctness is not sked for. Exercise 4.10. () Construct clssicl Turing mchine tht computes function 2 log : {0,1} {0,1} such tht 2 log(w) = n if 2 n w < 2 n+1 with the string w interpreted s inry numer. () Construct Turing mchine tht computes function 2to3 : {0,1} {0,1,2} such tht if the string w represents in inry the numer n, the string 2to3(w) represent in ternry the sme numer n. (c) Construct clssicl Turing mchine tht computes function 3 log : {0,1} {0,1} such tht 3 log(w) = n if 3 n w < 3 n+1 with the string w interpreted s ternry numer.

15 Exercises Chpter 5 Exercises for Section 5.1 Exercise 5.1. Consider the LTS S 1 nd S 2 in Figure 1. () Provide isimultion reltion tht shows tht the two sttes q 0 nd q 1 of LTS S 1 re isimilr. () Provide isimultion reltion tht shows tht LTS S 1 nd LTS S 2 re isimilr. Exercise 5.2. Construct coloring tle to decide which sttes in LTS S 3 nd nd which sttes in LTS S 4 of Figure 1 re isimilr. Is it the cse tht the two LTS re isimilr? If yes, provide isimultion reltion. If no, point out why the initil sttes cnnot e isimilr. S 3 q 0 S 4 p 0 S 1 q 0 S 2 p 0 q 1 q 2 p 1 c c c c q 1 p 1 p 3 q 3 q 4 q 5 c c p 2 p 3 p 4 c c d e d e p 2 q 6 q 7 p 5 p 6 () LTS for Exercise 5.1 () LTS for Exercise 5.2 Figure 1: Bisimilrity Exercise 5.3. Let S e n LTS with set of sttes Q. Prove tht if R 1,R 2 Q Q re two isimultion reltions for S then R 1 R 2 is lso isimultion reltion for S. Exercise 5.4. Consider LTS S 0 of Figure 2. Apply the coloring procedure to show tht q 0,q 1,q 2,q 3 re rnching isimilr sttes nd tht q 4,q 5,q 6,q 7,q 8,q 9 re rnching isimilr sttes. Exercise 5.5. Consider LTS S 1 nd LTS S 2 of Figure 2. Apply the coloring procedure to decide whether LTS S 1 is rnching isimilr to LTS S 2. Exercise 5.6. Consider LTS S 3 nd LTS S 4 of Figure 2c. Apply the coloring procedure to decide whether LTS S 3 is rnching isimilr to LTS S 4.

16 S 1 q 0 S 2 p 0 S 0 q 0 q 1 q 2 q 3 c c q 4 q 5 q 6 q 7 q 8 q 9 d d d q 1 q 2 c d d q 3 p 1 p 2 d d c c p 3 p 4 () LTS for Exercise 5.4 () LTS for Exercise 5.5 S 3 q 0 q 1 S 4 p 0 S 5 q 0 S 6 p 0 q 2 q 3 p 1 p 2 q 1 p 1 p 3 q 4 p 3 p 4 p 2 (c) LTS for Exercise 5.6 (d) LTS for Exercise 5.7 Figure 2: Brnching isimilr?

17 Exercise 5.7. Consider LTS S 5 nd LTS S 6 of Figure 2d. Apply the coloring procedure to decide whether LTS S 5 is rnching isimilr to LTS S 6. Exercise 5.8. Let S e n LTS with set of sttes Q. () Verify tht the identity reltion I = {(q,q) q Q} is isimultion reltion for S. () SupposeR Q QisisimultionreltionforS. Definethe inversereltionr 1 Q Q y R 1 (q,p) R(p,q). Prove tht R 1 is isimultion reltion for S s well. (c) Prove tht if R 1,R 2 Q Q re two isimultion reltions for S then their composition R 1 R 2 defined y R 1 R 2 = {(q,p) r : R 1 (q,r) R 2 (r,p)} is lso isimultion reltion for S. (d) Conclude tht isimilrity of sttes of n LTS is n equivlence reltion. Exercise 5.9. Let S 1 = (Q 1, Σ, 1, q 0 ) nd S 2 = (Q 2, Σ, 2, p 0 ) e two LTSs, nd R Q 1 Q 2 isimultion reltion for S 1 nd S 2. () Prove tht if q Q 1 is rechle from q 0 in S 1, there exists p Q 2 rechle from p 0 such tht R(q, p). () Give n exmple of two isimilr LTSs S 1 nd S 2 for which there exists stte q in S 1 for which there is no isimilr stte in S 2 nd there exists stte p in S 2 for which there is no isimilr stte in S 1.

18 Exercises for Section 5.2 Exercise 5.10. Consider LTS P nd Q elow: P p 0 p 1 p 2 p 8 p 9 Q q 0 q 1 q 2 p 7 p 6 p 5 p 3 p 4 Prove tht P nd Q re rnching isimilr. Exercise 5.11. Consider LTS A, B nd C elow. A c! B d! C c? 0 1 0 1 c 0 c 1 d? Let the communiction function γ e such tht γ(c!,c?) = c nd γ(d!,d?) = d. Define the ction set H = {c!,c?,d!,d?}. Drw the LTS H (A γ B γ C). Exercise 5.12. Consider LTS A, B nd C elow. A B C 0 0 c 0 x c 1 x y 1 c 1 y 2 3 2 c 2 d e 4 5 Let the communiction function γ e such tht γ(x,x ) = x nd γ(y,y ) = y. Define the ction set H = {x,x,y,y } nd the ction set I = {x,y}. Drw the LTS H (A γ B γ C) nd indicte how to otin LTS I ( H (A γ B γ C)).

19 Exercise 5.13. Consider LTS A nd B elow. 0 A x y B 0 x y 1 2 3 4 y x 5 6 c 1 2 3 4 y x 5 6 d 7 7 Let the communiction function γ e such tht γ(x,x ) = x nd γ(y,y ) = y. Define the ction set H = {x,x,y,y } nd the ction set I = {x,y}. Drw the LTS H (A γ B) nd indicte how to otin LTS I ( H (A γ B)). Exercise 5.14. Consider the processes C(0) nd C(1), nd the processes D(0) nd D(1) given y C(0) c! 0 C(1) c! 1 D(0) d! 0 D(1) d! 1 c 0 c 1 d 0 d 1 Design n LTS S such tht, for suitle communiction function γ nd sets of ctions H nd I, it holds tht the LTS I ( H (S γ C(i) γ D(j))) for i,j = 0,1, esides ctions, only performs n ction in cse i+j = 0, n ction if i+j = 1, nd n ction c if i+j = 2. Exercise 5.15. LTS IC of n instle coin process, nd LTS SC of stle coin process re given y IC ic0 c! hed ic 1 ic 2 c! til SC sc0 c! hed sc 1 sc 2 c! til Put H = { c! x, c? x x = hed,til } nd I = { c x x = hed,til }. Give process S nd communiction function γ, such tht the LTS I ( H (S γ IC)) nd I ( H (S γ SC)) re not rnching isimilr.