0
$\begingroup$

I was trying to evaluate a sum of the form $$\sum_{\{x_1,x_2,\ldots,x_{n}\}}f(x_1,x_2,\ldots,x_{n}),$$ where $\{x_1,x_2,\ldots,x_{n}\}$ are solutions of a system of linear equations and inequalities of the form, say, $$x_1+x_2+\cdots+x_{15}=4,x_7+x_9+x_{19}+x_{20}=4,\cdots,0\leq x_i\leq4.$$ I used "Solve" to generate the list of all solutions of the linear equations and then substitute them into the sum. This works to about $n=29$, but for larger $n$ the RAM space runs out just to store the solution list of the linear equations. Now I need to solve the problem for $n=31$, is there a way to circumvent the RAM issue? For example is there a way to generate the solutions on the fly and use them in the sum, and when a solution has been used it will be immediately dumped from memory?

$\endgroup$
  • 1
    $\begingroup$ If the system is linear, perhaps you could write down the general solution for arbitrary $n$. Any chance you could include these equations here? $\endgroup$ – AccidentalFourierTransform Dec 5 '18 at 2:05
  • 1
    $\begingroup$ Perhaps, you could use two of the linear equations to eliminate two of the unknowns, thereby reducing the system to 29 equations and 29 unknowns. In any case, readers cannot help you without seeing a sample problem, say with n = 10. $\endgroup$ – bbgodfrey Dec 5 '18 at 5:02
  • $\begingroup$ What is the function $f$? Any chance to exploit symmetries? $\endgroup$ – Henrik Schumacher Dec 5 '18 at 9:56
  • $\begingroup$ @HenrikSchumacher, yes, actually for a good mathematical reason there is for sure a symmetry that would reduce the number of sums to a RAM-manageable expression, but it is difficult to find that symmetry in terms of the variables I'm using. I'm thinking along this line, but it wouldn't be an appropriate question for this site. $\endgroup$ – Jia Yiyang Dec 6 '18 at 1:53
  • $\begingroup$ @bbgodfrey, it's a good advice, I'll try it out. Thanks. $\endgroup$ – Jia Yiyang Dec 6 '18 at 2:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.