6

Jokingly, this is a question I have always wondered about:

  • Suppose I post a question on Math Stackexchange: my current score is $0$
  • If someone wants to vote on my question, they can either vote to give a score of $+ 10$ or a score of $-2$
  • Suppose there are $N$ members in the Math Stackexchange community (for the sake of this problem, lets assume it stays constant throughout this problem, i.e. no new members can join and no existing members can leave)
  • Suppose each member can only vote once.
  • Members also have the ability not to vote (i.e. $+0$)
  • After some time, I check back on my question and my question now has a score of $Z$ : $Z$ is a whole number ($Z$ can be positive or negative) that is divisible by $2$

My Question: How many ways could my question have been upvoted?

For example, suppose my friend checks my Math Stackexchange account and only tells me that my question resulted in a net vote of +10 (without telling me more details as to how many people upvoted and downvoted). Scenario 1: Perhaps one person voted +10. Scenario 2: Perhaps five people each voted - 2 and two people each voted + 10. Scenario 3: Perhaps ten people each voted -2 and three people each voted + 10. etc, etc. At first glance, there seems that there can be so many combinations which resulted in a net vote of +10 !

Here is what I tried so far:

Part 1: I thought I could use the idea of the Power Set. That is, I could break all $N$ members into different combinations (i.e. subsets) of "voting" and "non-voting" members.

For example, given $2^N$, for $i$ = 1 to $N$:

  • Subset 1 ($W_1$): When $i$ = 1, Voting Members = 1 and Non Voting Members = $2^N$ - $1$
  • Subset 2 ($W_2$): When $i$ = 2, Voting Members = 2 and Non Voting Members = $2^N$ - $2$
  • Subset 3 ($W_3$): When $i$ = 3, Voting Members = 3 and Non Voting Members = $2^N$ - $3$
  • etc.

Part 2: Then, for each subset of Voting Members, we have to identify if each Subset of Voting Members can sum to $Z$. It is possible that some of the Voting Members subsets can not sum to $Z$ - these subsets have to removed. To check if a subset can add to $Z$, I think the following set of equations has to be solved for each subset:

In a given Voting Members subset $W_i$, let $x_i$ be the number of times $-2$ is picked and $y_i$ be the number of times $10$ is picked. Suppose we take some subset of Voting Members $W_i$ and there are $W_j$ members in this subset. Then:

$$W_j = x_i + y_i$$ $$ x_i * (-2) + y_i * (10) = Z $$

For a given subset of voting members $W_i$, I suppose the above equations could be solved to determine if it can sum to $Z$ or not. In the case where it can not sum to $Z$, this subset will have to be removed.

Part 3: Then, based on my very limited knowledge of combinatorics, I think some generating function (Number of ways to write n as a sum of k nonnegative integers, The number of ways to get N as the sum of R elements with constraints, In how many different from a set of numbers can a fixed sum be achieved?) would need to defined to see that within each "admissible" (i.e. not deleted in Part 2) voting members subset, how many ways can the members pick combinations of $+10$ and $-2$ such that they add to $W$.

Thus, for a subset of voting members $w_i$ with $w_j$ member, I think the generating function for this problem might be:

$$ f(a) = (a^{-2} + a^{10})^{w_j} $$

And now for each subset, I would have to evaluate this expression and find out the coefficients of the terms where the exponents sums to $w_j$. But I am not sure if this is correct.

I am afraid that I have overcomplicated the question - could someone please help me understand an easier way to answer this question? Also the approach I am thinking about would require solving the equations in Part 2 for each subset, making it impossible to answer this question in general.

Thanks!

stats_noob
  • 3,112
  • 4
  • 10
  • 36
  • 2
    Depends on whether you count the $N$ voters as distinct or not. The generating function approach in the case when they are distinct is is to consider $\left(1+x^{-2}+x^{10}\right)^N,$ and you are seeking the coefficient of $x^{Z}.$ To get rid of the negative coefficients, you are seeking the coefficient of $x^{Z+2N}$ in $\left(1+x^2+x^{12}\right)^N.$ – Thomas Andrews Nov 23 '23 at 19:29
  • "members also have the ability not to vote" , how is this meant ? Noone is forced to vote a post. – Peter Nov 23 '23 at 19:30
  • 1
    @ Peter: thank you for your reply! This is exactly what I meant : "No one is forced to vote". I just wanted to re-iterate this point. I did NOT want to model this problem in a way where members are either forced to upvote (+10) or downvote (-2). In reality, members have the choice to "not vote" (i.e. +0). While this is obvious, I just wanted to restate this point (in case someone reads this post in the future and is not familiar with this voting system). Thanks! – stats_noob Nov 23 '23 at 19:34
  • If the members are not distinct, then you are seeking the number of solutions to $10a-2b=Z$ with $a,b$ non-negative and $a+b\leq N.$ – Thomas Andrews Nov 23 '23 at 19:34
  • 1
    @ Thomas Andrews: thank you so much for your reply! In the generating function that you wrote, is the +1 corresponding to X^0? i.e. members who do not vote? – stats_noob Nov 23 '23 at 19:35
  • Yes. $1=x^{0}$ corresponds to the non-voters. – Thomas Andrews Nov 23 '23 at 19:36
  • @ Thomas Andrews: so this style of generating function would include voting and non-voting members together? – stats_noob Nov 23 '23 at 19:39
  • @ Tyma Gaidash: thank you for your reply! Can you please explain your logic? How do you think voting theory might be applicable here? Thanks! – stats_noob Nov 24 '23 at 01:32
  • @ Thomas Andrews: If you have time later next week, could you please show me how I might be able to answer this question? Thank you so much! – stats_noob Nov 24 '23 at 04:49

1 Answers1

4

The minimum number of votes that can have occurred with a score of $Z$ is given by $$M_Z = \begin{cases}-\frac Z2&Z \le 0\\6\left\lceil \frac Z{10}\right\rceil - \frac Z2&Z > 0\end{cases}$$

For $Z\le 0$, this is obvious, while for $Z > 0$, there must be at least $\left\lceil \frac Z{10}\right\rceil$ positive votes to get a total $\ge Z$, and $\left(10\left\lceil \frac Z{10}\right\rceil - Z\right)/2$ negative votes to get back down to $Z$.

Subtract these votes out from your total, and the remaining excess votes have to sum to $0$. Thus for every positive vote, there have to be five negative votes, and vice versa. So the total number of excess votes must be divisible by $6$, and any multiple of $6$ which is $\ge 0$ and $\le N-M_Z$ is possible. Thus the number different ways you can get a result of $Z$ is $$\left\lfloor\frac{N - M_Z}6\right\rfloor+1$$

Paul Sinclair
  • 43,643
  • Thank you so much for your answer! If you have time, could you please write an example of how to use this formula with actual numbers? E.g. suppose there are 100 members and my question has a total vote 20. How many ways could this of happened? Thank you so much! – stats_noob Nov 29 '23 at 15:33
  • No wonder you would have questions about that. I made a mistake in my calculation of the minimal vote count $M_Z$ (now corrected). After getting $\lceil Z/10\rceil$ positive votes (not counting the negatives yet), your score would be $10 \lceil Z/10\rceil$ not just $\lceil Z/10\rceil$ as I had originally. Subtract the actual score from this "positive-only" score, and divide by $2$ to get the "negative-only" score. For $Z=20, M_Z = 2$. and the total number of ways to get $20$ with $N = 100$ members is $$\lfloor\frac{100 - 2}6\rfloor + 1 = 16 + 1 = 17$$ ways. – Paul Sinclair Nov 29 '23 at 16:05
  • Those ways are $P2, P3N5, P4N10, \dots, P18N80$. – Paul Sinclair Nov 29 '23 at 16:11
  • That first comment from me should have said "Subtract the actual score from this positive-only score to get the negative-only score, and divide by 2 to get the negative vote count." – Paul Sinclair Nov 29 '23 at 16:23