Solving Constrained Sums of N Non-Negative Integers

  • Thread starter wdlang
  • Start date
  • Tags
    Sum
In summary, the average value of x_1^2 will be somewhere between 1 and N. It depends on what sort of distribution functions the x_k have.
  • #1
wdlang
307
0
suppose i have N non-negative integers x_1, x_2, ,,, x_N

the constraint is that their summation is N

now for all the configurations, i.e., all the realizations of x_1, x_2, ,,, x_N

i want to find out the average value of

\sum_i x_i^2

i guess is on the order of unity, i.e., O(1).

i am concerned with the large N limit
 
Last edited:
Physics news on Phys.org
  • #2
The average value will be somewhere between 1 and N. It depends on what sort of distribution functions the x_k have.
 
  • #3
First few numbers are (1, 10/3, 60/10).

It could be solved via a recurrence relation by defining M(k,n) as the number of way of summing to k with n terms and S(k,n) as the sum of x_i^2 over all possible ways, so we have

[tex]M(k,n) = M(k,n-1) + ... + M(0,n-1)[/tex]
[tex]S(k,n) = 0 + S(k,n-1) + 1*M(k-1,n-1) + S(k-1,n-1) + ... + k^2*M(0,n-1) + S(0,n-1)[/tex]

with M(k,1)=1, S(k,1)=k^2, e.g. M(2,2)=3, S(2,2)=10, though I don't know the general solution - perhaps generating functions would help?
 
  • #4
bpet said:
First few numbers are (1, 10/3, 60/10).

It could be solved via a recurrence relation by defining M(k,n) as the number of way of summing to k with n terms and S(k,n) as the sum of x_i^2 over all possible ways, so we have

[tex]M(k,n) = M(k,n-1) + ... + M(0,n-1)[/tex]
[tex]S(k,n) = 0 + S(k,n-1) + 1*M(k-1,n-1) + S(k-1,n-1) + ... + k^2*M(0,n-1) + S(0,n-1)[/tex]

with M(k,1)=1, S(k,1)=k^2, e.g. M(2,2)=3, S(2,2)=10, though I don't know the general solution - perhaps generating functions would help?

i can solve the problem already

it is actually simple

you just need to find the average value of x_1^2

then the average of the sum of the squares is N times of that

but the average of x_1^2 is simple to find, just a bit combination
 
  • #5
Oh I see, then it reduces to

[tex]E[x_1^2] = \frac{1*M(n-1,n-1) + 2^2*M(n-2,n-1) + ... + n^2*M(0,n-1)}{M(n,n-1)+...+M(0,n-1)}[/tex]

Did you find an expression for M(k,n)?
 
  • #6
bpet said:
Oh I see, then it reduces to

[tex]E[x_1^2] = \frac{1*M(n-1,n-1) + 2^2*M(n-2,n-1) + ... + n^2*M(0,n-1)}{M(n,n-1)+...+M(0,n-1)}[/tex]

Did you find an expression for M(k,n)?

it is simple

it is a standard result in combination theory
 
  • #7
Sorry you've lost me - can you post the details or a link to it please?
 
  • #8
bpet said:
Sorry you've lost me - can you post the details or a link to it please?

i bet you can find the expression of M in any combinational book
 
  • #9
wdlang said:
i bet you can find the expression of M in any combinational book

I don't have easy access to a library so that's not much help. Regardless, using generating functions M(k,n) would be the coefficient of x^k in (1+x+x^2+...)^n = 1/(1-x)^n, provided k<=n, and the kth derivative of this expression is (n+k-1)!/(n-1)!(1-x)^(n+k) so M(k,n)=n+k-1Cn-1 and of course M(0,n-1)+...+M(n,n-1)=M(n,n). Did you find a simple expression for 1^2*M(n-1,n-1)+...+n^2*M(0,n-1) ?
 
  • #10
bpet said:
I don't have easy access to a library so that's not much help. Regardless, using generating functions M(k,n) would be the coefficient of x^k in (1+x+x^2+...)^n = 1/(1-x)^n, provided k<=n, and the kth derivative of this expression is (n+k-1)!/(n-1)!(1-x)^(n+k) so M(k,n)=n+k-1Cn-1 and of course M(0,n-1)+...+M(n,n-1)=M(n,n). Did you find a simple expression for 1^2*M(n-1,n-1)+...+n^2*M(0,n-1) ?

you got it

i do not find a simple expression of that but i can prove it is convergent, that is what i want
 

1. What is a constrained sum of N non-negative integers?

A constrained sum of N non-negative integers is a mathematical problem where you are given a set of N numbers and asked to find a combination of those numbers that add up to a specific value, while also following certain constraints or rules.

2. What are some examples of constraints in a constrained sum problem?

Constraints in a constrained sum problem can include limits on the range of numbers that can be used, restrictions on the number of times a certain number can be used, or requirements for the sum to be divisible by a certain number. For example, a constrained sum problem could ask you to find a combination of numbers that add up to 20, using only numbers between 1 and 10, and where each number can only be used once.

3. How is a constrained sum of N non-negative integers solved?

A constrained sum problem can be solved using various mathematical techniques, such as dynamic programming, backtracking, or integer programming. The most efficient approach depends on the specific constraints and values involved in the problem.

4. What are some real-world applications of solving constrained sums of N non-negative integers?

Constrained sum problems are commonly used in various fields, such as computer science, operations research, and engineering, to optimize resource allocation and scheduling. For example, a company might use constrained sum techniques to determine the most cost-effective way to allocate their budget among different projects.

5. Are there any tools or software programs available to help solve constrained sum problems?

Yes, there are several software programs and libraries that have been developed specifically for solving constrained sum problems, such as Gurobi, CPLEX, and SCIP. These tools use advanced algorithms to efficiently find solutions to complex constrained sum problems.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
1K
Replies
2
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
12
Views
955
  • Set Theory, Logic, Probability, Statistics
Replies
27
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
8
Views
1K
Replies
3
Views
700
  • Programming and Computer Science
Replies
3
Views
842
Replies
24
Views
2K
Back
Top