You are on page 1of 2

Week 6: Formative Task

1. Solve the following miscellaneous exercises:

a) Given a, b, c and d symbols of an alphabet Ʃ, find


i) 𝑎4
ii) |𝑆|, where 𝑆 = 𝑎𝜀𝑏𝑎𝑎3 𝑏 2
iii) 𝑣| |𝑥, where 𝑣 = 𝑑𝑎 and 𝑥 = 𝑑
iv) (𝑑𝑒𝑒𝑝𝑠)𝑅 , (𝑟𝑒𝑚𝑖𝑡)𝑅 , (𝑟𝑒𝑑𝑟𝑎𝑤)𝑅 and (𝑒𝑑𝑖𝑡)𝑅 . Also give any two
palindromes.
v) Ʃ2 , Ʃ3 and Ʃ+ , given that Ʃ = {𝑐, 𝑑}
vi) First four strings of 𝐿 = {𝑤 ∈ {𝑎}∗ : |𝑤| 𝑖𝑠 𝑜𝑑𝑑}
vii) 𝐿1| |𝐿2, given that 𝐿1 = {𝑎, 𝑏} and 𝐿2 = {𝑐}

2. Give the graphical representation of the following deterministic finite state


automata with its transition function.
𝐾 = {𝑞0 , 𝑞1 , 𝑞2 }
Ʃ = {0, 1}
𝑠 = {𝑞0 }
𝐴 = {𝑞2 }

Transition function:
Present State Next State for Input 0 Next State for Input 1
𝑞0 𝑞1 𝑞2
𝑞1 𝑞1 𝑞2
𝑞2 𝑞1 ×

3. Give the graphical representation of the following non deterministic finite state
automata with its transition function.

𝐾 = {𝑞0 , 𝑞1 , 𝑞2 }
Ʃ = {0, 1}
𝑠 = {𝑞0 }
𝐴 = {𝑞2 }

UU-MTH- 1005 Discrete Mathematics/ Formative Task Page 1


Transition function:
Present State Next State for Input 0 Next State for Input 1
𝑞0 𝑞0 , 𝑞1 𝑞1
𝑞1 𝑞2 𝑞0
𝑞2 𝑞2 𝑞1 , 𝑞2

4. Give the languages, and their natures(descriptions), generated by the following


grammars
a) 𝑁 = {𝑆, 𝐴, 𝐵, 𝐶},
Ʃ = {𝑎, 𝑏, 𝑐},
𝑆𝑡𝑎𝑟𝑡 𝑠𝑦𝑚𝑏𝑜𝑙 = 𝑆,
𝑃: 𝑆 → 𝐴𝐵𝐶, 𝐴 → 𝑎, 𝐵 → 𝑏, 𝐶 → 𝑐

b) 𝑁 = {𝑆},
Ʃ = {𝑎, 𝑏},
𝑆𝑡𝑎𝑟𝑡 𝑠𝑦𝑚𝑏𝑜𝑙 = 𝑆,
𝑃: 𝑆 → 𝑎𝑆𝑏𝑆, 𝑆 → 𝑏𝑆𝑎𝑆, 𝑆 → 𝜀

UU-MTH- 1005 Discrete Mathematics/ Formative Task Page 2

You might also like