next up previous
Next: Up: Previous:

Unique Subproblems

How many unique subproblems?



Assume that 1 $\leq$ i < j $\leq$ n or 1 $\leq$ i = j $\leq$ n.


\begin{displaymath}\left( \begin{array}{c} n \\ 2 \end{array} \right) + n\end{displaymath}

All ways of choosing i and j for problem m[i,j] when i < j +
All ways of choosing i and j for problem m[i,j] when i = j

\begin{displaymath}=\; \frac{n!}{2!(n-2)!} \;+\; n\end{displaymath}


\begin{displaymath}=\; \frac{n(n-1)}{2} \;+\; n\end{displaymath}


\begin{displaymath}=\; n^2/2 \;-\; n/2 \;+\; n\end{displaymath}


\begin{displaymath}=\; 1/2(n^2 \;+\; n)\end{displaymath}


\begin{displaymath}=\; \Theta(n^2).\end{displaymath}

Only polynomial number of unique subproblems.


next up previous
Next: Up: Previous: