Read Chapters 5, 6

RNA Folding

(A, U, C, G)

3 rules:

  1. No sharp turns
    1. Bond from $i$ to $j$ implies $i < j - 4$
  2. Only two pairs can bond with each other
    1. A-U
    2. C-G
  3. No crossovers
  4. Bonds are monogamous

Question: What's the maximum number of bonds given these conditions?

Note that there are at most $n^2$ bonds.

$\mathrm{OPT}(i,\,j) \quad i<j$

$\mathrm{OPT}(i,\,j) = 0\quad i \geq j - 4$

Take the maximum of:

$\mathrm{OPT}(i,\, j- 1)$ $\mathrm{MAX}_{i\leq t\leq j}(1 + \mathrm{OPT}(i,\,t-1) + \mathrm{OPT}(t+1, j-1))$

Time: $O(N^3)$

Edit Distance

Let $x = ``acbaddfg"$

Let $y=``azzb”$