Reference no: EM133965792
Task 1: Accepting Languages with Reterna
Let Σ = {A, B, C} be an alphabet. In the following, the (extended) Reterna programs should each take as input a string w ∈ Σ* (encoded as a number) and a number k ∈ No, and decide whether w ∈ Lk ⊆ Σ*:
1. Lk = AkΣ*
= { w ∈ Σ* | the first k characters in w are A }
2. Lk = { w ∈ Σ* | the letter A occurs exactly k times in w }
3. Lk = (Ak | Bk | Ck)* = { w ∈ Σ* | w consists of segments in which the same letter appears k times consecutively } Your reliable and affordable assignment help starts today!
Example: "AAACCCBBBAAA" ∈ L3
Task 2: Programming with Reterna
Write a program in (extended) Reterna that takes a number n ∈ No as input and checks whether there exist three numbers a, b, c ∈ N with a ≥ 2, b ≥ 2, and c ≥ 2 such that:
a · b · c = n If n is the product of three integers greater than or equal to 2, your program should return true; otherwise, it should return false.