Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
lfa:2022:lab08-the-pumping-lemma [2022/11/28 12:13]
mihai.udubasa
lfa:2022:lab08-the-pumping-lemma [2022/12/09 08:55] (current)
pdmatei
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 91: 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 152: 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 178: Line 177:
  
 </​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} \: \} $
  
  
-/*+
  
 <hidden Solution>​ <​note>​ <hidden Solution>​ <​note>​
Line 208: Line 207:
 </​hidden>​ </​hidden>​
  
-*/+
  
 **8.2.6.** $  L = \{ \: w \in \{0\}^* \: | \: \text{the length of w is a power of two} \: \} $ **8.2.6.** $  L = \{ \: w \in \{0\}^* \: | \: \text{the length of w is a power of two} \: \} $
  
  
-/* 
  
 <hidden Solution>​ <​note>​ <hidden Solution>​ <​note>​
Line 239: Line 237:
  
 </​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 268: Line 266:
 </​hidden>​ </​hidden>​
  
-*/+
  
 ===== 8.3. Combining the pumping lemma with closure properties ===== ===== 8.3. Combining the pumping lemma with closure properties =====
  
 **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 287: Line 285:
  
 </​hidden>​ </​hidden>​
-*/+
 /* /*
 ====== Homework ====== ====== Homework ======