Click here to Skip to main content
15,892,965 members
Articles / Operating Systems / Windows
Article

Is CodeProject's Voting system really smart?

Rate me:
Please Sign up or sign in to vote.
3.50/5 (47 votes)
25 Apr 2004CPOL3 min read 166.4K   21   55
In this article I continue my discussion of the CodeProject''s voting system.

Introduction

This is a sequel of the article called "CodeProject's Article voting system" in which I have discussed two voting models, one of which I thought is used on the CodeProject's website.

As far as I was corrected by Chris Maunder who provided me with the model that is really used, I have decided to analyze this model too.

In this article you will find the rating counting algorithm, the description of its model and then some analysis of it.

Rating counting algorithm

The following description was cut and pasted from the following post "Excellent analysis. Unfortunately not quite correct":

Each article on CodeProject has associated with it a Vote Total (Vt), a Weight Total (Wt), and a number of votes (N). When a member votes, the system adds the weight of their vote (dependant on membership level) to Wt, and the rating itself multiplied by their weight to Vt. The rating of an article is then R = Vt / Wt.

If everyone has a weight of 1 then Wt = N, and R = Vt / N. Having differing weights, though, means that when a gold member (weight = 4) and bronze member (weight = 1) vote, the vote is weighted towards the gold:

Assume Gold votes 5 and Bronze votes 1:
Wt = 4 + 1 = 5
Vt = 4 x 5 + 1 x 1 = 21
R = 4.2

This is quite clear and looks very reasonable as each person has its weight in the system that depends on its status. But does it really works? An answer to this question along with the probability model will be given in the following sections.

Voting probability model

In the algorithm described above we deal with two types of random variables:

  • Image 1 - the peoples' vote values
  • Image 2 - the person's weight in the system

Note that:

  1. Image 3 , Image 4, Image 5 and Image 6 are independent when Image 7 and Image 8
  2. Image 9, Image 10 have the same distribution Image 11
  3. Image 12, Image 13 have the same distribution Image 14

Now we can represent the algorithm given above by the following formula:

Image 15

In this formula index Image 16 means that Image 17 is the rating after the Image 18'th vote. It is also obvious that Image 19 is the weight of the person who put in the Image 20 vote and thus voted with the value Image 21.

Let us now assume that we have the following mean values of our random variables:

Image 22, Image 23 Image 24

It is well known from the probability theory that for two random variables Image 25 and Image 26:

Image 27

If they are independent then:

Image 28

Now we are ready to calculate the following mean value Image 29:

Image 30
Image 31

(These calculations are trivial and self descriptive)

In other words Image 32 and doesn't depend anyhow from weights of the persons who participated in the voting!

It is also interesting to note that if the rating formula would be the following:

Image 33

then the mean value of the rating would be Image 34 i.e. independent from vote values!

Conclusions

In this article I have calculated the mean value of the rating that measures the quality of any article on CodeProject's website.

It was discovered that although the weight of each person in the system is taken into account in case when the vote and the weight are independent, the mean value of rating random variable doesn't depend on the weight. Even more, the mean value is also the same as the mean value for the two other voting models described in my previous article "CodeProject's Article voting system".

Note that if the vote values depend on person's weights then the rating mean value is different and involves the weights distribution. Thus this approach may be considered to be more general than simple approaches that do not involve weights.

References

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
Netherlands Netherlands
PhD in Numerical and Statistical Model Checking of Probabilistic systems. Bachelor and Masters degrees (with honors) in Theoretical Mathematics. Thirteen (13) international research publications, among which nine (10) are DBLP recognized. Seventeen (17) years of work experience in Research, Design and Development of Verification Algorithms for Probabilistic and Control Systems, Scientific Software, Embedded Systems and Web applications. Excellent English (TOEFL-257-PC) and Good Dutch (NT2-2) skills. Permanent Dutch residence.

Specialties:
• Theoretical and applied research in Control and Formal Verification (numerical and statistical);
• Acquiring information, sharing knowledge, lecturing, mentoring, motivating and evaluating people;
• Working on large-scale distributed, multi-threaded, event-driven, cross-disciplinary software projects;

Research experiences:
• Numerical and Statistical Model Checking of Markov Chains;
• Type-2 Computable Topological semantics for CTL* on Dynamic Systems;
• Statistical Machine Translation;
• Deterministic and Symbolic-regression based compression of Symbolic controllers;
• Multi-dimensional trajectory planning with position and derivative constraints.

Teaching and supervision:
• 5 years of teaching at Novosibirsk State University, University of Twente, Fontys Hogescholen
• Supervising 3 master students at TU Twente and RWTH Aachen
• Supervising 11+ trainee-ship/internship students at Fontys Hogescholen
• Managing a group of 7 volunteers in the Russian school foundation
• Leading leading 3 project groups at Fontys Hogescholen

Software experiences (years):
• C++ (8), UML (6), Java (5), C (5), Matlab (4), C# (2), Python (1), Mathematica (1)
• GIT (4), SVN (5), Clearcase (4), Clear Quest (4), SCCS (2)
• CMake (3), Make (2), Ant (2)
• CSS (3), HTML (3), JavaScript (2)

Comments and Discussions

 
GeneralRe: Movie rating and CodeProject’s Article rating Pin
Dr. Ivan S Zapreev18-Apr-04 23:07
professionalDr. Ivan S Zapreev18-Apr-04 23:07 
GeneralRe: Movie rating and CodeProject’s Article rating Pin
Christopher Lord26-Apr-04 8:07
Christopher Lord26-Apr-04 8:07 
GeneralRe: Movie rating and CodeProject’s Article rating Pin
Patrice Dargenton27-Apr-04 20:27
Patrice Dargenton27-Apr-04 20:27 
GeneralRe: Movie rating and CodeProject’s Article rating Pin
Patrice Dargenton27-Apr-04 20:40
Patrice Dargenton27-Apr-04 20:40 
GeneralAbout the bad use of stats Pin
minox18-Apr-04 1:43
minox18-Apr-04 1:43 
GeneralRe: About the bad use of stats Pin
Dr. Ivan S Zapreev18-Apr-04 5:42
professionalDr. Ivan S Zapreev18-Apr-04 5:42 
GeneralRe: About the bad use of stats Pin
Dr. Ivan S Zapreev18-Apr-04 6:30
professionalDr. Ivan S Zapreev18-Apr-04 6:30 
GeneralRe: About the bad use of stats Pin
minox29-Apr-04 14:13
minox29-Apr-04 14:13 
Hello,

>>Please provide me with the proof and also explain what are Wi and Vi >>and why do you speak of their dependency and independency.

You are right, I typed too fast. I meant Wt and Vt, and will use Wi and Vi for instances of Wt and Vt.

I speak about dependency because you said in you article :
"If they are independent, then E(fg) = E(f)E(g)"
Well, if they are NOT independent, E(fg) become different from E(f)E(g), and you calculation of E(Rn) can't be done this way because :
sigma(E(WiVi/sigma(Wi))) is not equal to sigma(E(Wi/sigma(Wi)))*E(Vi)
and you can't conclude the E(Rn) doesn't depend from weight.

Definition for statistical independence :
P(A|B) = P(A)

In english : the probability P of the event A knowing the event B is the same as the probaility of the event A alone.
In our case, A=Vi is a vote between the possible vote values, and B=Wi the membership level of the voter.

If Vt is independant of Wt, the probability for a rooky to give a 1 on a specific article is the same as the probability for a guru to do so. And the same for 2, 3, 4 and 5. In plain english, it mean they vote the same way.

If P(Vt|Wt) is not equal to P(Vt), it mean the probability to get a vote Vi is different when you know Wt for at least some Vi. I othere words, it means that the probability to get a given vote is not the same depending on the voter weight.

>>But what do you mean by “as they give a weighted mean if (D)” can >>you predict and estimate the influence?

Absolutly no Smile | :) The impact depend of the the shape of the vote distributions for each weight level, so you would need the "real" distribution of the votes. I would postulate it may be different from one article to the other(normal, lognormal, bimodal etc...), and many article don't get enough vote to assess the distribution.

The simpler way to describe the weighted sum is to say it's equivalent to have people vote as many time as their weight. A level 5 guru vote as the same impact on the average vote as 5 level 1 rookies giving the same vote.

But you made a good point : The need for stats and 'model' arise when you want to make predictions.

>> This requires a lot of data I do not have access to
Yes, you need data to make an analysis, but it does not mean you can always find a model out of the data. In that case, you would have to use the parcimony principle, and give a article's value estimator using as few assumptions as possible : the aritmetic mean Wink | ;-)

>> Ps: By the way the title of your post seems to be strange...
I would have expected, after you found E(Rn) to ignore weight, that you went back and explain why and in which cases. But you just stopped on a conclusion hurting common sens and made it look as a fact because of the statistical formalism. Wink | ;-)

Thank for your article, even (or because) it forced me to look deeper in math books (I didn't remebered the mathematical definiton of dependency, while I use the concept all the time)

minox
GeneralIncorrectness by counterexample. Pin
73Zeppelin17-Apr-04 22:19
73Zeppelin17-Apr-04 22:19 
GeneralRe: Incorrectness by counterexample. Pin
Dr. Ivan S Zapreev18-Apr-04 5:01
professionalDr. Ivan S Zapreev18-Apr-04 5:01 
GeneralRe: Incorrectness by counterexample. Pin
73Zeppelin18-Apr-04 7:11
73Zeppelin18-Apr-04 7:11 
GeneralRe: Incorrectness by counterexample. Pin
Dr. Ivan S Zapreev18-Apr-04 7:40
professionalDr. Ivan S Zapreev18-Apr-04 7:40 
GeneralNot a critique, but Pin
Michael Dunn17-Apr-04 14:59
sitebuilderMichael Dunn17-Apr-04 14:59 
GeneralRe: Not a critique, but Pin
Dr. Ivan S Zapreev18-Apr-04 4:20
professionalDr. Ivan S Zapreev18-Apr-04 4:20 
GeneralCircular Argument. Pin
73Zeppelin17-Apr-04 8:42
73Zeppelin17-Apr-04 8:42 
GeneralRe: Circular Argument. Pin
leppie17-Apr-04 12:08
leppie17-Apr-04 12:08 
GeneralRe: Circular Argument. Pin
Dr. Ivan S Zapreev18-Apr-04 4:14
professionalDr. Ivan S Zapreev18-Apr-04 4:14 
GeneralRe: Circular Argument. Pin
73Zeppelin18-Apr-04 7:16
73Zeppelin18-Apr-04 7:16 
GeneralRe: Circular Argument. Pin
Dr. Ivan S Zapreev18-Apr-04 21:11
professionalDr. Ivan S Zapreev18-Apr-04 21:11 
QuestionHuh???? Pin
interj17-Apr-04 7:17
interj17-Apr-04 7:17 
AnswerRe: Huh???? Pin
Dr. Ivan S Zapreev17-Apr-04 7:34
professionalDr. Ivan S Zapreev17-Apr-04 7:34 
GeneralRe: Huh???? Pin
Daniel Turini17-Apr-04 16:14
Daniel Turini17-Apr-04 16:14 
GeneralRe: Huh???? Pin
Dr. Ivan S Zapreev18-Apr-04 3:58
professionalDr. Ivan S Zapreev18-Apr-04 3:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.