MATH3202/7232 Operations Research

81 阅读1分钟

MATH3202/7232 Operations Research & Mathematical Planning 2024

Tutorial 8 – Dynamic Programming

Python Functions 

Define functions in Python to

• Calculate the factorial of a number n

• Calculate the value function for the ‘Minimal Studying’ problem

• Determine the optimal solution for the ‘Minimal Studying’ problem

Knapsack Problem 

We have a container of size 20 units, and want to pack it with the following 

valuable items:

Item j  Size vj  Value tj

How many of each item should we pack in order to maximize the total value?

Fibonacci Sequence 

Define a function in Python to calculate the number in the Fibonacci

sequence.

 WX:codinghelp