I have 3 tables…
All equal structure but with different values and different number of rows. I want to write a recursive function describing the optimal choices of quantities in order to maximize my profit. I have a given amount to spend and the total expenses can't exceed this. Besides, I use the notation that p_nj should the profit in table n and quantity j and c_{nj} should express the cost of choosing quantity j in table n. I think it's something like f_n(A) = max{ p_nj + f_{n+1}(A-c_nj) } where A is the amount I can invest. My intuition is that I'm adding the profit p_nj for each iteration and subtracting the cost from the total available amount (A-c_nj). I don't think it's correct but I guess it's something like that. How can I iterate through all the three different tables with recursion?
asked
Orn |

I have a homework problem. I want to maximize my score while minimizing my effort.

Hey Mark. I've tried to give an answer to my homework problem but I'm stuck with a solution which I don't believe is correct, so now I'm asking for help. I think it's quite ok.

@Orn: Unfortunately for you, Mark is correct. Answering homework is not allowed here because it wastes professional people's time and it is also against the code of academic integrity in many institutions. The best we could do for you is to guide you through the solution process. To achieve that, you might start by stating your own solution. Then, we could help you get on the right track.

Please also note that the answers to these kind of questions are usually provided late in comparison to the regular non-homework questions.