7
$\begingroup$

I finally managed to learn a bit of number theory and Diophantine equation(with the help of Arturo Magidin's great answer in what type of math is this?). But I'm wondering what's the next step after?

How do you take all the results and figure out which one is correct? If I use a small sum and very specific numbers then I may only get a handful of results but as my numbers and variables get bigger I get many many results(I stop my computer after a million). I'm new to math to I thought I'd ask the community here what are the approaches to this step now?

I've been thinking and, correct me if I'm wrong, but this is probably a probability question now since every answer is technically correct. I know the correct answer is somewhere in the millions of results I get, but I'm trying to at least narrow it down.

Do I use a computer program to study each result against parameters I set(i.e. no result can change more than 5% and only 2 colors can be chosen at a time), or is there a mathematical way of solving it?

Thanks in advance! (sorry if I'm wording this question incorrectly..I'm not 100% sure the name of what I am searching for)

Here's some more information to clear it up more. For example I have the following:

color  value   quantity red       20    2 blue    5   8 green   10  2  total       100 

If only the value and the total is given, I will find there is 36 possible answers:

#1 Found : 20.0*0.0 red + 5.0*0.0 blue + 10.0*10.0 green = 100.0 #2 Found : 20.0*0.0 red + 5.0*2.0 blue + 10.0*9.0 green = 100.0 #3 Found : 20.0*0.0 red + 5.0*4.0 blue + 10.0*8.0 green = 100.0 #4 Found : 20.0*0.0 red + 5.0*6.0 blue + 10.0*7.0 green = 100.0 #5 Found : 20.0*0.0 red + 5.0*8.0 blue + 10.0*6.0 green = 100.0 #6 Found : 20.0*0.0 red + 5.0*10.0 blue + 10.0*5.0 green = 100.0 #7 Found : 20.0*0.0 red + 5.0*12.0 blue + 10.0*4.0 green = 100.0 #8 Found : 20.0*0.0 red + 5.0*14.0 blue + 10.0*3.0 green = 100.0 #9 Found : 20.0*0.0 red + 5.0*16.0 blue + 10.0*2.0 green = 100.0 #10 Found : 20.0*0.0 red + 5.0*18.0 blue + 10.0*1.0 green = 100.0 #11 Found : 20.0*0.0 red + 5.0*20.0 blue + 10.0*0.0 green = 100.0 #12 Found : 20.0*1.0 red + 5.0*0.0 blue + 10.0*8.0 green = 100.0 #13 Found : 20.0*1.0 red + 5.0*2.0 blue + 10.0*7.0 green = 100.0 #14 Found : 20.0*1.0 red + 5.0*4.0 blue + 10.0*6.0 green = 100.0 #15 Found : 20.0*1.0 red + 5.0*6.0 blue + 10.0*5.0 green = 100.0 #16 Found : 20.0*1.0 red + 5.0*8.0 blue + 10.0*4.0 green = 100.0 #17 Found : 20.0*1.0 red + 5.0*10.0 blue + 10.0*3.0 green = 100.0 #18 Found : 20.0*1.0 red + 5.0*12.0 blue + 10.0*2.0 green = 100.0 #19 Found : 20.0*1.0 red + 5.0*14.0 blue + 10.0*1.0 green = 100.0 #20 Found : 20.0*1.0 red + 5.0*16.0 blue + 10.0*0.0 green = 100.0 #21 Found : 20.0*2.0 red + 5.0*0.0 blue + 10.0*6.0 green = 100.0 #22 Found : 20.0*2.0 red + 5.0*2.0 blue + 10.0*5.0 green = 100.0 #23 Found : 20.0*2.0 red + 5.0*4.0 blue + 10.0*4.0 green = 100.0 #24 Found : 20.0*2.0 red + 5.0*6.0 blue + 10.0*3.0 green = 100.0 #25 Found : 20.0*2.0 red + 5.0*8.0 blue + 10.0*2.0 green = 100.0 #26 Found : 20.0*2.0 red + 5.0*10.0 blue + 10.0*1.0 green = 100.0 #27 Found : 20.0*2.0 red + 5.0*12.0 blue + 10.0*0.0 green = 100.0 #28 Found : 20.0*3.0 red + 5.0*0.0 blue + 10.0*4.0 green = 100.0 #29 Found : 20.0*3.0 red + 5.0*2.0 blue + 10.0*3.0 green = 100.0 #30 Found : 20.0*3.0 red + 5.0*4.0 blue + 10.0*2.0 green = 100.0 #31 Found : 20.0*3.0 red + 5.0*6.0 blue + 10.0*1.0 green = 100.0 #32 Found : 20.0*3.0 red + 5.0*8.0 blue + 10.0*0.0 green = 100.0 #33 Found : 20.0*4.0 red + 5.0*0.0 blue + 10.0*2.0 green = 100.0 #34 Found : 20.0*4.0 red + 5.0*2.0 blue + 10.0*1.0 green = 100.0 #35 Found : 20.0*4.0 red + 5.0*4.0 blue + 10.0*0.0 green = 100.0 #36 Found : 20.0*5.0 red + 5.0*0.0 blue + 10.0*0.0 green = 100.0 

As you can see, in the possibilities I get the correct answer but many other answers also. Now say I add one more red(so the total red is 3) then I now have 49 results, but some of the results in second set are not likely if you factor in the relationship with the first result set. I assume as I get more data results, I can more accurately remove the results that don't work. I'm not sure if there's a branch of math that deals with this?

Update: Is this probability? fitness(or cost) functions? mathematical optimization? or is this even a math problem?

  • 0
    I've read your other questions and I think you're requiring that solutions be positive integers. Generally, if a system is solvable and negative integers are allowed there are an infinite number of solutions, however your restriction means you can only shuffle the calories around so much. So you should be able to compute all of the solutions (this could be quite large!) and all of them are allowable. If this was posed as a guessing game then I suppose the probability of guessing the correct numbers out of a pool is one over n, with n=solutions i.e. n_1 = {x1,x2,x3,...}. My thoughts.2011-06-06
  • 0
    Thanks Tony! Your 100% correct, my problem is now that the results are very large(some of the tests I am running is over 1000 variables), and I'm trying to figure out how to narrow it down. Even with the sum changings and values changing within intervals, there must be a way to figure out which ones are most likely true. For example, if calories change by 5 then all the values that changed to 10 from the previous answer should not be allowed..for example 5x + 10y +20z = 25 would give me all results possible but if the next interval the values changed to 5x + 10y + 25z =252011-06-07
  • 0
    then some of the previous answers could be eliminated from the last interval. I'm not sure if its a math problem or a computer problem in studying these relationships..I am working on doing some reading on bayes probability theorem, but i'm not sure.2011-06-07
  • 0
    I'm going to steer you away from probability because the question I think you are asking really depends on the specific diophantine equation(s) in question, that is how the coefficients and total are related by division and common factors. Generally, a diophantine equation has a solution in the integers when the greatest common divisor of the coefficients divides the total. It might be helpful to edit your question to refine what exactly you want answered.2011-06-07
  • 0
    In your example it's useful to note relationships like, "y is worth twice as much as x", so any solution yields another solution where y is incremented by one and x is decremented by two. In that case you can fix z=0 and look the number of ways 5 and 10 can form 25. Equivalently, how 1 and 2 can form 5.2011-06-07
  • 0
    Thanks Tony.I updated the question to include the results and a bit more info. I'm not even sure this is a pure math problem, but I suspect I'm not the only one who's had a large number of results from a Diophantine equation, I hope there's a way to get the results down to something more manageable(although I don't think Diophantine was crunching these numbers on a cluster set of servers :-)2011-06-07
  • 0
    In your example, unless you put more restrictions on your quantities, there is no way to determine which of the 36 possibilities is the distinguished one you were looking for, since they are all valid solutions to the (Diophantine) equation you formed.2011-06-07
  • 0
    I can tweak the restrictions(such as no more then 5% total change of quantities or something), but I'm not sure what branch of math this is..I thought I can use a program to remove all the ones that didn't match(between the above example, 36 results versus 49 means I could probably remove 13 and so on as I get more data, but I'm really at a loss of what to study to learn how to apply this relationship mathematically.2011-06-07
  • 0
    Been searching and is what I am looking for called a fitness function?2011-06-07

1 Answers 1

1

I can't understand what you want, so I'll post a simple example and maybe you can clarify. Suppose reds are worth 7, blues are worth 12, and the total value is to be 67. Then there's only one solution: 1 red, and 5 blue. Now change that 67 to 68, and there's still only one solution, and it's 8 red, and 1 blue. So both the number of reds and the number of blues have changed dramatically, which seems to be something you wish to avoid - but you can't avoid it, it's inescapable for this problem.

My guess is that in any setting one can come up with some numbers where small changes in total value force large changes in quantities.

  • 0
    Thanks Gerry. Your correct in what I am trying to do, but one having only one result is easy there's no question on if its the best answer but what I'm asking is how to decide which one is "most" correct when studying multiple data sets. I thought there maybe a mathematical solution(I am not good with math but I thought it was a probability type question), but now I am not sure. A programmer suggested this is genetric algo problem and I have to use some type of fitness test. I'm still not convinced because I keep thinking of my studies of covarience and bayesian probability.2011-06-07
  • 0
    @Lostsoul, I think you're missing the point. If the value is to be 84, there are two solutions: 12 red, 0 blue, and 0 red, 7 blue. Which one is "the best"? If you change the value to 85, you're back to one solution, 7 red and 3 blue, and it's very far from both the 84-solutions. If "most correct" means "most stable under small changes to total value," I'm afraid you're asking for trouble. Diophantine equations are inherently unstable with respect to small changes in the underlying data.2011-06-07
  • 0
    Thanks Gerry..I understand what your saying and totally agree with you on the Diophantine equation, which is why I was thinking I had to use the Diophantine equation to generate the data and some other form of mathematics to study the relationships between the results and asses the best one. I found a non-math solution(of rating each answer based on previous answers and then only accepting answers with certain ratings). I understanding there will probably never be a "most correct" answer but I'm still trying to figure out how to narrow it down.2011-06-07
  • 0
    @Lostsoul, good luck. Here's an experiment you might try. Consider the equation $23x+29y=10000$. This has plenty of solutions in positive integers $x,y$, spaced out uniformly on a line. Now look at $23x+29y=10001$. This also has lots of solutions, spaced out uniformly, and fairly distant from the solutions of the 10000 equation - they won't help you at all to pick out a solution of that first equation. Then look at $23x+29y=10002$, and $23x+29y=10003$, and $23x+29y=10004$. You'll find the same thing happening, but, really, do the experiment and see for yourself what you're up against.2011-06-08
  • 0
    I understand that to narrow the results down there will have to be massive event, but doesn't that only apply if we're using Diophantine equation to solve the resulted data set(or doing it manually)? I know the Diophantine equation can generate the date, but I thought there might be something else we can use to analyze the results themselves. Right now mathematically I'm leaning towards probability and in CS I'm thinking of genetic algorithms, but this site has surprised me in the past with approaches I never thought of so I'm keeping my fingers crossed there is something out there2011-06-08
  • 0
    "To narrow the results down" you need some criterion for judging one result better than another. The only criterion you have mentioned, insofar as I can understand it, is you want a result that doesn't change too much when you make small changes in the input. I have tried to convince you that that criterion is nonsense, as it cannot work. So the ball is back in your court, to find some other criterion by which one result can be judged better than another. No one can help you with this, because no one knows whether you think $(12,0)$ is better or worse than $(0,7)$, or why.2011-06-08
  • 0
    There are a few other factors I have that I'll use but I didn't think they were related to this, because I was going to use them before(to limit the universe of variables) and after(say for example; give me the results using only 30 variables,etc. As the variables and total will constantly be moving, I don't think I'll ever get a perfect answer I'm just hoping to get a "good enough". But I do agree, the more stable the numbers the less likely this will work, and will be very difficult.2011-06-08
  • 0
    Its hard to narrow it down when all answers are so correct..This is why I thought there might be some frameworks or best practices to help narrow the choices down.2011-06-08