Is there an equation that will solve this math problem?

2007-11-26 4:18 pm
You have $100. You have to buy 100 pairs of shoes and spend all your money. Shoes are priced 50 cents, $5 and $10 a pair. How many pairs of each do you need to get? (This is not a trick question. I know the answer but I can't prove it mathematically)

回答 (4)

2007-11-26 4:28 pm
✔ 最佳答案
x = pairs at 50 cents, y = prs at $5 and z = prs at $10

x + y + z = 100
.5x + 5y + 10z = 100---> multiply by 2---> x + 10y + 20z = 200

then subtracting the first equation from the second
x + 10y + 20z = 200
-x - y - z = -100

9y + 19z = 100
9y = 100 - 19z
y = (100 - 19z)/9

only for z = 1 do you get a whole number answer for y. For any other z values you will get fractions or negatives. Thus, since you cannot buy a part of a pair, then z must equal 1.
Which makes y = 9
and x = 90
2007-11-27 1:03 am
There are 3 unknowns say 2x shoes at 50 cents, y at $5 and z at $10 and 3 conditions

1) x < 50, y < 20 and z < 10

2) 2x + y + z = 100 (number of shoes)

3) x + 5y + 10z = 100 ( the money to spend -- use 2x to remove the cents or half-dollars)

write 2) as y = (100 - 2x) - z

write 3) as y = (100 - x) / 5 - 2z

Subtract 3) from 2) to get

5z = 9x - 400

so 9x - 400 is > 0 and is a multiple of 5
so x > 44.444... and x < 50 and a multiple of 5 i.e. x = 45
etc.

Hope this helps
2007-11-27 12:31 am
using algebra ...
number of 50cents shoes = x , $5 =y $10 =z

we obtain relations
0.5x+5y+10z = 100
x+y+z=100

to solve for x y z mathermatically, we require one more relation involving x y and/or z, otherwise not solvable

and i cant figure a way to find hat extra relation... Sorry
參考: OSrry myself
2007-11-27 12:30 am
This is called an integer programming problem. It is part of linear algebra.

Set up the problem so that

.50 s + 5 t + 10 u = $100
s + t + u = 100
s, t, u >= 0
s, t, u <= 100
s, t, u: integers

If you don't have software to solve this, it takes a bit of trial and error because with the first two equations you still have 3 unknowns but only two equations. the last 3 lines of the setup are the constraints you need to work with. You can see that your solution space for each of the variables is in the range [0,100].

= = = =
edit:
Linda has a very clever way of working with the constraints. Good answer!


收錄日期: 2021-05-03 14:21:01
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20071126081812AAIlwAo

檢視 Wayback Machine 備份