Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Chess simulation requiring seemingly intractable Algebra


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 sooner123   Members   -  Reputation: 241

Like
0Likes
Like

Posted 08 December 2013 - 06:09 AM

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, 08 December 2013 - 06:12 AM.


Sponsor:

#2 CulDeVu   Members   -  Reputation: 1018

Like
0Likes
Like

Posted 08 December 2013 - 11:00 AM

[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 :)
I'm sorry about any spelling or grammar mistakes or any undue brevity, as I'm most likely typing on my phone :P

#3 CulDeVu   Members   -  Reputation: 1018

Like
0Likes
Like

Posted 08 December 2013 - 11:18 AM

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
I'm sorry about any spelling or grammar mistakes or any undue brevity, as I'm most likely typing on my phone :P

#4 Paradigm Shifter   Crossbones+   -  Reputation: 5439

Like
0Likes
Like

Posted 08 December 2013 - 11:26 AM

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.


"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#5 Álvaro   Crossbones+   -  Reputation: 13933

Like
0Likes
Like

Posted 08 December 2013 - 12:36 PM


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?



#6 Álvaro   Crossbones+   -  Reputation: 13933

Like
1Likes
Like

Posted 08 December 2013 - 12:46 PM

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, 08 December 2013 - 12:49 PM.


#7 sooner123   Members   -  Reputation: 241

Like
0Likes
Like

Posted 29 December 2013 - 09:42 PM

 

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.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS