**Write regular expression:**

**1. ****Find Regular expression for ****even length string**** where ∑ = {a, b}**

**Regular Expression **

**2. ****Regular expression for all ****odd-length string**** where ∑ = {a, b}**

**Regular Expression **

Now if we combine **all even and odd length string**** **then we will get all string

**Even length string and Odd length string = Set of all string**

**3.**** Regular Expression RE = (1 + 01)*. ****Find the language****.**

This RE is a **set of all strings not containing two consecutive zero’s and ending with one****.**

**4.**** Regular Expression RE = (λ + 0) (1 + 10)* ****Find the language****.**

Language of the Regular Expression

L = **{set of all string not containing two consecutive zero}**

**5**. **Regular Expression = (1 + 011)*** is **set of all strings when every zero followed by at least two 1****.**

**6.**** RE = (aa)* (bb)*b, (aa)* (bb)* b, **$\mathbf{\{}{\mathbf{a}}^{\mathbf{n}}\mathbf{}{\mathbf{b}}^{\mathbf{m}}\mathbf{,}\mathbf{}\mathbf{n}\mathbf{}\mathbf{\ge}\mathbf{}\mathbf{0}\mathbf{,}\mathbf{}\mathbf{m}\mathbf{}\mathbf{\ge}\mathbf{}\mathbf{0}\mathbf{\}}$set of **all string where even no. of a’s followed by odd no. of b’s**.

**7.**** **Language:

**8.** Language:

**9.**** Regular Expression = (a + b)* (a + bb)** So, language ={**set of all string ending with a or bb**}

**10.** Language L = {ω | |ω| ≥ 2} **at least two length string** ∑ = {a, b}

String containing language **L = { aa, ab, ba, bb, aaa, aab…..}**

**Then Regular Expression:**

**11.**** **Language L = {ω | |ω| = 2}** exactly two length string** ∑ = {a, b}

Then Regular Expression **RE = (a + b) (a + b) = ∑∑ **

**12. **Regular Expression **RE = (a + b) a (a + b) (a + b)***. What is the **language of this RE**?

L = **set of all strings having at least 3 lengths of string and the second symbol is a, from left**.

**13. **** **Regular Expression **RE = (a + b)* a (a + b) (a + b). **What is the **language of this RE**?

L = **set of all strings having at least 3 lengths of string and the third symbol is a, from the right**.

**14.**** **Language L = {ω | |ω| = k} i.e. **exactly k length string** so, **RE = **${\mathbf{(}\mathbf{a}\mathbf{}\mathbf{+}\mathbf{}\mathbf{b}\mathbf{)}}^{\mathbf{k}}$

**15.** Language L = {ω | |ω| ≥ k} i.e. **at least k length string **then

**RE = **${\mathbf{(}\mathbf{a}\mathbf{}\mathbf{+}\mathbf{}\mathbf{b}\mathbf{)}}^{\mathbf{*}}{(a+b)}^{k}$

**16.**** **Language L = {ω | |ω| ≤ k} i.e. **at most k length string **then **RE** = ${\mathbf{(}\mathbf{\lambda}\mathbf{}\mathbf{+}\mathbf{}\mathbf{a}\mathbf{}\mathbf{+}\mathbf{}\mathbf{b}\mathbf{)}}^{\mathbf{k}}$

**17.**** **Regular Expression **RE = 0(0 + 1)*1 + 1(0 + 1)*0 **then

Language L = **set of all strings starting with 0 and ending with 1 or starting with 1 and ending with 0**.

Or,

Language L = **set of all strings where first and last symbol are not the same**