\documentclass[11pt]{article}
\usepackage{amsmath,amssymb,amsthm,enumitem}
\newcommand{\encode}[1]{\langle #1 \rangle}

\title{\bf Assignment 6 \\[2ex]
\rm\normalsize CS 350 \\ Due: November 25, 2019}
\date{}
\author{}

\begin{document}
\maketitle

\section{Gold Collecting}
\paragraph{} Given a table composed of {\bf N x M} cells, each containing some number of gold coins.
You start from the upper left hand corner and at each step may go down or to the right. At each step
you collect all the coins that are in that location. Find the maximum number of coins you can collect
and the path that provides that result.

\subparagraph{(a) [10 points]} If we were to use a Brute force method to solve this problem, we would need to explore all possible paths. Find the exact number of paths that exist. Explain your answer. (Note that each path must contain exactly $N-1$ right moves and $M-1$ down moves. Try thinking of the path as a strings and figure out how many ways that string can be rearranged.)

\subparagraph{(b) [10 points]} Give a dynamic programming algorithm that solves this problem using $O(NM)$ time and space.

\section{Maximum Subarray Sum}

\paragraph{}
The Maximum Subarray Sum problem is the task of finding the contiguous subarray with largest sum in a given array of integers. Each number in the array could be positive, negative, or zero. For example: Given the array $[-2, 1, -3, 4, -1, 2, 1, -5, 4]$ the solution would be $[4, -1, 2, 1]$ with a sum of 6.

\subparagraph{[10 points]}
Give a dynamic programming algorithm for this problem with complexity $O(n)$.

\end{document}
