## Question

## Transcribed Text

## Solution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

Problem 3a).

Observation – this part can be easier done after designing the dynamic programming algorithm from subsequent parts.

The resulting vector-sum is: 2+1+3 x 5 + 1+ 4 x 2 = 27

b).

The optimization process is based on the key observation that, on each step, the decision is made between 1) the previous optimum value + current element (if we take itby summing-up) and 2) the optimum value from two steps behind + the product between the current element and the previous element of the array (if we choose the multiplication instead of summing-up). Combined with the initial conditions for trivial cases (n=0 –no array and n=1 –one-element array), we obtain the following formulation for the optimum value to be used by the dynamic programming algorithm:

Optimum[j]= MAX (Optimum[j-1] + v[j], Optimum[j-2] + v[j-1] x v[j]).Optimum[j] = v1, when j=1 and Optimum[j]=0, when j=0.

The optimization process is based on the key observation that, on each step, the decision is made between 1) the previous optimum value + current element (if we take it by summing-up) and 2) the optimum value from two steps behind + the product between the current element and the previous element of the array (if we choose the multiplication instead of summing-up)....

By purchasing this solution you'll be able to access the following files:

Solution.pdf.