TITLE: Chess rating calculating algorithm
QUESTION [6 upvotes]: In competitive chess tournaments,  there is a complex rating system that evaluates your rating based on how you do well you do playing games. I am referring to the FIDE system not USCF. Are there FIDE chess players who know for the function of evaluating rating and understand it to the excess of being able to explain it thoroughly to me? Thank you very much. If your curious, I'm FIDE 1760.

REPLY [5 votes]: Formula
The basic formula goes as following:
$$R_{\text{new}} = R_{\text{old}} + K \cdot (W - W_e) $$


$R_{\text{new}}$ = The new rating
$R_{\text{old}}$ = The old rating
$K$ = The K-factor
$W$ = The score, for example: if you score 6.5 out of 9.0, your score is 6.5
$W_e$ = The expected score


$$$$
The K-Factor
This is one of the most important aspects of the formula. This is the development coefficient. It determines the factor which is multiplied with the $(W-W_e)$. The bigger the K-factor, the bigger the impact is for wins or loses. For example, let's assume that $K = 10$, and the $(W-W_e) = 0.7$. This means your rating will be increased with $K \cdot (W- W_e) = 7$. If your K-factor is higher, you will gain more rating points.
The K-factor is determined by your rating and your age. The FIDE uses the following ranges:

$K = 40$, this is used for new players (less than 30 games played in total) and players under the age of 18, as long as their rating remains under 2300.
$K = 20$, this is used for players with a rating under 2400
$K = 10$, this is used for players with a rating of at least 2400 and have played at least 30 games in previous events. After this, the K-factor permanently remains at 10.

$$$$
The expected score
This is determined by the rating of your opponent and the following table:

It shows two things:

$p$ = the fractional score
$dp$ = rating difference

For example, you have a FIDE-rating of 1760. If you win from a 1950-player, the $W_e$ can be determined from the table of conversion here above.
The $dp = 1950 - 1760 = 190$, you can see in the table that the $dp$ of 190 lays between the $.75$ and the $.74$. When the $dp$ is positive, the $p$ will be rounded up (ceiling function), while if the $dp$ is negative, this will be rounded down (floor function). The $dp = 190$, so the $p = .75$. Adding all the fractional scores of each game will give you the expected score ($W_e$).
$$$$
Example
Let's say there is a tournament with 5 games. You have a 1760 rating. The five other opponents have the following ratings:

$R_1 = 1660$, the expected score = .64
$R_2 = 1910$, the expected score = .29
$R_3 = 1835$, the expected score = .39
$R_4 = 1885$, the expected score = .33
$R_5 = 1960$, the expected score = .24

The $W_e = 0.64 + 0.29 + 0.39 + 0.33 + 0.24 = 1.89$
This was your expected score. Let's say you got a score of 3.0 out of 5.0, the $W = 3$. Your rating is lower than $2400$ ( assuming that you're older than 18 and played more than 30 FIDE-rated games in total), so the K-factor = $20$. Your old rating was $1760$. Now we have all the variables to calculate your new rating:
$$R_{\text{new}} = 1760 + 20 \cdot (3 - 1.89) = 1782.2$$
So your new rating would be 1782.