Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the following inventory problem. You are running a company that sells s

ID: 3797048 • Letter: C

Question

Consider the following inventory problem. You are running a company that sells some large product (say trucks), and predictions tell you the quantity of sales to expect over the next n months. Let di denote the number of sales you expect in month i. We’ll assume that all sales happen at the beginning of the month, and trucks that are not sold are stored until the beginning of the next month. You can store at most S trucks, and it costs C to store a single truck for a month. You receive shipments of trucks by placing orders for them, and there is a fixed ordering fee of K each time you place an order (regardless of the number of trucks you order). You start out with no trucks. The problem is to design an algorithm that decides how to place orders so that you satisfy all the demands {di}, and minimize the costs.

To summarize:

• Your algorithm receives as input the demands {di}, the costs C and K, and the inventory limit S.

• Your algorithm should output how many trucks to order in each of the n months; you may skip ordering in some of the months.

• In each month you need enough trucks to satisfy the demand di but the number left over after satisfying the demand for the month should not exceed the limit S.

• Your total cost is K times the number of orders placed plus the sum over the months of C times the number of trucks left over after sales that month.

Give a DP-based algorithm that solves this problem in time polynomial in n. (Solutions with a running time that depends on parameters other than n will receive partial credit.) Give a brief argument for the correctness of your recursive equation as well as a brief argument bounding the running time of your algorithm.

Explanation / Answer

% Logistics Map % Classic chaos example. Plots semi-stable values of % x(n+1) = r*x(n)*(1-x(n)) as r increases to 4. % % Michael Hanchak, Dayton OH, USA, 2011 clear scale = 10000; % determines the level of rounding maxpoints = 200; % determines maximum values to plot N = 3000; % number of "r" values to simulate a = 2.0; % starting value of "r" b = 4; % final value of "r"... anything higher diverges. rs = linspace(a,b,N); % vector of "r" values M = 500; % number of iterations of logistics equation % Loop through the "r" values for j = 1:length(rs) r=rs(j); % get current "r" x=zeros(M,1); % allocate memory x(1) = 0.5; % initial condition (can be anything from 0 to 1) for i = 2:M, % iterate x(i) = r*x(i-1)*(1-x(i-1)); end % only save those unique, semi-stable values out{j} = unique(round(scale*x(end-maxpoints:end))); end % Rearrange cell array into a large n-by-2 vector for plotting data = []; for k = 1:length(rs) n = length(out{k}); data = [data; rs(k)*ones(n,1),out{k}]; end % Plot the data figure(97);clf h=plot(data(:,1),data(:,2)/scale,'k.'); set(h,'markersize',1) axis tight set(gca,'units','normalized','position',[0 0 1 1]) set(gcf,'color','white') axis off

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote