Question
You have a sideline business buying and selling vintage jukeboxes. You have room to store up to two jukeboxes and feel certain that the following
You have a sideline business buying and selling vintage jukeboxes. You have room to store up to two jukeboxes and feel certain that the following prices will prevail over the next four months:
Month | 1 | 2 | 3 | 4 |
Sell (ask) Price | $2500 | $2800 | $2000 | $2700 |
Buy (bid) Price | $2600 | $2900 | $2100 | $2800 |
Each month, you have a choice of one of the following three actions:
Buy: buy one jukebox at the bid price (unless you already have two in storage) Hold: do nothing (allowable with any number of jukeboxes in storage, including zero) Sell: sell one jukebox at the ask price (unless you do not have any left in storage).
Each month you can buy up to maxBuy jukeboxes at buy (bid) price, sell up to maxSell jukeboxes at the selling (ask) price, or do nothing. For each jukebox in inventory at the end of a month, you must pay $100 for maintenance and cleaning. For each jukebox left over at the end of the time horizon, you obtain a salvage value of $2000. Your inventory capacity is 2 jukeboxes, maxBuy = 1, maxSell = 1, and you start with 0 inventory.
How would you create a Python program to maximize profits in this problem?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started