2

So, let's say we have $n = 16$ elements, $e_i,\; i = 1, 2, ..., n\;$. Each element can have any value of the set $S = \{0, 1, 2, ..., 255\}$ (for example), independently of the other elements. We compute the average as $m = \sum e_i/ n$.

My question is: in how many different ways, $N(n, S, m)$, you can combine the different $k$ values of the $S$ set between the $n$ elements so that they give a specific average $m$?.

For example, with $n = 16$, $S = \{0, 1, 2, ..., 255\}$ (so $k = 256$) and $m = 0$, it should yield $N(n, S, m) = 1$ since there's only one possible way to have that average, and it is when $\{e_1 = 0, e_2 = 0, ..., e_{16} = 0\}$. The same can be said if $m = 255$, since only the configuration $\{e_1 = 255, e_2 = 255, ..., e_{16} = 255\}$ could yield that average, so $N(n, S, m) = 1$ again.

It is clear that for $m = 1/16$ we have $N(n, S, m) = n$ since we can get that average only by these different configurations $\{e_1 = 1, e_2 = 0, ..., e_{16} = 0\}, \{e_1 = 0, e_2 = 1, ..., e_{16} = 0\}, ..., \{e_1 = 0, e_2 = 0, ..., e_{16} = 1\}$.

But besides these examples the problem of finding $N$ for an arbitrary $m$ becomes incredibly complicated (at least for me). Just trying the case for $m = 1/8$, means we can have $16 = n$ different cases where one of the elements has a value of $2$ and the other are $0$, plus $120 = n(n-1)/2$ different cases where two different elements have a value of $1$ and the rest is $0$, so $N(n, S, m) = n+n(n-1)/2 = 136$. But what about $m = 3/16$ or larger? $m = 128$ for example?

My guess is that this has to do with understanding the "Stars and Bars theorems", since the problem can be stated as having a number $M = m\cdot n = \sum e_i$ by combining different summing integers $e_i$. The problem, is how can I limit the result with the set of values $S$, these elements can have?

Swike
  • 261
  • The "specific $m$ that the elements give" in your examples $m=1$ and $m=2$ isn't the average of the elements but their sum. – Wolfgang Kais Aug 07 '20 at 21:59
  • If $m$ denotes the sum of the elements, then for $m \le k$ there is no "complicating restriction" caused by $k$ and the desired number is indeed "stars and bars": $$m \le k \Rightarrow N(n, k, m) = N(n, m, m) = \binom{m+n-1}{n-1}$$ – Wolfgang Kais Aug 07 '20 at 22:20
  • @WolfgangKais Aaaah sorry, I wrote it wrong. I'm so sorry. I edited it now. When I said $m= 1$ I wanted to say $m =1/16$ and for $m = 2$ I was trying to say $m =2/16$ – Swike Aug 08 '20 at 11:33
  • @WolfgangKais It can't be "stars and bars" alone since then it begs the question: Where does the information about the elements having at most the value $255$ playing any role? Remember also that $k$ is not a number but a set of numbers that each of the $n$ elements can take, so I don't see the meaning of $m \leq k$ – Swike Aug 08 '20 at 11:38
  • You "don't see the meaning"? Well then, good luck. – Wolfgang Kais Aug 08 '20 at 11:54
  • @WolfgangKais English is not my native language, I'm sorry if this offended you, but I would like your opinion on what the answer really is considering $m$ is, as I said, a number and $k$ is a set of integers. – Swike Aug 08 '20 at 15:06
  • See https://math.stackexchange.com/questions/98065/how-many-ways-can-b-balls-be-distributed-in-c-containers-with-no-more-than -- multiple solutions are given. Any of those solutions can easily be adapted to the case where the individual numbers are drawn from a set of consecutive integers starting at a non-zero value, or even an arbitrary arithmetic sequence. For less regular input I think the solution with recursion is probably best. – David K Aug 08 '20 at 15:48
  • Note that in problems like this we usually use $k$ to denote an integer. You can define it as a set, but then everyone who looks at your question has to keep remembering that it is not just a single integer, and you're asking everyone to think too hard about something that really is no use to you. A capital letter $S$ for a set would make the question easier to answer. – David K Aug 08 '20 at 15:52

0 Answers0