Chess simulation requiring seemingly intractable Algebra

This topic is 2122 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

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 on other sites
[Edit: disregard the following post. I see now the problem]

Looks like a problem for Wolfram!

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]

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 on other sites

B) they might not even count as two equations/two variables

What do you mean by this? I thought you were solving for 3 variables: x,y, and z

Share on other sites

y = sqrt(x * z) though so there are only 2 variables.

I had a go on pencil and paper but it was looking hairy. The sqrt makes it much more complicated so I agree, use wolfram alpha.

Share on other sites

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 on other sites

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 on other sites

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.

• Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 9
• 11
• 15
• 21
• 26