CLICK HERE FOR BLOGGER TEMPLATES AND MYSPACE LAYOUTS

Example Of Diophantine Equation

A grocer sells a 1-gallon container milk for 79 cents and a ½ gallon container of milk for 41 cents. At the end of day he sold $63.58 worth of milk. How many 1 gallon and ½ gallon container that he sell?
Let assume x as 1 gallon container and y as ½ gallon container.
79x + 41 = 6358
So,we need to find the gcd (79,41).Using Euclidean Algorithm,the calculation are as follow:
79 = 1 x 41 + 38
41 = 1 x 38 + 3
38 = 12 x 3 +2
3 = 1 x 2 + 1
2 = 2 x 1+ 0
So,the gcd (79,41) is 1
Since gcd (79,41) =1 and 1 6358 ,so the equation 79x + 41x =6358 has a solution.
To obtain 1 as linear combination of 79 and 41,we work back through the calculation as follow:

1 = 3 - 1(2)
= 3 - 1(38 – 12(3))
= -1(38) + 13(3)
= -1(38) + 13(41 – 1(38))
= -14(38) + 13(41)
= -14(79 – 1(41)) + 13(41)
= -14(79) + 27(41)
Upon multiplying the calculation by 6358,(because 6358 x 1=6358),so we get
6358 = -89012 (79) + 171666 (41)
Thus,we get Xo = -89012 and Yo = 171666 is the solution for 79x + 41y = 6358
All other solution are,

x = -89012 + 41t ≥ 0
41t ≥ 89012
t ≥ 2171

y = 171666 – 79t ≥ 0
- 79t ≥ - 171666
t ≤ 2173

Thus,we can take 2172 as t and put in into the equation,

x = -89012 + 41(2172) =40
y=171666 - 79(2172) =78
Thus,we get x = 40 and y = 78,
means 40 containers for 1 gallon milk and 78 containers of ½ gallon milk sold for $63.58.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS
Read Comments

0 comments: