Micromass' big simulation challenge

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
38 replies · 10K views
mfb said:
I would maximize the expectation value. Risk averages out over multiple days.

Ibix said:
That's how I did it, and I came to the same answer as
@Jimster41.

Dollars at risk (maybe not the best term) are all the dollars for each combination of buying level and demand outcome I either lost because I bought but could sell and had to recycle instead, or failed to make because there was demand for more papers than I bought.
 
Last edited:
Physics news on Phys.org
For Challenge 5, I found 60 papers to be optimal as well.
Code:
%matlab script
%given probability data
%column 1 is demand
P1 = [ 40, .03, .1, .44; 
50, .05, .18, .22; 
60, .15, .4, .16; 
70, .2, .2, .12; 
80, .35, .08, .06; 
90, .15, .04, 0; 
100, .07, 0, 0];

%probability of type of day relating to columns 2-4 of P1
P2 = [.35, .45, .2];

%combined probability for demand - column 1 is demand column 2 is prob.    
P = [P1(:,1),P1(:,2)*P2(1)+P1(:,3)*P2(2)+P1(:,4)*P2(3)];

%fixed parameters    
cost = -33; 
sell = 50; 
scrap = 5;

%purchase options     
Purchase = [0:10:100]';

%initial cost
Profit = Purchase*cost;

%7 cases for demand: 40:10:100
for k = 1:7
sold = min(P(k,1),Purchase);
Profit=Profit+P(k,2)*(sold*sell +(Purchase-sold)*scrap);
end

index = find(Profit == max(Profit)); 
Optimal = Purchase(index);

%output results     
fprintf('Optimal number is %g', Optimal) 
fprintf('. Expected profit is $%g', round(Profit(index),2))

%plot results    
plot(Purchase,Profit)
title('Expected Profit from Newspaper Sales')
xlabel('Papers Purchased')
ylabel('Profit')
 
Ibix said:
Problem 5 can be done with pen and paper (unless I'm missing something) - old school computing. Is that cheating, or shall I post a photo?

I make it 60
Here are (slightly enhanced) photos of my "program":

Part 1 - calculate expected sales:
Copy of 20160602_211406.jpg


Part 2 - calculate profit from various purchases given expected sales:
Copy of 20160602_211416.jpg


I did more work than I needed - I could have just done the 60 and 70, as it was obvious from the functional form of the profit that the answer had to be one of the two.
 
The expectation value of sold newspapers alone doesn't work. It happens to give the right answer here, but there are other cases where it fails. Imagine selling 100 newspapers 50% of the time and 20 newspapers 50% of the time. The expectation value is 60, but every newspaper beyond 20 gives $17 profit or $28 loss with equal probability, so you should buy 20. Your calculation would assume that you always sell 60 newspapers if you buy 60, which is clearly not true.

This question doesn't need any fancy calculations, just go through all the options and calculate the expected profit for each one, use the one where the expected profit is maximal, done.
 
The fraction of the time that the demand is 40 newspapers is:

f(40)=(0.03)(0.35)+(0.1)(0.45)+(0.44)(0.2)=0.1435

Similarly,

f(50)=0.1425
f(60)=0.2645
f(70)=0.1840
f(80)=0.1705
f(90)=0.0757
f(100)=0.0245

Let g(D,N) represent the profit on a given day if the number of papers ordered is N and the demand is D. So, the average profit per day is

$$P(N)=\sum_{D=40}^{100}{f(D)g(D,N)}$$

This needs to be maximized with respect to N.
 
  • Like
Likes   Reactions: mfb
Newspapers... using numbers from Chestermiller and the described approach, here is the expected profit for each case:
40: 689.36
50: 797.125
60: 840.765 <- best
70: 765.38
80: 607.195
90: 372.285
100: 103.31
 
  • Like
Likes   Reactions: Chestermiller
News.png


Gotta sell it to the news stand guy...
:cool:
 
Last edited: