代写MATH3202、代做Python程序语言
- 首页 >> Python编程 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.
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.