# 21 judges give 4 contestants a 4, 3, 2, or 1. How often is there a first place tie?June 24, 2008 11:22 AM   Subscribe

Imagine a contest, with 21 judges and 4 contestants. Judges must give one contestant 4 points, one contestant 3 points, one contestant 2 points, and one contestant 1 point. The winner is decided by summing the scores of all 21 judges. Mathematically speaking, what percentage of the time would you expect there to be a tie for first place after all 21 scores have been added?
posted by 23skidoo to Education (25 answers total) 2 users marked this as a favorite

What you're asking is broadly equivalent to asking what proportion of the time a Borda count will produce a tie.

The question isn't a sensible one on its own. You'd have to make assumptions about how the judges are voting and about the distribution of quality among the contestants to get an answer that made any sense at all.
posted by ROU_Xenophobe at 11:32 AM on June 24, 2008 [1 favorite]

This question can't really be answered mathematicallly.

For instance, if there was a slam dunk contest with 19 highschoolers and 2 NBA players, the above scenario seems quite likely. On the other hand, if it's a modeling contest with 21 people from the SI swimsuit edition then it doesn't seem all that likely that two models will tie for first place.

However, if this is a purely abstract mathematical question with perfectly unbiased judges and contestants who are all perfectly equal, then I don't know the answer.
posted by Autarky at 11:33 AM on June 24, 2008

Right. And are there 4 judges and 21 contestants, or 21 judges and 4 contestants?
posted by mbd1mbd1 at 11:34 AM on June 24, 2008

Experimentally, the number is about 36% in 10,000 trials.
#!/usr/bin/python
import random
def tie(scores):
m = max(scores)
return scores.count(m) > 1

def score(n,k,rr=random.randrange):
return sum(rr(n) for i in range(k))

def trial(n=4,k=4,c=21,r=10000):
ties = 0
for i in range(r):
scores = [score(n,k) for j in range(c)]
if tie(scores): ties += 1

print ties * 100.0 / r

trial()
This assumes that judges rulings are uniformly random and not correlated. If the judges are judging "the same thing", there will be correlations between the scores they award. For instance, modifying the program so that half the contestants never get a "1" score and half never get a "4" score, the experimental tie rate is increased to around 47%.

Another way that scoring might deviate from "uniform, uncorrelated" is if different scores are given with different probability. For instance, you might find that 2 and 3 are awarded more often than 1 or 4. If the distribution is [1,2,2,3,3,4] then the tie rate is about 40% in 10000 trials.

I'm not sure how to analytically find the exact tie rate in any of these cases.
posted by jepler at 11:39 AM on June 24, 2008

And are there 4 judges and 21 contestants, or 21 judges and 4 contestants?

Crap. I checked it twice. There are 21 judges and 4 contestants.

I understand that there are innumerable factors at work in any sort of attempt to answer this question with real-world constraints, like contestant quality or judging bias.

I'm just interested in the answers from a purely abstract point of view.
posted by 23skidoo at 11:41 AM on June 24, 2008

As I read it, a better way to state this is:

You have 21 shuffled decks, each of which has four cards, numbered 1-4. Deal each of them out to four people. Add up each person's deck; whoever has the highest total wins a sandwich. How often do multiple people need to split the sandwich?
posted by aubilenon at 11:44 AM on June 24, 2008

er, each person's hand
posted by aubilenon at 11:44 AM on June 24, 2008

Give four identical decks of 21 playing cards to four judges. Place four numbered boxes in front of them, and have them place their favorite card in box number 1, their second choice in box number 2, and so on. Now do the math. But as posters have said, the math might not transfer accurately to a given situation.

Holy cow, aubilenon. Jinx.
posted by weapons-grade pandemonium at 11:45 AM on June 24, 2008

Well, sort of.
posted by weapons-grade pandemonium at 11:46 AM on June 24, 2008

You have 21 shuffled decks, each of which has four cards, numbered 1-4. Deal each of them out to four people. Add up each person's deck; whoever has the highest total wins a sandwich. How often do multiple people need to split the sandwich?

Thanks, this question is semantically identical to the one I want answered.
posted by 23skidoo at 11:48 AM on June 24, 2008

But if the judges get to choose a card, as in my answer, it actually mirrors real life more than dealing, because the Queen of Hearts, for example, is favored. So you'd get more ties.
posted by weapons-grade pandemonium at 11:52 AM on June 24, 2008

And I missed the 21 vs. 4 correction, so change that.
posted by weapons-grade pandemonium at 11:54 AM on June 24, 2008

argh, I misunderstood the problem even before the clarification. oops.
posted by jepler at 12:02 PM on June 24, 2008

21 judges randomly assigning 4 unique numbers (1-4) to four different people and then adding them up results in ties about 2.2% of the time.

10,000 attempts yields a 2.0-3.0% chance.

Of course this is random like the card example, but judges, in all actuality, will not be randomly assigning values. A contestant receiving a 4 would rarely receive a 1 (most likely receiving more 4's than any other contestant) while a contestant receiving a 1 would likely receive more 1's than any other contestant.

This will lower the chances of a tie.
posted by trueluk at 12:10 PM on June 24, 2008

Ok, since I don't have the best answer yet, I can go ahead and correct my initial answer. My program was wrong the first time, it's fixed now.

10,000 attempts gives us around a 4% chance.

Here is the distribution of ties on 10,000 attempts : [SCORE]=> # of times SCORE resulted in a tie (eg. 57 and 58 were the scores that resulted in ties the most, 54 and 55 times respectively)

[58] => 55
[57] => 54
[59] => 46
[60] => 41
[56] => 35
[55] => 34
[61] => 29
[62] => 26
[54] => 21
[63] => 20
[65] => 13
[53] => 12
[64] => 7
[67] => 6
[68] => 4
[66] => 3
[70] => 2
[69] => 1

SOURCE:

? P h P

\$ties=0;
for(\$attempts=0;\$attempts<10000;\$attempts++)
{

\$totals[1]=0;
\$totals[2]=0;
\$totals[3]=0;
\$totals[4]=0;
for(\$tries=0;\$tries<21;\$tries++) //21 judges
{
\$scores[1]=false; //Score 1 not used by this judge yet
\$scores[2]=false; //Score 2 not used by this judge yet
\$scores[3]=false; //Score 3 not used by this judge yet
\$scores[4]=false; //Score 4 not used by this judge yet
for(\$i=1;\$i<5;\$i++)
{
\$contestant[\$i]=0; //all four contestants start at zero for each judge.
}
\$loop=true;
while(\$loop)
{

\$rand = mt_rand(1,4); //Which contestant
\$score = mt_rand(1,4); //What score
if(\$scores[\$score]==false) //If 'score' not used by judge yet
{
\$contestant[\$rand]=\$contestant[\$rand]+\$score;
\$scores[\$score]=true; //This 'score' has been used by the judge;
}
if(\$scores[1]==true && \$scores[2]==true && \$scores[3]==true && \$scores[4]==true) //Judge is finished.
{
\$loop=false;
for(\$j=1;\$j<5;\$j++)
{
\$totals[\$j]=\$totals[\$j]+\$contestant[\$j]; //get totals for each contestant.
}

}
}
}
\$max=max(\$totals);
\$ties--; //\$max is found once every time.
for(\$j=1;\$j<5;\$j++)
{
if(\$totals[\$j]==\$max)
{
\$ties++;
}
}
}

echo (\$ties/10000)*100;

?
posted by trueluk at 12:56 PM on June 24, 2008

[Updated the question text and title to reflect 21-judge, 4-contestant clarification.]
posted by cortex (staff) at 1:02 PM on June 24, 2008

trueluk, your most recent algorithm allows one judge to give a contestant more than one score, e.g., a judge could give the "4" and "2" to the same contestant (resulting in 6 for that contestant from a single judge). My understanding of the question is that each judge must award "1" "2" "3" and "4" to four different contestants.

Also, if there's a three-way tie (which is possible) your algorithm counts it as two ties, when it seems to me it should only be counted once.
posted by DevilsAdvocate at 1:08 PM on June 24, 2008

allows one judge to give a contestant more than one score

Point taken. Fixed it so the contestant must currently have a zero for that judge's iteration.

A three-way tie? Heresy!

I knew I should have kept my strategy in its black-box.

Switched the tie logic to:

\$temp=\$totals;
sort(\$temp);
\$max = \$temp[3]; //\$max is in first place.
for(\$j=2;\$j>=0;\$j--)
{
if(\$temp[\$j]==\$max) //there's a tie for first
{
\$ties++;
break;
}

}

And there is a ~9% chance.
posted by trueluk at 1:31 PM on June 24, 2008

I'd love to mark an answer as best, but I have no idea how to judge the correctness of any of the answers.
posted by 23skidoo at 2:12 PM on June 24, 2008

Okay I did my own damn simulation.
`.-------------------------------- number of judges|       .------------------------ tied at all   |       |         .-------------- tied 3-way or more|       |         |         .---- 4-way tie v       v         v         v1:  0.000000  0.000000  0.0000002:  0.291781  0.083382  0.0416053:  0.183715  0.027522  0.0000004:  0.182510  0.022675  0.0077295:  0.164120  0.019923  0.0000006:  0.149385  0.013828  0.0035457:  0.141616  0.014711  0.0000008:  0.131219  0.010799  0.0025029:  0.126206  0.011848  0.00000010: 0.118189  0.008744  0.00170711: 0.115231  0.009746  0.00000012: 0.108530  0.007491  0.00135213: 0.105946  0.008059  0.00000014: 0.101196  0.006372  0.00099615: 0.098649  0.007183  0.00000016: 0.094638  0.005732  0.00088517: 0.093661  0.006413  0.00000018: 0.090024  0.005204  0.00077019: 0.088074  0.005669  0.00000020: 0.086024  0.004736  0.00063521: 0.083962  0.005189  0.00000022: 0.081642  0.004342  0.00053923: 0.080525  0.004706  0.00000024: 0.078156  0.004054  0.00046725: 0.077205  0.004389  0.00000026: 0.075718  0.003839  0.00044127: 0.073763  0.004074  0.00000028: 0.072998  0.003451  0.00038429: 0.072220  0.003764  0.00000030: 0.071194  0.003368  0.00036331: 0.069706  0.003513  0.00000032: 0.068883  0.003183  0.000347`
Source code here

Note that it is impossible to get a four-way tie with an odd number of judges.

posted by aubilenon at 3:06 PM on June 24, 2008 [1 favorite]

I'm getting ~8.4% chance, similar to trueluk and aubilenon.

Here's the perl program I used:

\$ntrials=1000000;
\$njudges=21;
\$ncontestants=4;

srand;

foreach \$c (1..\$ncontestants)
{\$nwaytie[\$c]=0;}

foreach \$t (1..\$ntrials)
{
foreach \$c (1..\$ncontestants)
{\$cscore[\$c]=0;}
foreach \$j (1..\$njudges)
{
foreach \$c (1..\$ncontestants)
{
}
}
@scores=sort {\$b <=> \$a} @cscore[1..\$ncontestants];
\$max=\$scores[0];
\$winners=0;
\$i=0;
while (\$scores[\$i]==\$max && \$i<\$ncontestants)
{
\$winners++;
\$i++;
}
\$nwaytie[\$winners]++;
}

print ("Out of \$ntrials trials:\n");
print (" \$nwaytie[1] had undisputed winners\n");
foreach \$c (2..\$ncontestants)
{print (" \$nwaytie[\$c] had \$c-way ties\n");}

Which in one run of a million trials gave me 78894 two-way ties and 5038 three-way ties.
posted by DevilsAdvocate at 3:10 PM on June 24, 2008

You guys are checking for a tie at all, correct? Not, as the question states, a tie for first place?
posted by klangklangston at 5:20 PM on June 24, 2008

klangklangston: All source code in this post is checking for a tie for first place.
posted by aubilenon at 5:39 PM on June 24, 2008

DevilsAdvocate's code wouldn't include 3-way ties in the count of 2-way ties, whereas aubilenon's does. I mention this because they do both actually come up with essentially the same result (83962 vs. 83932).

aubilenon's code is sexist because it assumes the contestants are guys.
posted by Bokononist at 11:23 AM on June 25, 2008

I'm very far from a professional programmer--really, I know just enough to get myself in trouble--but I still had to laugh at myself when looking at this bit of what I wrote yesterday:

\$winners=0;
\$i=0;
while (\$scores[\$i]==\$max && \$i<\$ncontestants)
{
\$winners++;
\$i++;
}
\$nwaytie[\$winners]++;

which is particularly inefficient. Why, exactly, did I make \$winners and \$i separate variables?
posted by DevilsAdvocate at 2:54 PM on June 25, 2008

« Older Dealing with bad blank DVD-Rs   |   Where can we find an hibachi? Newer »