Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(10 pts) L1 = { ap ; p is a prime number }, (10 pts) L2 = { ap ; p is a prime nu

ID: 3868195 • Letter: #

Question

(10 pts) L1 = { ap ; p is a prime number },

(10 pts) L2 = { ap ; p is a prime number, m is a fixed number and m p 0 },

(10 pts) L3 = { ap bp ; p is a prime number },

(10 pts) L4 = { ap bp ; p is a prime number, m is a fixed number and m p 0 },

(15 pts) L5 = { ap ; p is a prime number and p is a number of a Turing machine Tp that does not halt given the input p },

find if it is: a) a regular language; b) a context-free language; c) a recursively enumerable language;

If the case (a) is true for the language Li , build a finite automaton A such that L(A) = Li .

If the case (b) is true for the language Li, build a PDA D and a formal grammar G such that L(D) = L(G) = Li .

If the case (c) is true for the language Li, build a TM T such that L(T) = Li .

If the case (d) is true for the language Li, build an ITM M such that L(M) = Li .

L,-{ a, p is a prime number), L,-{ apy; p is a prime number), Ls -a; p is a prime number and p is a number of a Turing machine Tp that does is a prime number, m is a fixed number and m2p2 0 ;p is a prime number, m is a fixed number and m 2p20

Explanation / Answer

void factor(int n) { int i; for(i=2;i 1) printf("%d",n); printf(" "); }