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:15] pdmatei |
temp:exam [2021/09/10 13:35] (current) pdmatei |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | 1. Fie $math[f] o problema de decizie si $math[\mathcal{M_f} = \{M\mid M \text{ este o masina care decide }f \}]. 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[\mathcal{M}] este finita | + | |
- | * $math[\mathcal{M}] este numarabila | + | |
- | * $math[\mathcal{M}] **nu poate fi vida** | + | |
- | * $math[\mathcal{M} \subseteq RE] | + | |
- | 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)]. | + | 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)]? |
- | 4. Care este complexitatea urmatorului program: | + | 4. Dati un exemplu de gramatica in Forma Normala Cholmsky care sa genereze un limbaj infinit regulat. |
- | <code python> | + | 5. Câte stări și câte tranziții va avea un APD rezultat din convertirea unei gramatici cu 4 reguli? |
- | def f(n): | + | |
- | if n == 0: | + | |
- | return 1 | + | |
- | return g(n) + f(n/2) + 1 | + | |
- | def g(n): | + | |
- | if n mod 2 == 0: | + | |
- | return 2*f(n/2) | + | |
- | else | + | |
- | return f(n/2) | + | |
- | </code> | + | |
- | 5. Problema sortarii poate fi redusa la SAT? Argumentati raspunsul. | + | 6. Dati un exemplu de limbaj dependent de context care, **concatenat** la un limbaj **independent de context**, produce un limbaj **independent de context**. |
- | 6. Ce putem spune despre un tip de date abstract care are doar constructori de baza **interni**? (Ce este un constructor de baza intern?) |