user10887: I am starting a chess club at my school, and I want to create a Python program to calculate and store Elo ratings for each player. I am confident I can program it, but I just need to know:
How do you calculate Elo?
What i am looking for:

Equations to calculate expected outcome for each player.
Equations to calculate elo change using this.
How to deal with a draw.
How the value of K can be calculated, or suggestions for a static value of K which would work for students.

So far the best explanation I have found is the League of Legends rating system explained in this video (which happens to be the same system used in chess).

user3480: All the informations regarding FIDE elo rating can be found here :
https://www.fide.com/fide/handbook.html?id=172&view=article
Each player must start with an estimated FIDE elo rating. Usually people are playing tournaments against FIDE players and then get a rating. (see article 8.2) 
The FIDE elo system update your rating after each game played according to article 8.5.

user2311: Here you have some more information about Elo system that maybe it's useful for you.
Arpad Elo designed his system assuming a normal distribution in the results achieved by the players with a standard deviation of 200 rating points. So he used a logistic function to calculate the expected results by a player. The actual function (actually a table is used with minimal differences with this function) is:
WEa = 1 / (1 + 10^((Rb-Ra)/400)), rounded to two decimal digits

WEa is the expected result for player a, while Rb and Ra are the ratings of both players. As you can see in a game between two players having 400 points of difference in rating the chances of winning the game are 10:1.
After the game(s) expected and actual results of a player are compared, so players performing better than their expected results increase their ratings, and players performing worse decrease them. To do that the difference between expected and actual results is multiplied by a constant factor K. This constant value has to be small enough to make the system stable and avoid reflecting the very last results only, but large enough to be able to track players evolution. I guess a good value would be between 20 and 30, Jeff Sonas for example suggest 24 as the optimum value, while FIDE handbook points that rating stabilizes after 70 games (K10), 35 games (K20) and 18 games (K40), maybe these numbers can be useful for you to set your own K value.
Using a greater K value the very first few games can help your students to reach an approximate rating quickly and then you can change to a smaller K value.

10887: <p>I am starting a chess club at my school, and I want to create a Python program to calculate and store Elo ratings for each player. I am confident I can program it, but I just need to know:</p>

<p><strong>How do you calculate Elo?</strong></p>

<p>What i am looking for:</p>

<ul>
<li>Equations to calculate expected outcome for each player.</li>
<li>Equations to calculate elo change using this.</li>
<li>How to deal with a draw.</li>
<li>How the value of K can be calculated, or suggestions for a static value of K which would work for students.</li>
</ul>

<p>So far the best explanation I have found is the League of Legends rating system explained in <a href="https://www.youtube.com/watch?v=1_xLjI6zN3I" rel="noreferrer">this</a> video (which happens to be the same system used in chess).</p>
 3480: <p>All the informations regarding FIDE elo rating can be found here :</p>

<p><a href="https://www.fide.com/fide/handbook.html?id=172&amp;view=article" rel="nofollow">https://www.fide.com/fide/handbook.html?id=172&amp;view=article</a></p>

<p>Each player must start with an estimated FIDE elo rating. Usually people are playing tournaments against FIDE players and then get a rating. (see article 8.2) </p>

<p>The FIDE elo system update your rating after each game played according to article 8.5.</p>
 2311: <p>Here you have some more information about Elo system that maybe it's useful for you.</p>

<p>Arpad Elo designed his system assuming a <a href="https://en.wikipedia.org/wiki/Normal_distribution" rel="nofollow noreferrer">normal distribution</a> in the results achieved by the players with a standard deviation of 200 rating points. So he used a <a href="https://en.wikipedia.org/wiki/Logistic_function" rel="nofollow noreferrer">logistic function</a> to calculate the expected results by a player. The actual function (actually a table is used with minimal differences with this function) is:</p>

<pre><code>WEa = 1 / (1 + 10^((Rb-Ra)/400)), rounded to two decimal digits
</code></pre>

<p>WEa is the expected result for player a, while Rb and Ra are the ratings of both players. As you can see in a game between two players having 400 points of difference in rating the chances of winning the game are 10:1.</p>

<p>After the game(s) expected and actual results of a player are compared, so players performing better than their expected results increase their ratings, and players performing worse decrease them. To do that the difference between expected and actual results is multiplied by a constant factor K. This constant value has to be small enough to make the system stable and avoid reflecting the very last results only, but large enough to be able to track players evolution. I guess a good value would be between 20 and 30, <a href="http://en.chessbase.com/post/the-sonas-rating-formula-better-than-elo-" rel="nofollow noreferrer">Jeff Sonas for example suggest 24 as the optimum value</a>, while <a href="https://www.fide.com/fide/handbook.html?id=172&amp;view=article" rel="nofollow noreferrer">FIDE handbook</a> points that rating stabilizes after 70 games (K10), 35 games (K20) and 18 games (K40), maybe these numbers can be useful for you to set your own K value.</p>

<p>Using a greater K value the very first few games can help your students to reach an approximate rating quickly and then you can change to a smaller K value.</p>
