My son is in third grade and came home with a math word problem the other day.
The basic problem said something like
"Ted has $6.00 to spend. How many combinations can he buy if
Ice pops: $.40
We answered it by trial and error, but I was thinking there must be a way to solve this to find all the possible result sets.
I know how to solve systems of equations but in this case it would only be one equation
40x + 25y + 30z = 600
Any ideas how to solve this for all possible (interger) result sets? My algebra is rusty, it's been a while since I've been in grade school.
I'm working on it myself now in perl, but wanted to see what everyone else came up with.