A cask P is filled with 50 liters of water, and cask Q with 40 liters of acid. Precisely x liters are drawn from each cask and then, mixed and replaced. The same operation is then repeated.
Accordingly, the foregoing operation is performed precisely 2 times.
After the conclusion of the 2nd operation,
precisely 8.875 liters of acid remain in cask P.
Determine the value of x.
I think the second paragraph merely reiterates what's said in the first paragraph: that x liters are drawn and replaced, and then that's done a second time.
A case could be made that the second paragraph refers to the whole repeated operation being done again, for a total of four sets of drawing and replacing. In any case, it makes for another interesting problem. The program calculates each way.
clc
x=5;contents=[50 0; 0 40];
low=0; lowx=x; delta=.1;
while contents(1,2)~=8.875
contents=[50 0; 0 40];
fromA=[x*contents(1,1)/50 x*contents(1,2)/50];
fromB=[x*contents(2,1)/40 x*contents(2,2)/40];
bottle=fromA+fromB;
contents(1,:)=contents(1,:)-fromA+bottle/2;
contents(2,:)=contents(2,:)-fromB+bottle/2;
fromA=[x*contents(1,1)/50 x*contents(1,2)/50];
fromB=[x*contents(2,1)/40 x*contents(2,2)/40];
bottle=fromA+fromB;
contents(1,:)=contents(1,:)-fromA+bottle/2;
contents(2,:)=contents(2,:)-fromB+bottle/2;
% disp([x contents(1,2)])
v=contents(1,2);
if v>8.875
delta=delta/10;
x=lowx;
else
lowx=x;
end
xSave=x;
x=x+delta;
end
disp([xSave v])
contents
disp(' ')
x=4;contents=[50 0; 0 40];
low=0; lowx=x; delta=.1;
while contents(1,2)~=8.875
contents=[50 0; 0 40];
fromA=[x*contents(1,1)/50 x*contents(1,2)/50];
fromB=[x*contents(2,1)/40 x*contents(2,2)/40];
bottle=fromA+fromB;
contents(1,:)=contents(1,:)-fromA+bottle/2;
contents(2,:)=contents(2,:)-fromB+bottle/2;
fromA=[x*contents(1,1)/50 x*contents(1,2)/50];
fromB=[x*contents(2,1)/40 x*contents(2,2)/40];
bottle=fromA+fromB;
contents(1,:)=contents(1,:)-fromA+bottle/2;
contents(2,:)=contents(2,:)-fromB+bottle/2;
fromA=[x*contents(1,1)/50 x*contents(1,2)/50];
fromB=[x*contents(2,1)/40 x*contents(2,2)/40];
bottle=fromA+fromB;
contents(1,:)=contents(1,:)-fromA+bottle/2;
contents(2,:)=contents(2,:)-fromB+bottle/2;
fromA=[x*contents(1,1)/50 x*contents(1,2)/50];
fromB=[x*contents(2,1)/40 x*contents(2,2)/40];
bottle=fromA+fromB;
contents(1,:)=contents(1,:)-fromA+bottle/2;
contents(2,:)=contents(2,:)-fromB+bottle/2;
% disp([x contents(1,2)])
v=contents(1,2);
if v>8.875
delta=delta/10;
x=lowx;
else
lowx=x;
end
xSave=x;
x=x+delta;
end
disp([xSave v])
contents
finding
10 8.875
contents =
41.125 8.875
8.875 31.125
5.31818475186887 8.875
contents =
41.125 8.875
8.875 31.125
meaning that x = 10 results in the required 8.875 liters of acid in the water cask, and showing the contents of the two casks in terms of water and acid, assuming only two drawing/replacement actions are performed.
If it's a total of four such actions, x=5.318... has the desired result shown.
|
Posted by Charlie
on 2022-09-08 08:26:42 |