Answer to Question #95810 in Discrete Mathematics for Ahmed

Question #95810
At the beginning of the first day (day 1) after grape harvesting is completed, a grape
grower has 8000 kg of grapes in storage. At the end of day n, for n = 1, 2, . . . , the grape grower
sells 250n/(n + 1) kg of their stored grapes at the local market at the price of $1.50 per kg.
During each day the stored grapes dry out a little so that their weight decreases by 2%.
Let wn be the weight (in kg) of the stored grapes at the beginning of day n for n ≥ 1.
(a) Find a recursive definition for wn. (You may find it helpful to draw a timeline.)
(b) Find the value of wn for n = 1, 2, 3.
(c) Let rn be the total revenue (in dollars) earned from the stored grapes from the beginning of
day 1 up to the beginning of day n for n ≥ 1.
Write a MATLAB program to compute wn and rn for n = 1, 2, . . . , num where num is entered
by the user, and display the values in three columns: n, wn, rn with appropriate headings.
Run the program for num = 20. (Use format bank.)
1
Expert's answer
2019-10-06T11:17:46-0400

(a) w1 = 8000, wn = 0.98*w(n-1) - 250n/(n+1)

(b) w1 = 8000

w2 = 0.98*8000 - 125 = 7715

w3 = 0.98*7340 - 250*2/3 = 7394.0333

(c)

format bank
num = input('Input x >> ');
w = 8000;
r = 0;
disp('     n     wn in kg   rn in $')
for n = 1:num
  if w<0
    r = r - 1.5*w; % back does not exist kg to make daily sells
    w = 0;
    break;
  end;
  disp([n w r])
  w = w*0.98 - 250*n/(n+1);
  r = r + 1.5*250*n/(n+1);
end;


Output

Input x >> 20
     n     wn in kg   rn in $
     1.00    8000.00       0

     2.00    7715.00    187.50

     3.00    7394.03    437.50

     4.00    7058.65    718.75

     5.00    6717.48    1018.75

     6.00    6374.80    1331.25

     7.00    6033.02    1652.68

     8.00    5693.60    1980.80

     9.00    5357.51    2314.14

     10.00    5025.36    2651.64

     11.00    4697.58    2992.55

     12.00    4374.46    3336.30

     13.00    4056.20    3682.45

     14.00    3742.94    4030.66

     15.00    3434.74    4380.66

     16.00    3131.67    4732.23

     17.00    2833.75    5085.17

     18.00    2540.96    5439.33

     19.00    2253.30    5794.60

     20.00    1970.73    6150.85




Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS