3

This question already has an answer here:

I notice I got +3 reputations today for this question, the system tells me I get "+5" and "-2" on this question, but clearly this question has no upvotes or down votes. So why do I get "+3' reputations?

PS:Please don't up vote or down vote this question.

marked as duplicate by Aza, Josh Caswell, hims056, Aziz Shaikh, michaelb958--Reinstate Monica Mar 10 '14 at 6:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

15

If you got +3 with a score of 0, you got one upvote and one downvote. 5 - 2 == +3

Here's the vote counts (which you can see with the right privilege):

the question has an upvote and a downvote on it

But you don't need privilege to find the upvotes and downvotes if you know the score and rep. The relationship is represented as a two equations in two variables:

    upvotes -     downvotes = score
5 * upvotes - 2 * downvotes = rep

Which has this as a matrix representation:

| 1  -1 |    | upvotes   |     | score |
|       | *  |           |  =  |       |
| 5  -2 |    | downvotes |     |  rep  |

The matrix above is nonsingular and thus the linear system admits exactly one solution for any given combination of score and rep. Nonsingularity is shown by computing that the determinant, 1*(-2) - (-1)*5, is nonzero.

In R, one would solve it thusly:

A <- matrix(c(1,5,-1,-2), 2,2)  # The matrix above
A
##      [,1] [,2]
## [1,]    1   -1
## [2,]    5   -2

solve(A, c(0, 3))  # Represent 0 score, +3 rep
## [1] 1 1

One upvote and one downvote.

The same technique works for answers, as the following matrix is also nonsingular:

|  1  -1 |
| 10  -2 |

Again, the determinant, 1*(-2) - 10*(-1), is nonzero. And applied to this answer at this time, we have 98 points due to votes, and a score of 9. So we solve:

|  1  -1 |    | upvotes   |   |  9 |
|        | *  |           | = |    |
| 10  -2 |    | downvotes |   | 98 |

Again using R to solve the system, we get 10 upvotes and 1 downvote:

A <- matrix(c(1,10,-1,-2),2,2)
solve(A, c(9,98))
## [1] 10  1
  • The magic trick. I get it, aha, thank you. – Ave Maleficum Mar 10 '14 at 3:34
  • 2
    WOW, now that's a great answer. – Ave Maleficum Mar 10 '14 at 3:42
  • Thanks @Jonathan for the useful image. – Matthew Lundberg Mar 10 '14 at 3:49
  • Yep, that question's +1/-1. – michaelb958--Reinstate Monica Mar 10 '14 at 3:51
  • 1
    I've downvoted this answer because, while it is interesting, it is not a meaningful contribution. I appreciate the time you took to write this answer, but there are already common duplicates out there. – Aza Mar 10 '14 at 5:43
  • 2
    @Emracool Duplicates of the solution (with code!) for finding the upvotes/downvotes of your questions, when you lack the reputation to see them? Could be, but I've yet to see one. – Matthew Lundberg Mar 10 '14 at 5:45
  • Actually, it works even if they're not relatively prime. The key factor here is we have a system of two linear equations, which can only ever have one solution (two lines only intersect once). – michaelb958--Reinstate Monica Mar 10 '14 at 6:38
  • (Also, you might think this fails when score = rep = 0; it doesn't.) – michaelb958--Reinstate Monica Mar 10 '14 at 6:38
  • @michaelb958 Indeed, the numbers need not be relatively prime. I'm not going to prove it, but that they are relatively prime is a sufficient but not necessary condition for the matrix in question to be nonsingular. In particular, it works for answers too. – Matthew Lundberg Mar 10 '14 at 14:21
  • Nice edit, would upvote again if possible. – michaelb958--Reinstate Monica Mar 10 '14 at 22:10

Not the answer you're looking for? Browse other questions tagged .