# Determine ratio constant and formula for an equitable score in my algorithm

I am working on a algorithm for a software module but decided I was hung up on the mathematical formula so I posted here instead of Programmers.

Each scenario will have a team of people competing. Each team can be thought as a unique set of players each of random variable size. Minimum team size is 2.

Eg. Team2 - 9 players

Each player can be thought as a binary decision... for simplicity sake lets say that they will randomly grab a hat to wear without looking, either a black hat or a white hat. If every person on the team happens to have a BLACK hat then they will be awarded points. If so much as one person happens to be wearing a white hat then they will not be awarded any points.

The above is to give some background and context to the actual problem because it is an easy binary decision in my algorithm. This is incidental to the formula so far. The important thing to note is that a team can have a random number of players and point awards are all or nothing.

I am trying to determine a formula to determine how many points to award equitably. Clearly it is statistically more likely that small teams will have better odds thus the point award should be smaller. Larger teams are riskier so they should get much more bountiful rewards.

The starting point is to assume that the smallest possible team (2 players) should receive 10 points. Let t = 2, p = 10.

I am trying to determine the most statistically equitable formula and an appropriate constant ratio that can be applied in this calculation to determine the most equitable point reward.

EDIT:

1. what precisely does it mean to award points "equitably"? I apologize for the loose term, but equitably in my case would be one where if I were to have a sufficient sample size of Teams, that on average any team regardless of size will have a statistically similar amount of points. I hope this is clear: (Eg. Team1 4 players - 53 points over a year, Team 2 9 players, 51 points over the same year)

2. Are these shared by team members? Points are awarded to a team, not to team members. There can be any number of events that a number of teams will participate in. Many teams will not get points. Some will get points. If points are awarded depends on the random player criteria listed above. The amount of points rewarded should depend on the statistical probability that every team member flips a coin and gets heads.

3. Are they used to determine which team "wins" in the competition? It is not really a competition and the ones with the most and least points are outliers and not very interesting to me.

4. Can individual members appear on more than one team? No. Teams are more interesting than players anyway, at least in this scenario. Teams have a variable number of players and for each event they all essentially flip a coin hoping that everybody gets heads. If the population of events is in the thousands, then I should be able to get a sufficient sample size to determine that teams with smaller amounts of players DO NOT have a statistical advantage at earning points than teams with MORE players. This is what I mean by equitable.

• A lot of essential detail is missing here--you would be better off explaining the real problem you're trying to solve. Apart from specifying the nature of the random quantities indicated here, what precisely does it mean to award points "equitably"? Are these shared by team members? What is the utility of these points and to whom? Are they used to determine which team "wins" in the competition? Can individual members appear on more than one team? – whuber Oct 22 '12 at 17:36
• @whuber Thank you for your feedback and I apologize I wasn't entirely clear. I edited the question to provide what I feel is a complete background. I essentially am looking for a ratio that can be applied to team player size to determine the appropriate amount of points to result in a clean bell curve when comparing team performance regardless of team size. – maple_shaft Oct 22 '12 at 18:53

It appears that "equitable" means that the expected values of the team points, conditional on $n$, need to be equal regardless of team size. This answer explores some consequences of this interpretation.

For a team of size $n$ that is awarded $x(n)$ points if it "wins" and zero points otherwise, the expectation reduces simply to the probability of winning multiplied by $x(n)$. With the independent "fair coin" model of choosing colors, wherein the coin has chance $p$ of being black and (therefore) $n$ black values are found with probability $p\times p \times \cdots \times p = p^n$, this expectation equals $x(n)p^n$. The condition $x(2)=10$ determines the unique solution

$$x(n) = 10 / p^n.$$

Notice that this solution has nothing to do with $n$ being random or not. However, the distribution of team points at the end of the "competition" will be strongly determined by the distribution of $n$. To explore this, we can simulate a competition. (The code uses R.)

First, we specify the number of teams n.teams, the number of trials during a competition n.trials (which is fixed and equal for all teams in this simulation), the parameters for a random distribution of team sizes, and the chance of black. In this example, the distribution is Poisson (offset by $1$ to assure positive team sizes) with parameter lambda. We also start the random number generator at a reproducible point.

lambda <- 3
n.trials <- 100
n.teams <- 10000
p.black <- 1/2
set.seed(17)


Create the teams, assign hat colors to their members for each trial, count up the total number of wins, and award the points accordingly (using the solution $x(n)$):

n <- 1 + rpois(n.teams, lambda)
n.black <- matrix(rbinom(n.trials * n.teams, size=n, p=p.black), nrow=n.teams) == n
wins <- apply(n.black, 1, sum)
points <- wins * sapply(n, function(n) 10 / p.black^n)


Here is a plot of points versus team size in this simulation involving 100 trials for each of 10,000 independent teams (averaging lambda+1 = $4$ people per team) when p.black is $1/2$. To make all the data visible, dots on the plot are randomly offset by up to 2.5% of the width and height of the plot.

jitter <- 0.025
xr <- jitter*(range(n) - mean(n))
yr <- jitter*(range(points) - mean(points))
plot(n + runif(n.teams, xr[1], xr[2]), points + runif(n.teams, yr[1], yr[2]),
xlab="Team size", ylab="Total points",
main=sprintf("P = %0.2g, lambda = %0.2g", p.black, lambda))
abline(coef(lm(points ~ n)), lwd=2, col="Blue", lty=2)


The blue line is the least squares fit to the data. Its horizontal trend attests to the "egalitarian" nature of the solution $x(n)$: the expected number of points is the same regardless of team size. (In fact, inspecting the least squares fit with summary(lm(points ~ n)) reveals it has an insignificant--and relatively small--slope.)

Please notice (a) the extremely skewed distribution of points and (b) the strong tendency for larger teams either to get no points at all or so many points that a single win assures a high standing at the end of the competition. The uniqueness of $x(n)$ shows that this behavior is forced on us by the requirements of the problem. It nicely illustrates the tradeoff between risk (exhibited as the large ranges of results for larger teams) and reward (apparent as the numbers of points).

It is instructive to re-run the simulation with different values of the input. When lambda grows, for instance, most teams are relatively large, so only a few--and not necessarily the largest--account for almost all the points. When p.black grows, the skewness of the results decreases. For instance, here are results of the same simulation with p.black changed from $1/2$ to $2/3$:

• Wow, this is eye opening, not so much that I immediately understand the algorithm, but that I will need some kind of upper bound on team size to ever get a useful number. I would hope that chances of a black hat are better than 50%, however I have no data to prove this suspicion. Regardless the consequences of not having an upper bound on team size reflects how much of a disadvantage large teams truly have. My very requirements are fundamentally inequitable and poorly thought out by management, yet as is typical in software development, dump the problem on developers, they will figure it out. – maple_shaft Oct 23 '12 at 11:07
• Well perhaps I can presume the players are at least trying to be productive at some level to where they have slightly better than random odds, lets say roughly 66%. $$x(n) = 8.165 \times 1.5^{n-1.5}.$$ would be a good approximation without awarding extreme amounts of points. I am thinking that if we put a cap on points to 100 then teams above 8 in size will be an oddity and will not perform as well overall. – maple_shaft Oct 23 '12 at 12:04
• In response to your remarks, I enhanced the R simulation to accommodate specified chances of black other than $1/2$. I also fixed a mistake in the expression for $x(n)$. (The error was immaterial to the results--it was just off by a constant factor.) – whuber Oct 23 '12 at 13:20
• Thats a much better simulation with a better probability spread. The outliers become very apparent and the mean is clear. Most results seem to be within one standard deviation (visually). Thank you so much for your help, I appreciate it! – maple_shaft Oct 23 '12 at 14:06