Sign in to follow this  
sooner123

Chess simulation requiring seemingly intractable Algebra

Recommended Posts

sooner123    269

I'm trying to write a chess simulation where entity's ratings are emergent out of pairings where the results are based on comparison of various statistics.

 

Here is an example that covers the issue I'm running into:

 

player_1 has a strength attribute strength_1

player_2 has a strength attribute strength_2

 

I want the expected score [(# of wins + 1/2 * # of draws) / (number of games)] to equal strength_1 / (strength_1 + strength_2)

 

So far so good. The issue is when I include draws.

 

Arbitrarily (not exactly arbitrary, but tl;dr) I want the distribution of wins///draws///losses to stick to wins///GM(wins,losses)///losses, where GM is the geometric mean

 

It's not as simple as strength_1///GM(strength_1, strength_2)///strength_2 because this actually skews things in favor of the weaker player.

 

So it has to be reverse engineered algebraically.

 

We need to find x, y, and z, such that ((x + (1/2)*y) / (x + y + z) = strength_1/(strength_1 + strength_2)    <- we can treat the righthand side here as a constant since we know strength_1 and strength_2

 

And we also have that y = sqrt(x*z)

 

And finally we have the same equation as above but inverted for the other player: (z + (1/2)*y)/(x+y+z) = strength_2/(strength_1 + strength_2)

 

Problems are

 

A) equations are incredibly difficult to solve

B) they might not even count as two equations/two variables because I'm not sure if the two main formulas are linearly independent. (same denominator and the constants in question add up to 1) This might not preclude their linear independence, but I'm not very experienced in this type of math so I don't know.

Edited by sooner123

Share this post


Link to post
Share on other sites
CulDeVu    3034
[Edit: disregard the following post. I see now the problem]

Looks like a problem for Wolfram!

[url="%5Burl="http://m.wolframalpha.com/input/?i=Solve+%28%28x+%2B+%281%2F2%29*y%29+%2F+%28x+%2B+y+%2B+z%29+%3D+s%2F%28s+%2B+t%29+for+z&x=7&y=5"]http://m.wolframalpha.com/input/?i=Solve+%28%28x+%2B+%281%2F2%29*y%29+%2F+%28x+%2B+y+%2B+z%29+%3D+s%2F%28s+%2B+t%29+for+z&x=7&y=5"[/url][/url]

Z = (-sy+2tx+ty)/(2s), wherr (s+t)(2x+y)=\=0 and s=\=0

Where s is strength_1 and t is strength_2 for the first equation. You can just change the variable to solve for in Wolfram, and the second equation can be entered the same way :)

Share this post


Link to post
Share on other sites
alvaro    21246


I want the expected score [(# of wins + 1/2 * # of draws) / (number of games)] to equal strength_1 / (strength_1 + strength_2)

 

It sounds like you are trying to reinvent Elo score, although your "strength" is something like exp(constant*Elo).

 

 


Arbitrarily (not exactly arbitrary, but tl;dr) I want the distribution of wins///draws///losses to stick to wins///GM(wins,losses)///losses, where GM is the geometric mean

 

You lost me when you introduced a geometric mean in there. There are many ways of dealing with draws in rating systems, but this one seems completely unrealistic. Can you elaborate on the reasons behind this?

Share this post


Link to post
Share on other sites
alvaro    21246

Define

 

k := strength_2/(strength_1 + strength_2)

 

Now y = (1/3)(sqrt(-12k2+12k+1)-1)

 

Then x and z are (1-y±sqrt(1-2y-3y2)/2, and you have to pick the sign so the stronger side has a larger chance of winning.

 

For instance, if k = 105/111, you get y = 10/111, x = 100/111 and z=1/111.

Edited by Álvaro

Share this post


Link to post
Share on other sites
sooner123    269

 

You lost me when you introduced a geometric mean in there. There are many ways of dealing with draws in rating systems, but this one seems completely unrealistic. Can you elaborate on the reasons behind this?

 

 

Just intuition here. I wasn't able to find anything else for modeling expected ratio of draws to decisive games given a rating gap (and ratings, since for a given rating gap, higher ratings implies more draws)

 

GM seemed a reasonable approximation but I can't justify it anymore than saying it was an intuitive guess.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this