Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
lfa:2023:lab08 [2023/12/04 22:12]
mihai.udubasa created
lfa:2023:lab08 [2023/12/08 13:23] (current)
alexandra.udrescu01
Line 19: Line 19:
 **8.1.1.** Show that the pumping lemma holds for finite languages. **8.1.1.** Show that the pumping lemma holds for finite languages.
  
-/*+
 <hidden Solution>​ <hidden Solution>​
  
Line 29: Line 29:
  
 </​hidden>​ </​hidden>​
-*/+
  
 **8.1.2.*** Find a language which is not regular for which the pumping lemma holds. **8.1.2.*** Find a language which is not regular for which the pumping lemma holds.
Line 40: Line 40:
  
  
-/*+
 <hidden Solution>​ <​note>​ <hidden Solution>​ <​note>​
  
Line 63: Line 63:
  
 </​hidden>​ </​hidden>​
-*/+
  
 **8.2.2.** $  L = \{ \: w \in \{A,B\}^* \: | \: \#_A(w) = \#_B(w) \: \} $ **8.2.2.** $  L = \{ \: w \in \{A,B\}^* \: | \: \#_A(w) = \#_B(w) \: \} $
  
-/*+
 <hidden Solution>​ <​note>​ <hidden Solution>​ <​note>​
  
Line 90: Line 90:
  
 </​hidden>​ </​hidden>​
-*/+
  
 **8.2.3.** $math[L = \{(01)^n(10)^n \mid n > 0 \} ] **8.2.3.** $math[L = \{(01)^n(10)^n \mid n > 0 \} ]
  
  
-/*+
 <hidden Solution>​ <​note>​ <hidden Solution>​ <​note>​
 $ w_n = (01)^n(10)^n $ $ w_n = (01)^n(10)^n $
Line 151: Line 151:
  
 </​hidden>​ </​hidden>​
-*/+
  
 **8.2.4.** $  L = \{ \: w \in \{A,B\}^* \: | \: \text{w is a palindrome} \: \} $ **8.2.4.** $  L = \{ \: w \in \{A,B\}^* \: | \: \text{w is a palindrome} \: \} $
  
  
-/* 
 <hidden Solution>​ <​note>​ <hidden Solution>​ <​note>​
  
Line 177: Line 176:
  
 </​hidden>​ </​hidden>​
-*/+
  
 **8.2.5.** $  L = \{ \: w \in \{0\}^* \: | \: \text{the length of w is a prime number} \: \} $ **8.2.5.** $  L = \{ \: w \in \{0\}^* \: | \: \text{the length of w is a prime number} \: \} $
Line 183: Line 182:
  
  
-/* 
 <hidden Solution>​ <​note>​ <hidden Solution>​ <​note>​
  
Line 206: Line 204:
  
 </​hidden>​ </​hidden>​
-*/+
  
  
Line 212: Line 210:
  
  
-/* 
 <hidden Solution>​ <​note>​ <hidden Solution>​ <​note>​
  
Line 237: Line 234:
  
 </​hidden>​ </​hidden>​
-*/+
  
 **8.2.7.** $  L = \{ \: ww^R  \: | \: w\in \{0,1\}^* \} $ **8.2.7.** $  L = \{ \: ww^R  \: | \: w\in \{0,1\}^* \} $
  
  
-/* 
 <hidden Solution>​ <​note>​ <hidden Solution>​ <​note>​
  
Line 265: Line 261:
  
 </​hidden>​ </​hidden>​
-*/+
  
  
Line 271: Line 267:
  
 **8.3.1.** Using the pumping lemma, prove that $  L = \{ \: A^nB^m \: | \: n \neq m \}$ is not a regular language. **8.3.1.** Using the pumping lemma, prove that $  L = \{ \: A^nB^m \: | \: n \neq m \}$ is not a regular language.
-/*+
 <hidden Solution>​ <hidden Solution>​
 <​note>​ <​note>​
Line 285: Line 281:
  
 </​hidden>​ </​hidden>​
-*/ 
-/* 
-====== Homework ====== 
  
-**Exercise I** $  L = \{ \: w \in \{0\}^* \: | \: \text{|w| is a power of 2} \: \} $ 
  
-**Exercise ​II** Show that $  \text{snd(L)}$ is a closure property for regular languages.+====== Nice to try at home ====== 
 + 
 +**Exercise ​I** Show that $  \text{snd(L)}$ is a closure property for regular languages.
  
 $  \text{snd(L)} = \{ \: w \: | \: xw \in L \: \text{, for some x such that |x| = |w|} \: \}$ $  \text{snd(L)} = \{ \: w \: | \: xw \in L \: \text{, for some x such that |x| = |w|} \: \}$
  
-**Exercise ​III** Prove that $  L = \{ \: A^nB^mC^{n-m} \: | \: n \geq m \geq 0 \: \}$ is not a regular language without using isomorphisms.+**Exercise ​II** Prove that $  L = \{ \: A^nB^mC^{n-m} \: | \: n \geq m \geq 0 \: \}$ is not a regular language without using isomorphisms.
  
  
-*/