Edit this page Backlinks This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== DFA and RegExp Exercises ====== **Exercise 1. ** Write a Regex for IP addresses. **Exercise 2. ** Concatenation and Kleene operators applied on languages: **2.1.** $math[A=\{ 0^{2k} \mid k \geq 1 \}] $ B = \{0, \epsilon \}$ \\ $ AB = ? $ \\ **2.2.** $math[A = \{ 0^n 1^n \mid k \geq 1 \}] \\ $ B = \{ 1^n \mid n \geq 1 \} $ \\ $ AB = ? $ \\ $ BA = ? $ **2.3.** $ A = \emptyset $ \\ $ B = \{ 1^n \mid n \geq 1 \} $ \\ $ AB = ? $ \\ $ A^* = ? $ \\ $ B^* = ? $ \\ **Exercise 3.** Writing Regular Expressions \\ **3.1.** Write a regular expression for the language of arithmetic expressions containing +, * and numbers. **Hint:** you can abbreviate $ 0 \cup 1 \cup ... \cup 9 $ by $ [0-9] $ **3.2.** Write a regular expression for $ L = \{ \omega \text{ in } \text{{0,1}} ^* \text{ | every sequence of consecutive zeros appears before ANY sequence of consecutive ones} \} $ **Exercise 4.** Write a DFA for $ L(( 10 \cup 0) ^* ( 1 \cup \epsilon )) $ **Exercise 5.** Write a regular expression which generates the accepted language of A: {{:lfa:graf1.png?200|}} **Exercise 6.** Simplify the regular expression you found.