Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement cube for money game #17

Open
carsten-wenderdel opened this issue Oct 14, 2023 · 2 comments
Open

Implement cube for money game #17

carsten-wenderdel opened this issue Oct 14, 2023 · 2 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@carsten-wenderdel
Copy link
Owner

carsten-wenderdel commented Oct 14, 2023

Currently the implementation is quick and super dirty: Cube if the equity is between 0.4 and 0.6. Accept if the equity is below 0.5.

This could be done much better. The article https://bkgm.com/articles/Janowski/cubeformulae.pdf could be helpful.

Of course cube for match play would also be great to have, but money game should be easier.

@carsten-wenderdel carsten-wenderdel added the help wanted Extra attention is needed label Oct 14, 2023
@carsten-wenderdel
Copy link
Owner Author

Not only Rust but als pseudo code would be appreciated. Important: you need to have the copyright, don't copy code from somewhere else.

@carsten-wenderdel carsten-wenderdel added the good first issue Good for newcomers label Oct 14, 2023
@lassehjorthmadsen
Copy link

For what it's worth, I implemented Janowski-style cubeful equity estimations for money in R, here. The file contains a list of functions, the relevant one is eq_money() This will estimate cubeful equities as a function of:

  1. Cubeless outcome probabilities (like the ones GNUBG and XG produces). They are used to calculate gammon and backgammon frequencies i.e. what proportion of wins and losses that are gammons or backgammons for each side.
  2. Cube position: 0: Center; 1: player; -1: opponent
  3. Probability of winning
  4. Cube-life index, between 0 and 1, defaults to 2/3 as suggested by Janowski

See the documentation.

Using this function, it should be straightforward to deduce cube action: E.g. offer an initial double when the equity with the opponent holding the cube is more than half the equity with a centered cube.

I did some testing of this function, but it should still be considered in development. Seems to match what GNUBG and XG does.

I don't have experiece with Rust, so it's not easy for me to translate into that language. But happy to contribute if I can in any way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants