Ask your own question, for FREE!
Mathematics 4 Online
OpenStudy (anonymous):

Owen made 100 sandwiches which she sold for exactly $100. She sold caviar sandwiches for $5.00 each, the bologna sandwiches for $2.00, and the liverwurst sandwiches for 10 cents. How many of each type of sandwich did she make?

OpenStudy (queelius):

Ok, so the key insight to this problem: the fact that the solution must be non-negative integer values for each type of sandwich is an additional constraint on the problem. There doesn't seem to be a purely analytical solution to this problem; one must do some sort of searching to find it. So here's the setup. 5x + 2y + 0.1z = 100 x + y + z = 100 Let's convert this to: 50x + 20y + z = 1000 x + y + z = 100 let eq 1 = eq 1 - eq 2 -> 49x + 19y = 900 So, x = (900 - 19y)/49 y is a free parameter. x = (900 - 19y)/49 y = y z = 100 - x - z = 100 - (900 - 19y)/49 - y So, now, iterate through values of y until all x, y, and z (as a function of y as defined above) is a non-negative integer. This happens when y = 19, therefore x = 11 and z = 70.

OpenStudy (queelius):

Btw, I just made a simple Python script to iterate through a bunch of values for y and plugging those values into the equations to see that all of them are non-negative integers. There was only one valid solution, as already given: x = 11, y = 19, z = 70

OpenStudy (queelius):

Btw, this question is just a slight dip into Operations Research, which was basically invented during WW2 to help solve logistic problems and other sorts of decision problems.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!