comination

I am trying to write a code that would calculate the combinations between 18 and 30 numbers until it gives me the result that ai want.
0.18X + 0.12y +0.5 w=8
0.6 X + 0.13y +0.8 w =7 and so on
Instead of calculating an equation with 18 lines and 30 variables what if I try to make combinations with the values until I get the result I want?
Your question is rather a math question.
If the equations look like the example you gave, then you could possibly do that (well, in fact you can't, and you'll see why below).
But if the equations look like:

529835952x - 102934810y + 44449294w = 593925
-23545x - 995039y + 52380305w = 57279359
...

what range would you test for each variables ?

The other problem with what you propose is that even if you test only, say, 10 values per variables, it means you would have to test on average (10^32)/2 combinations, which is an astronomical number (a computer would take years, or more, to do it) !

Last but not least, a linear system of N equations with M variables, where N < M, has an infinite number of solutions, or none.

Take a look at http://en.wikipedia.org/wiki/System_of_linear_equations as an introduction to this topic.
Last edited on
Topic archived. No new replies allowed.