Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
temp:exam [2021/09/09 11:54] pdmatei |
temp:exam [2021/09/10 13:35] (current) pdmatei |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | 1.Fie $math[M] o masina Turing cu o singura stare, care accepta doar sirul vid $math[\epsilon] si $math[f] o problema acceptata de $math[M']. Care afirmatii sunt adevarate: | + | 1. Scrieti doua expresii regulate $math[e_1] si $math[e_2] peste alfabetul $math[\Sigma=\{0,1\}] astfel incat $math[L(e_1) = \overline{L(e_2)}] si $math[L(e_1), L(e_2)] sa fie ambele infinite. |
- | * $math[f \in RE] | + | |
- | * $math[f \in R] | + | |
- | * $math[f \in RE\setminus R] | + | |
- | * $math[\exists w. f(w) = 0] | + | |
- | * $math[\exists w. f(w) = 1] | + | |
- | 2.Fie $math[f] o problema NP-dura, $math[g] o problema NP-completa si $math[g \leq_p f]. Care afirmatii sunt adevarate? | + | 2. Fie $math[w = c_1c_2\ldots c_n] un cuvant. Notam cu $math[rep(w)] cuvantul $math[c_1c_1c_2c_2\ldots c_n] si cu $math[Rep(L)], limbajul $math[\{rep(w) \in \Sigma^* \mid w \in L\}]. Daca limbajul $math[L] este regulat atunci $math[Rep(L)] este regulat sau nu? Justificati. |
- | * $math[f \in R] | + | |
- | * $math[f \in NP] | + | |
- | * $math[g \in R] | + | |
- | * $math[g \in NP] | + | |
- | 3.Dati un exemplu de **algoritm** care are timpul de executie in $math[O(n)] dar nu $math[\Theta(n)]. | + | 3. Fie $math[(q_1,1010,0010Z_0)] o configuratie a unui APD. Ce tranzitii sunt necesare pentru ca APD-ul sa ajunga in configuratia $math[(q_x,10,0010Z_0)]? |
- | //Solutie: Verificarea daca o lista e sortata// | + | 4. Dati un exemplu de gramatica in Forma Normala Cholmsky care sa genereze un limbaj infinit regulat. |
- | 4. Care este complexitatea unei implementari a Masinii Turing Universale? | + | 5. Câte stări și câte tranziții va avea un APD rezultat din convertirea unei gramatici cu 4 reguli? |
- | 5.Care este complexitatea simularii urmatoarei proceduri: | + | 6. Dati un exemplu de limbaj dependent de context care, **concatenat** la un limbaj **independent de context**, produce un limbaj **independent de context**. |
- | <code python> | + | |
- | def f(l): | + | |
- | x = choice(l) | + | |
- | s = x | + | |
- | for i in range(0,len(l)): | + | |
- | s = s + l[i] | + | |
- | </code> | + | |
- | 6.Ce putem spune despre un tip de date abstract care are doar constructori de baza **nulari**? (Ce este un constructor de baza nular?). |