linear Diophantine equation

2008-02-12 7:07 pm
1. Solve the Diophantine equation 5x + 7y = 57
2.Mick has $5.63 worth of bananas and apples. Bananas are 13 cents each and
apples are 7 cents each. How many different combinations of apples and
bananas can he have and what are they?
*最好用Euler's method 黎計算,要比埋計算過程,唔該。

回答 (1)

2008-02-12 8:39 pm
✔ 最佳答案
1. Solve the Diophantine equation 5x + 7y = 57
First for 5x+7y=1
x=3,y=-2
So x=171 and y=-114 is a solution of 5x + 7y = 57
The general solution is
x=171-7t
y=-114+5t
where t is an integer
2.Mick has $5.63 worth of bananas and apples. Bananas are 13 cents each and
apples are 7 cents each. How many different combinations of apples and
bananas can he have and what are they?
Let he buys x apple and y banana
0.13x+0.07y=5.63
13x+7y=563
Because 13 and 7 is coprime, the equation has solution
when x=-1,y=2
13x+7y=1
So one solution of 13x+7y=563 is
x=-563,y=1126
The general solution is
x=-563+7t
y=1126-13t
We need x>=0, y>=0
So t>=80.43 , t<=86.615
The possible values of t are 81,82,...86
There are 6 different combinations of apples and bananas can he have
They are
x y
4 73
11 60
18 47
25 34
32 21
39 8




2008-02-12 12:40:33 補充:
I forget the Euler method but you at least can check the answer


收錄日期: 2021-04-28 14:16:47
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20080212000051KK00908

檢視 Wayback Machine 備份