diff --git a/exams/least-common-ancestor/index.md b/exams/least-common-ancestor/index.md index b5cbc17..9a0984a 100644 --- a/exams/least-common-ancestor/index.md +++ b/exams/least-common-ancestor/index.md @@ -20,7 +20,7 @@ To find the least common ancestor of two nodes $x$ and $y$ in a tree $t$, we fol 3. consider the common prefix of $p_x$ and $p_y$, the last node in the common prefix is the least common ancestor. -Consider, for example, the binary tree depicted in Figure~\ref{fig:tree}. The least common ancestor +Consider, for example, the binary tree depicted below. The least common ancestor of $3$ and $5$ is $2$. Indeed, the path from the root $1$ to $3$ is $1,2,3$. The path from $1$ to $5$ is $1,2,4,5$. Their common prefix is $1,2$ whose last element is $2$. diff --git a/exams/unit-propagation/index.md b/exams/unit-propagation/index.md index 92d38d5..78f1526 100644 --- a/exams/unit-propagation/index.md +++ b/exams/unit-propagation/index.md @@ -17,7 +17,7 @@ $$ $$ is represented as $$ - \varphi=\{\{a,b,\neg c,\neg f\}, \{b,c\}, \{\neg b, e\}, \{\neg b\}\}. + \varphi=\{\{a,b,\neg c,\neg f\}, \{b,c\}, \{\neg b, e\}, \{\neg b\}\}. \qquad (1) $$ One of the subroutines of the DPLL algorithm is the unit propagation simplifying the input formula. @@ -29,7 +29,7 @@ $c_k=\{u\}$ for some $k$ and literal $u$, then $\varphi$ can be simplified by th 1. if $u\in c_i$, then $c_i$ can be removed from $\varphi$, 2. if $\neg u\in c_i$, then $\neg u$ can be removed from $c_i$. -For example, the formula $\varphi$ in~(\ref{ex1}) has a unit $\{\neg b\}$, so we can simplify to +For example, the formula $\varphi$ in $(1)$ has a unit $\{\neg b\}$, so we can simplify to $\{\{a,\neg c,\neg f\}, \{c\}\}$. Note that by propagating the unit, a new unit was created. Thus we can continue and propagate the unit $\{c\}$ obtaining $\{\{a,\neg f\}\}$. The resulting set of clauses has no unit. diff --git a/homework/hw01.md b/homework/hw01.md index ff5a87d..12f95af 100644 --- a/homework/hw01.md +++ b/homework/hw01.md @@ -202,9 +202,9 @@ $\lfloor{i}\rfloor$ is that $i$ might be slightly larger than $255$ due to round The function returned by `ascii-art` should split the matrix of intensities into blocks. The size of blocks is given by the arguments `width` and `height` The separation of the matrix into blocks is -depicted in Figure~\ref{fig:separation}. In case the width (resp. height) of the matrix is not +depicted below. In case the width (resp. height) of the matrix is not divisible by `width` (resp. `height`) the incomplete blocks have to be removed from the matrix as is -illustrated by the red area in the figure below: +illustrated by the red area: