<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="https://ocw.cs.pub.ro/ppcarte/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://ocw.cs.pub.ro/ppcarte/feed.php">
        <title>books aa:lab</title>
        <description></description>
        <link>https://ocw.cs.pub.ro/ppcarte/</link>
        <image rdf:resource="https://ocw.cs.pub.ro/ppcarte/lib/tpl/bootstrap3/images/favicon.ico" />
       <dc:date>2026-04-13T11:49:24+03:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:0&amp;rev=1720607361&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:02&amp;rev=1603351542&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:03&amp;rev=1603453393&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:04&amp;rev=1605053175&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:05&amp;rev=1605438691&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:07&amp;rev=1606165965&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:08&amp;rev=1605904279&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:09-amortized_analysis&amp;rev=1606603780&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:09&amp;rev=1606910748&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:1&amp;rev=1759763763&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:2&amp;rev=1760427769&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:3&amp;rev=1761566395&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:4&amp;rev=1761592447&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:5&amp;rev=1761990526&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:6&amp;rev=1762840968&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:7&amp;rev=1763304150&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:8&amp;rev=1764842936&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:9&amp;rev=1765540858&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:10&amp;rev=1765801832&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:11&amp;rev=1768081978&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:12&amp;rev=1768820336&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:13&amp;rev=1611598248&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:14&amp;rev=1611493813&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:decidability&amp;rev=1477994827&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:introduction-to-python&amp;rev=1601895495&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:notations&amp;rev=1478103516&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:recurrences&amp;rev=1478796856&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:rice&amp;rev=1477136016&amp;do=diff"/>
                <rdf:li rdf:resource="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:tm&amp;rev=1572521675&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://ocw.cs.pub.ro/ppcarte/lib/tpl/bootstrap3/images/favicon.ico">
        <title>books</title>
        <link>https://ocw.cs.pub.ro/ppcarte/</link>
        <url>https://ocw.cs.pub.ro/ppcarte/lib/tpl/bootstrap3/images/favicon.ico</url>
    </image>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:0&amp;rev=1720607361&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-07-10T13:29:21+03:00</dc:date>
        <title>aa:lab:0</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:0&amp;rev=1720607361&amp;do=diff</link>
        <description>Recapitulare matematică

Pe parcursul semestrului, la cursurile și laboratoarele de AA, ne vom folosi de instrumente matematice (e.g. definiții, demonstrații) pentru a dezvolta un framework riguros cu garanții formale despre diverse proprietăți ale problemelor/algoritmilor studiați.</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:02&amp;rev=1603351542&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-10-22T10:25:42+03:00</dc:date>
        <title>aa:lab:02</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:02&amp;rev=1603351542&amp;do=diff</link>
        <description>Lab 02 - Introduction to Turing Machines

Key concepts

	*  How is a Turing Machine (TM) defined?
	*  What is a configuration?
	*  How is the execution of a TM defined?

1. Intro

A Turing Machine consists of:

	*  an alphabet $ \Sigma$ 
		*  a set of states $ K$$ q_0$$ \delta : K \times \Sigma \rightarrow K \times \Sigma \times \{L,H,R\}$$ F \subseteq K$$ K,\Sigma, \delta, q_0, F$$ M=(K,\Sigma,q_0,\delta,F)$$ K=\{q_0,q_1,q_2\}$$ F=\{q_2\}$$ \Sigma=\{0,1,\#\}$$ \delta$$ q_0$$ (q_0,1,R)$$ (q_0,0,…</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:03&amp;rev=1603453393&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-10-23T14:43:13+03:00</dc:date>
        <title>aa:lab:03</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:03&amp;rev=1603453393&amp;do=diff</link>
        <description>Lab 03 - Turing Machines

Key concepts

	*  acceptance vs decision
	*  complement of a problem

1. Accepting and deciding a decision problem

1.1 Can the problem $ f(w) = 0$  (for all w in $ \Sigma^*$ ) be accepted by a Turing Machine?

1.2 Can a problem be accepted by two different Turing Machines?$ f(x) = 1$$ x^2+y^2=1$$ x^4+y^4+z^4=w^4$$ 3x^2-2xy-y^2z-7=0$$ y-x\leq 1$$ 3x+2y\leq 12$$ 2x+3y\leq 12$</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:04&amp;rev=1605053175&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-11-11T02:06:15+03:00</dc:date>
        <title>aa:lab:04</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:04&amp;rev=1605053175&amp;do=diff</link>
        <description>Lab 04 - Turing Machines

Key concepts

	*  what is a Turing-reduction?

1. Semi-decidable problems

1.1 Prove that $ R \subsetneq RE.$

1.2 Show that the following problem is not in $ R$ : $ f(M) = 1$  iff exists $ w$  such that $ M$  accepts $ w.$

	*  This is actually the problem complement of establishing if $ M$$ f(x) = 0.$$ RE.$$ RE$$ R$$ f(M_1, M_2, w) = 1$$ M_1$$ M_2$$ w.$$ RE$$\leq_T$$ RE$$\leq_T$$\leq_T$$\leq_T$$\leq_T$$ f$$\leq_T$$ f_h.$$ f$$ k$$ Vertex$$ Cover$$\leq_T$$ f_h.$$ R$$ f(…</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:05&amp;rev=1605438691&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-11-15T13:11:31+03:00</dc:date>
        <title>aa:lab:05</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:05&amp;rev=1605438691&amp;do=diff</link>
        <description>Lab 06 - Asymptotic notations

1. Asymptotic notations

1.1 If $ f \in O(n \sqrt n)$  and $ g \in Θ(n)$  then $ f \over g$  in ?

1.2 If $ f \in Θ(n)$  and $ g \in O(\sqrt n)$  then $ f \over g$  in ?

1.3 |$ Θ(n) - Θ(n)$ | in ?

2. Properties of asymptotic notations

2.1 Prove that if $ lim_{n\rightarrow \infty}$  $ g(n) \over f(n)$  $ = 0$  implies that $ g(n) \in o(f(n))$ , for n reaching infinity. Hint: use the “epsilon$ f(n) \in Ω(log(n))$$ g(n) \in O(n)$$ f(n) \in Ω(log(g(n)))$$ f(n) \in Ω…</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:07&amp;rev=1606165965&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-11-23T23:12:45+03:00</dc:date>
        <title>aa:lab:07</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:07&amp;rev=1606165965&amp;do=diff</link>
        <description>Lab 07 - Recurrences

1. Basic algorithms

1.1 Based on the following code for Bubble-sort, analyze the algorithm's time complexity:
  void bubbleSort(int arr[], int n)
  {
      int i, j, temp;
      for(i = 0; i &lt; n - 1; i++)
      {
          for(j = 0; j &lt; n - i - 1; j++)
          {
              if(arr[j] &gt; arr[j + 1])
              {
                  // swap the elements
                  temp = arr[j];
                  arr[j] = arr[j + 1];
                  arr[j + 1] = temp;
         …</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:08&amp;rev=1605904279&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-11-20T22:31:19+03:00</dc:date>
        <title>aa:lab:08</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:08&amp;rev=1605904279&amp;do=diff</link>
        <description>Lab 08 - Heaps

Heaps

Binary Heaps are binary trees with the following properties:

 I.  Any node's $ n$  value is greater then his child's value $ c$ . ($ n.value \geq c.value$ )

 II. The tree is almost complete (missing elements are possible only on the last level)
       15
     /    \
    9      5
   / \    / 
  2   3  1  $ v$$ h$$ h$$ pos$$ ceil(log(10)) = 4$$ j = 2^{(4-1)}$$ j = 2^{(i-1)}$$ 2^i-1$</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:09-amortized_analysis&amp;rev=1606603780&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-11-29T00:49:40+03:00</dc:date>
        <title>aa:lab:09-amortized_analysis</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:09-amortized_analysis&amp;rev=1606603780&amp;do=diff</link>
        <description>Lab 09 - Amortized Analysis

1. Stacks

2. Binary Counter

3. FIFO

4. Heaps

4.1 Aggregate analysis:

 Let S be a sequence of n insertions into an initially empty heap.

 At the end of the sequence, we will have an almost-complete binary tree. To make the analysis simpler, suppose it is complete.</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:09&amp;rev=1606910748&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-12-02T14:05:48+03:00</dc:date>
        <title>aa:lab:09</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:09&amp;rev=1606910748&amp;do=diff</link>
        <description>Lab 09 - Amortized Analysis

Applications

1 Stacks (see lecture)

2 Binary Counter

3 FIFO

4 Heaps

5  ArrayList with removal

Further reading:
&lt;https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:ammortized-analysis&gt;</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:1&amp;rev=1759763763&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-06T18:16:03+03:00</dc:date>
        <title>aa:lab:1</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:1&amp;rev=1759763763&amp;do=diff</link>
        <description>Editor de text: introducere

Scopul acestui laborator este familiarizarea studenților cu editorul de texte pe care îl vom folosi pe parcursul semestrului pentru a ilustra în mod practic diversele concepte abordate.

Cod editor

Descărcați scheletul de cod al editorului de text de</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:2&amp;rev=1760427769&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-14T10:42:49+03:00</dc:date>
        <title>aa:lab:2</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:2&amp;rev=1760427769&amp;do=diff</link>
        <description>Notații asimptotice și analiză amortizată

Notații asimptotice

$ \Theta(f(n)) = \{ g: \mathbb{R}^{+} \rightarrow \mathbb{R}^{+}\ |\ 
\begin{array}{l}
\exists c_1, c_2 \in \mathbb{R}^+\cr
\exists n_0 \in \mathbb{N}
\end{array}\ 
such\ that\ \forall\ n \ge n_0,\ \ c_1f(n) \le g(n) \le c_2f(n) \}$$ f(n) = \Theta(n) + O(\log(n)) $$ \exists g \in \Theta(n)$$ \exists h \in O(\log(n))$$ f(n) = g(n) + h(n),\ \forall n \in \mathbb{R}^{+}$$ \Theta(n^2) = O(n^2) + o(n)$$ \forall f \in \Theta(n^2),\ \exist…</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:3&amp;rev=1761566395&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-27T13:59:55+03:00</dc:date>
        <title>aa:lab:3</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:3&amp;rev=1761566395&amp;do=diff</link>
        <description>Analiza Amortizata 2

Vom continua cu analiza amortizata inceputa in laboratorul precedent cu un ArrayList cu urmatoarele proprietati:

	*  isi dubleaza capacitatea cand este plin (ex: avem 4 elemente intr-un ArrayList cu capacitate 4. La adaugarea celui de-al 5-lea element, capacitatea va deveni 8 - necesita o copiere de 4 element, apoi inserarea celui de-al 5-lea element).</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:4&amp;rev=1761592447&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-27T21:14:07+03:00</dc:date>
        <title>aa:lab:4</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:4&amp;rev=1761592447&amp;do=diff</link>
        <description>Inducție structurală

Demonstrați următoarele proprietăți folosind inducție structurală:

1. $ \forall l \in List. reverse(reverse(l)) = l$

2. $ \forall r \in Ring, size(move(r)) = size(r)$

3. $ \forall i \in \mathbb{N}, \forall r \in Ring, element(i,move(r)) = element(i+1,r)$</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:5&amp;rev=1761990526&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-11-01T11:48:46+03:00</dc:date>
        <title>aa:lab:5</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:5&amp;rev=1761990526&amp;do=diff</link>
        <description>Analiza Probabilistă în Hashing

În acest laborator vom explora comportamentul probabilist al hashing-ului și fenomenele care apar din cauza coliziunilor.  
Vom lucra pe două exemple simple care ilustrează concepte teoretice importante:

	*  Paradoxul zilelor de naștere$$
P(\text{coliziune}) = 1 - \frac{k!}{(k-n)! \, k^n}
$$$$
E[T] = n H_n = n(1 + \tfrac{1}{2} + \tfrac{1}{3} + \dots + \tfrac{1}{n})
$$</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:6&amp;rev=1762840968&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-11-11T08:02:48+03:00</dc:date>
        <title>aa:lab:6</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:6&amp;rev=1762840968&amp;do=diff</link>
        <description>Recurențe

1. Identificați formula de recurență pentru numărul de pași elementari pentru functiile binary_search si successor de mai jos și calculați complexitatea algoritmilor folosind metoda arborilor și metoda substituției.


int binary_search(int *arr, int start, int end, int x) {
    if (start &gt; end)
        return -1;

    int m = (start + end) / 2;
    if (arr[m] == x) 
        return m;

    if (x &lt; arr[m]) {
        return binary_search(arr, start, m - 1, x);
    } else {
        return…</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:7&amp;rev=1763304150&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-11-16T16:42:30+03:00</dc:date>
        <title>aa:lab:7</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:7&amp;rev=1763304150&amp;do=diff</link>
        <description>Recurențe

1. Folosiți una dintre cele 3 metode (metoda arborilor, metoda substituției, teorema master) pentru a rezolva recurențele:

	*  $ T_a(n) = 2T_a(n-1) + 1$
	*  $ T_b(n) = T_b(n-1) + 1$
	*  $ T_c(n) = 2T_c(n/2) + \log(n)$
	*  $ T_d(n) = T_d(n/9) + T_d(8n/9) + n$
	*  $ T_e(n) = T_e(2n/3) + 1$
	*  $ T_{Strassen}(n) = 7T_{Strassen}(n/2) + n^2 $


Aceasta recurenta descrie  Algoritmul Strassen

	*  $ T_{Karatsuba}(n) = 3T_{Karatsuba}(n/2) + 1 $


Aceasta recurenta descrie  Algoritmul Karatsu…</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:8&amp;rev=1764842936&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-12-04T12:08:56+03:00</dc:date>
        <title>aa:lab:8</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:8&amp;rev=1764842936&amp;do=diff</link>
        <description>Arbori Binari de Căutare

Un arbore binar de căutare (BST) este o structură de date arborescentă în care,
pentru orice nod de valoare \(x\), toate valorile din subarborele stâng sunt
\(&lt; x\), iar toate din cel drept sunt \(&gt; x\). În cadrul acestui laborator vom
pune inegalitatea parțială pe subarborele stâng (\(\le x\)\(O(\log n)\)\( \text{Nil}: \mathrm{BTree} \)\( \text{Node}: \mathbb{E} \times \mathrm{BTree} \times \mathrm{BTree} \to \mathrm{BTree} \)\(\mathbb{E}\)\(\mathbb{N}\)\(\le\)\( \math…</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:9&amp;rev=1765540858&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-12-12T14:00:58+03:00</dc:date>
        <title>aa:lab:9</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:9&amp;rev=1765540858&amp;do=diff</link>
        <description>Arbori echilibrați

Pentru ca operațiile pe arbori de căutare să fie eficiente, este nevoie ca aceștia să fie echilibrați; i.e. să nu poată existe diferențe arbitrare între numărul de noduri dintre subarboriele stâng și subarborele drept.
În cel mai rău caz, fiecare nod din arbore are un singur copil, ceea ce face arborele să fie de fapt o listă simplu înlănțuită.$ h$$ i$$1 \le i \le h - 1$$ 2^i$$ h$$ \Theta(\log n)$$ O(n)$$ l$$ r$$ \mid \mathrm{height(l)} - \mathrm{height}(r) \mid \le 1$$ \math…</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:10&amp;rev=1765801832&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-12-15T14:30:32+03:00</dc:date>
        <title>aa:lab:10</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:10&amp;rev=1765801832&amp;do=diff</link>
        <description>Probleme &quot;dificile&quot;

În acest laborator veți explora un graf realist cu date despre toate aeroporturile din lume și rutele dintre ele și veți aplica diverși algoritmi *eficienți* pe acesta.
Momentan, puteți considera termenul “eficient” să însemne $ O(n^k)$$ k$$ k$</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:11&amp;rev=1768081978&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-01-10T23:52:58+03:00</dc:date>
        <title>aa:lab:11</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:11&amp;rev=1768081978&amp;do=diff</link>
        <description>Reduceri polinomiale

În acest laborator veți explora un graf realist cu date despre toate aeroporturile din lume și rutele dintre ele și veți aplica diverși algoritmi *eficienți* pe acesta.
Momentan, puteți considera termenul “eficient” să însemne $ O(n^k)$$ k$$ \texttt{MINIMAL COLORING}$$ \texttt{COLORING}$$ k$$ k$$ \texttt{MINIMAL COLORING}$$ \texttt{COLORING}$$ \texttt{COLORING}$$ \texttt{MINIMAL COLORING}$$ \texttt{COLORING} \le_P \texttt{CNF SAT}$$ x_{v, c}$$ (v, c)$$ v$$ (x_{v, 0} \lor x_…</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:12&amp;rev=1768820336&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-01-19T12:58:56+03:00</dc:date>
        <title>aa:lab:12</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:12&amp;rev=1768820336&amp;do=diff</link>
        <description>Abordări practice pentru probleme NP-Complete

Problemele NP-Complete despre care am discutat până acum la curs și la laborator au două trăsături principale:

	*  nu au soluții eficiente cunoscute
	*  sunt relevante practic

Trebuie deci să avem o strategie de a le aborda, nu putem să le evităm.
În acest laborator vom studia o strategie puternică numită $ G = (V, E)$$ K$$ v \in V$$ grad(v) &gt; K$$ K$$ K$$ K$$ v \in V$$ grad(v) = 0$$ K^2$$ K$$ K$$ K$$ K$$ K$$ K \times K$$ K = 0$$ K^2$$ K = 0$$ \tex…</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:13&amp;rev=1611598248&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-01-25T20:10:48+03:00</dc:date>
        <title>aa:lab:13</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:13&amp;rev=1611598248&amp;do=diff</link>
        <description>Abstract (algebraic) Data Types

Base constructors of a ADT

Base constructors express how values of a certain ADT are constructed canonically (not as a result of other ADT operations). Base constructors are defined via their signature, which expresses how values of a certain type are constructed.</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:14&amp;rev=1611493813&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-01-24T15:10:13+03:00</dc:date>
        <title>aa:lab:14</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:14&amp;rev=1611493813&amp;do=diff</link>
        <description>Structural Induction

Recall the ADTs defined in the previous lab:

	*  Tree
	*  FIFO
	*  Map

Prove the following properties are true, using structural induction:

1. $ \forall t\in \texttt{Tree}. size(t) \geq height(t)$

2. $ \forall t \in \texttt{Tree}. flatten(mirror(t)) = reverse(flatten(t))$

Find a proper formulation and prove the following properties:

1. Merging (using the strategy from $ 2^{height(t)}-1$</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:decidability&amp;rev=1477994827&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-11-01T12:07:07+03:00</dc:date>
        <title>aa:lab:decidability</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:decidability&amp;rev=1477994827&amp;do=diff</link>
        <description>Decidability

We recall a few basic definitions. Let $ M$  be a Turing Machine over $\Sigma^*$ and $ f:\Sigma^*\rightarrow\{0,1\}$  be a decision problem. Then:

	*  $ M$  accepts $ f$  $ \iff$  $ \forall w\in\Sigma^*: M(w) = 1 \iff f(w) = 1$  and $ M(w) = \bot \text{ otherwise }$ 
	*  $ M$  decides $ f$  $ \iff$  $ M$  accepts $ f$  and $ M$  halts for all inputs.

We say:

	*  $ f$  is recursively enumerable if $ f$  is accepted by some Turing Machine;$ f$$ f$$ RE$$ R$$ f$$ \iff$$ f$$ f$$ \iff…</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:introduction-to-python&amp;rev=1601895495&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-10-05T13:58:15+03:00</dc:date>
        <title>aa:lab:introduction-to-python</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:introduction-to-python&amp;rev=1601895495&amp;do=diff</link>
        <description>Introduction to Python

Python basics

Python is an interpreted, dynamically typed language which is easy to use for scripting and prototyping applications.

C and Java programmers quickly adjust to the Python syntax. Unlike C, in Python, lists are predefined and usually more used than arrays:</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:notations&amp;rev=1478103516&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-11-02T18:18:36+03:00</dc:date>
        <title>aa:lab:notations</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:notations&amp;rev=1478103516&amp;do=diff</link>
        <description>Asymptotic Notations

	*  Contacts: Dumitru Mihai-Valentin, Matei Popovici
	*  Published: 9.11.2015

Outline

An execution time is a function $ T:\mathbb{N}\rightarrow\mathbb{N}$ , which maps a value $ n$  representing the size of the input of an algorithm to the number of instructions (execution steps) performed by the algorithm.$ f: \mathbb{R}^{+} \rightarrow \mathbb{R}^{+}$$ X(f(n)) \subseteq \mathbb{H}om(\mathbb{R}^{+},\mathbb{R}^{+})$$ X\in\{O,o,\Theta,\omega,\Omega\}$$$ \Theta(f(n)) = \{ g…</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:recurrences&amp;rev=1478796856&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-11-10T18:54:16+03:00</dc:date>
        <title>aa:lab:recurrences</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:recurrences&amp;rev=1478796856&amp;do=diff</link>
        <description>Recurrences

Methods for solving recurrences: 


Lab exercises

	*  $ T(n) = 4T(n/4) + 1$  (the substitution method is interesting)
	*  $ T(n) = 8T(n/2) + \Theta(n^2)$  (the substitution method is interesting)
	*  $ T(n) = 2T(n-1) + 1$ 
	*  $ T(n) = T(n-1) + 1$ 
	*  $ T(n) = 2T(n/2) + \log(n)$  (the iteration method is interesting)

Practice exercises

Use each possible method, to solve:$ T(n) = T(n/9) + T(8n/9) + n$$ T(n) = T(2n/3) + 1$$ T(n) = T(\sqrt{n}) + 1$$ n$$ 2^k$$ T(n) = 2T(\sqrt{n}) + …</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:rice&amp;rev=1477136016&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-10-22T14:33:36+03:00</dc:date>
        <title>aa:lab:rice</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:rice&amp;rev=1477136016&amp;do=diff</link>
        <description>Reading Rice's Theorem

Establish the hardness of the following

	*  $ f(M) = \left\{\begin{array}{ll} 1 &amp; M \text{ does not terminate for every input } \\ 0 &amp; \text{otherwise} \end{array}\right.$ 

Reading Rice's Theorem

Proposition (Rice): 

$ \mathcal{C} \subseteq RE$$ M$ “The problem accepted by $ M$  is in $ \mathcal{C}$ ?”. $ R$

	*  Rice's theorem establishes undecidability of a problem. Which problem is that?</description>
    </item>
    <item rdf:about="https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:tm&amp;rev=1572521675&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2019-10-31T13:34:35+03:00</dc:date>
        <title>aa:lab:tm</title>
        <link>https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:tm&amp;rev=1572521675&amp;do=diff</link>
        <description>Turing Machines

Warmup

	*  Write a Turing Machine $ M_1$  such that $ M(w) = 1$  iff $ w$  is a binary encoding of the value $ 4$ . Try not to use more than $ 5$  states.
	*  Write a Turing Machine $ M_2$  such that $ M(w) = 1$  iff $ w$  is a binary encoding of the value $ 4$ , and $ M(w) = 0$  otherwise;
	*  What is the difference between $ M_1$$ M_2$$$ f(w) = \left\{\begin{array}{cc}1 &amp; w=0^*100 \\ 0 &amp; \text{otherwise} \end{array}\right. $$$ f$$0^*100$$ f$$ 4$$ M_1$$ f$$ M_2$$ f$$$ \forall …</description>
    </item>
</rdf:RDF>
