# Rating system for 2 vs 2, 2 vs 1 and 1 vs 1 game

We play football table in such configurations:

• 2 vs 2 players
• 2 vs 1
• 1 vs 1

Team (consisting of 1 or 2 players) wins the single game when they score 10th goal.

I would like to introduce a rating system for individual players only. Teams are volatile, people freely pair with others, just depends who is near the table and who wants to play.

I've read about Elo rating system, but it was designed for 1 vs 1 games, in which you can either win, draw or lose.

In table football we have different players configurations and 20 different game outcomes: Winning 10:0, 10:1, ..., 10:9. Losing 0:10, 1:10, ..., 9:10. No draws.

It could be made that we treat it like chess, i.e. only win or loss, but I think we drop too much information in such approach. Winning 10:0 is far better than winning 10:9.

Can you propose a rating system dedicated for described table football game?

• One easy way would be to use ELO and interpret the ending score as a best of 19 games, so that a 10-6 victory is entered into the rating as ten victories and six losses. – Arthur Jun 18 '14 at 19:10
• Do you want to get a rating for each player or for each team? – TobiMcNamobi Jun 18 '14 at 19:12
• @TobiMcNamobi For each player only. Teams are very dynamic, people freely pair (or don't) with others, just depends who is near the table and who wants to play. – Adam Stelmaszczyk Jun 18 '14 at 19:14
• If you're interested in use (more than in development), you should give a try to rankade, our ranking system. Rankade can manage any kind of match (one-on-one, faction vs. faction (two teams, which may be asymmetrical, and more)). We host many foosball groups/clubs, as well as other sports/games ones (here's our dojo). – Tomaso Neri Feb 11 '17 at 21:19

I have a proposition, maybe you can find some weak points in it:

It's based on Elo. First, all the players get 1000 rating points ($R$). Let's focus on 1 vs 1, in the end I will show how to deal with 2 vs 1 and 2 vs 2. Player's A expected score $E_A$ is calculated as follows:

$$E_A = \frac{1}{1+10^{(R_B - R_A)/500}} \in (0, 1)$$

Where $R_A$ is a point rating for player A. Player's B expected rating is $E_B = 1 - E_A$.

New rating for player A:

$$R_A' = R_A + 100(S_A - E_A)$$

Where $S_A$ is the actual score. In case of winning $10:i$ $(i \in {0, 1, ..., 9}$) it is1:

$$S_A = \frac{10}{10+i}$$

In case of losing $i:10$ it is:

$$S_A = 1-\frac{10}{10+i}$$

Example:

Player A with $R_A = 1000$ points won 10:6 with player B with $R_B = 1000$ points. In such case, expected score $E_A = E_B = 0.5$. Actual score $S_A$ for player A is $\frac{10}{10 + 6}=0.625$. So, $R_A' = 1000 + 100(0.625 - 0.5) = 1000 + 12.5 = 1012.5$, $R_B' = 1000 - 12.5 = 987.5$.

What to do with 2 players A and B in one team playing versus player C? We can treat player A and B as one player with rating $\frac{R_A + R_B}{2}$. So, $E_A = E_B = \frac{1}{1+10^{(R_C - \frac{R_A + R_B}{2})/500}}$. New rating will be calculated individually: $$R_A' = R_A + 100(S_{AB} - E_A), R_B' = R_B + 100(S_{AB} - E_B)$$

$S_{AB}$ is the actual game score for player A and B. Since $E_A = E_B$, rating change for players in the same team is the same.

2 vs 2 case analogically.

1Why $S_A = \frac{10}{10+i}$?

Consider a winning $10 : i$. Let $p$ be the probability of the winning team scoring a goal. This will be our "actual score (performance)". Let's assume that this probability is constant for the whole game. After seeing the actual outcome, $10 : i$, we can ask: what's the most likely $p$? One can use maximum likelihood estimation. What's the probability that it was $10:i$, given that the probability of the winning team scoring a goal was $p$? It is:

$P(10:i | p) = \binom{9+i}{9}p^{10} (1-p)^i$

There were $10 + i$ goals in total. The last one belong to the winning team, it was their 10th goal, so this one is pinned. $\binom{9+i}{9}$ is the number of 9 winners goals and $i$ losers goals combinations. Multiplied by the probability of winners scoring 10 goals, $p^{10}$. Multiplied by the probability of losers scoring $i$ goals, $(1-p)^i$. Their goals positions are already determined, so no combinations here.

Now we just need to find which $p$ maximizes $P(10:i | p)$. One could just take the first derivative and set it to zero. However, the maximum is the same for $\log P(10:i | p)$ and it will be easier to find maximum for it, for log-likelihood:

$\log P(10:i | p) = \log \binom{9+i}{9} + \log p^{10} + \log (1-p)^i = \log \binom{9+i}{9} + 10 \log p + i \log (1-p)$

Set first derivative of $P$ with respect to $p$ to 0:

$\log P(10:i | p)' = \frac{10}{p} + \frac{i}{p-1} = 0$

$\frac{10(p-1) + ip}{p(p-1)} = 0$

$10p-10 + ip = 0$

$p(10+i) = 10$

$p = \frac{10}{10+i}$