A small loaf sells for $25, and a large loaf sells for $35. The total amount of money raised is $1065. What is the minimum number of loafs sold? What is the maximum number of loafs sold?
Let x be the number of small loaves sold and let y be the number of large loaves sold
25x+ 35y= 1065. Simplify by dividing through by 5:
5x+ 7y= 213
Since x and y are numbers of things sold, they must be non-negative integers. This is a "Diophantine equation".
Start by looking at 5x+ 7y= 1, 5 divides into 7 once with remainder 2: 7- 5= 2. 2 divides into 5 twice with remainder 1: 5- 2(2)= 1. 5- 2(7- 5)= 3(5)- 2(7)= 1. Now multiply by 213: 639(5)- 426(7)= 213.
One solution to 5x+ 7y= 213 is x= 639, y= -426. That is not a valid answer because y is negative.
But x= 639- 7n and y= -426+ 5n is also a solution for any n because 5(639- 7n)+ 7(-426+ 5n)= (639(5)- 425(7))+ (-35n+ 35n)= 213.
In order that y be non-negative, n must be at least 426/5= 85.2 so take n= 86.
x= 639- 7(86)= 639- 602= 37 and y= -426+ 5(86)= -426+ 430= 4.
There could have been 37 small loaves and 4 large loaves sold, a total of 41 loaves: 25(37)+ 35(4)= 925+ 140= $1065.
In order that x be non-negative, n must be less than 639/7= 91.28... so take n= 91.
x= 639- 7(91)= 639- 637= 2 and y= -426+ 5(91)= -426+ 455= 29.
There could have been 2 small loaves and 29 large loaves, a total of 31 loaves; 25(2)+ 35(29)= 50+ 1015= $1065.
The least number of loaves sold 31, 2 small and 29 large loaves. the most that could have been sold was 41, 37 small and 4 large loaves.