1

Given a multiset (set that allows duplicates) $S$ of random integers in a range, and a subset $T \subseteq S$, what is the probability distribution of the sum of $T$? More formally:

Given $A,C \in \mathbb{Z}^+$ construct $S$ using the following algorithm:

  1. Start with $S=\emptyset$
  2. Pick random $x \in [1,A]$
  3. Add $x$ to $S$
  4. If $|S| < C$ then go back to 2, otherwise output $S$

So $$S=\left\{x : x \in [1, A] \right\}$$

And let $$B = \sum_{x \in S}x$$

Fix some $k \in [1,C]$. What is

$$P = \text{Pr}\left[ \sum_{y \in T}y = a, a \in [1,B], T \subseteq S \mid |T|=k \right]$$

I'm not sure if my notation is correct here but what I want is the probability of the sum of a subset equaling some random number, given a fixed size of the subset. I want the pdf as a function of $a$ & $k$, something like $P(a,k)=...$


There are some edge cases that are easy to compute:

$$ \begin{align} T=S \implies & P=0 \text{ unless } a=B \\ |T|=1 \implies & P=\frac{1}{A} \space \forall a \in [1,A] \text{ and } P=0 \space \forall a > A \\ a=B \implies & P=1 \text{ if } T=S \text{ and } P=0 \text{ otherwise} \\ a=1 \implies & P=1 \text{ if } |T|=1 \text{ and } P=0 \text{ otherwise} \end{align} $$


From here I thought about looking at specific sizes of $T$ and counting. Example, consider the case where $|T|=2$. We have the equation $$x_1+x_2=a$$

  • if $a=1$ then there are no possible ways to satisfy the equation because $x_i \ge 1$
  • if $a=2$ then there is exactly 1 way to satisfy the equation: $x_1=x_2=1$
  • if $a=3$ then there are 2 ways: $(x_1=1 \wedge x_2=2) \vee (x_1=2 \wedge x_2=1)$
  • if $a=n$ where $n \in [2,A+1]$ then there are $n-1$ ways
  • if $a=A+n$ where $n \in [2,A]$ then there are $A-n+1$ ways
  • if $a \gt 2A$ then there are no ways

We can add up the total number of ways: $$ \begin{align} & \sum_{n=2}^{A+1} (n-1) + \sum_{n=2}^A (A+n-1) = A(2A-1) \end{align} $$

and then get probabilities:

$$ \begin{align} P(a,2)= \begin{cases} \frac{a}{A(2A-1)} &: a \in [2,A+1] \\ \frac{A-a+1}{A(2A-1)} &: a \in [A+2, 2A] \\ 0 &: \text{otherwise} \end{cases} \end{align} $$

But this doesn't seem entirely correct because what if $B<2A$? The values $B$ and $C$ have not been taken into account and I'm not sure how to do this.

Stent
  • 145
  • After doing some counting for $|T|=2$ and trying to find $P_1$ it seems that this problem is similar to statistical mechanics, specifically the method which Boltzmann used to calculate entropy. – Stent Jul 06 '23 at 16:41
  • How is $S$ selected? A given number of elements of ${1,2,3,\ldots,A}$? Or each one independently with probability $\frac12$? Or something else? Is $B$ decided before or after $S$ is selected? Similarly, how is $T$ selected from $S$? – Henry Jul 06 '23 at 16:43
  • @Stent Possible positions of the electron or particle in a box, there can be cases labelled and unlebelled. Independent or Dependent, Such question may arise. – Safal Das Biswas Jul 06 '23 at 17:24
  • Probably, I think , You mean If, the weight Of $S$ is $r$. Then all positive integer form $1$ to $r$ is there in $S$. We need to find the probability, $A_1+.... +A_k\leq m$ for all positive integer $k\leq m$ and $k=1, 2, 3, .., m$ for each integer $A_i$. Then the problem is simple Star and bars combinatorics problem with some fixing of $k$, where, $m=1, ..., r$ – Safal Das Biswas Jul 06 '23 at 17:34
  • @Henry every element of $S$ is randomly chosen with equal probability. One can construct it using this algorithm (starting with $\emptyset$): 1. pick random $x \in [1,A]$ and 2. add this to $S$ 3. if you have reached desired size then stop otherwise go back to 1 – Stent Jul 07 '23 at 08:54
  • @Henry $T$ is a random subset of random size – Stent Jul 07 '23 at 09:18
  • I edited the description in an attempt to make it more clear – Stent Jul 07 '23 at 12:34
  • Here is the question asked in a better way and with a solid answer: https://math.stackexchange.com/questions/4739890/probability-of-finding-a-solution-to-variation-of-subset-sum-problem-with-posit – Stent Jul 24 '23 at 20:58

0 Answers0