Course Solutions Uncategorized (Solved) : Please Use Mathematica Following 2 Problems Use Method 1 Method 2 Problem Method 1 Code 1 Q30253161 . . . .

(Solved) : Please Use Mathematica Following 2 Problems Use Method 1 Method 2 Problem Method 1 Code 1 Q30253161 . . . .

 

Please use Mathematica only for the following 2problems.

Use Method 1 and Method 2 for each problem.

Method 1 code:

a = 1/3;
d2d = 2;
stock = 1;
deliv = -1;
totalsold = 0;
totallost = 0;
totalcust = 0;

numweeks = 10;

For[i = 1, i <= numweeks, i++,
(
For[j = 1, j <= 7, j++,
(
sold = 0;
lost = 0;
  
If[deliv == 0,
stock++;];
If[deliv >= 0,
deliv–;];
  
randomnum = Random[Real, {0, 1}, 5];
  
If[randomnum < a,
customers = 1;,
customers = 0];
  
If[customers == 1,
(
If[stock > 0,
(
sold++;
stock–;
If[deliv < 0,
deliv = d2d;];
),
lost++];
)];
totalsold = totalsold + sold;
totallost = totallost + lost;
totalcust = totalcust + customers;
)];

)];

Print[“total sold = “, totalsold];
Print[“total customers = “, totalcust];
Print[“total customers lost = “, totallost];

Method 2 code:

a

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : Find Least Squares Solutions Ax B Compute Least Squares Error B Ax Resulting Least Squares Q32477363 . . . .(Solved) : Find Least Squares Solutions Ax B Compute Least Squares Error B Ax Resulting Least Squares Q32477363 . . . .

<p dir="ltr"><img src="https://media.cheggcdn.com/media%2Fcdd%2Fcddec8a8-cdb2-4838-9b95-b86c88fdc970%2Fimage.png" alt="Find the least squares solutions of Ax = b and compute the least squares error = | |b-Ax| | resulting from the least squares solution x. 「1