chance

Discussion of chess software programming and technical issues.

Moderator: Ras

flok

chance

Post by flok »

Hi,

I'm wondering: is there a way of estimating the chance that if first move x is played, that after that move y is played?
If so: how?
flok

Re: chance

Post by flok »

flok wrote:Hi,

I'm wondering: is there a way of estimating the chance that if first move x is played, that after that move y is played?
If so: how?
To clarify: I'm not looking for the chance that e.g. e7-e5 is played after e.g. e2-e4; i'm looking for the chance that if at ply 1 there are 20 moves and on ply 2 there are e.g. 32, what is the chance that at ply 2 a certain move is played.
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: chance

Post by stegemma »

flok wrote:
flok wrote:Hi,

I'm wondering: is there a way of estimating the chance that if first move x is played, that after that move y is played?
If so: how?
To clarify: I'm not looking for the chance that e.g. e7-e5 is played after e.g. e2-e4; i'm looking for the chance that if at ply 1 there are 20 moves and on ply 2 there are e.g. 32, what is the chance that at ply 2 a certain move is played.
If you play randomly, the change is equal to the number of possible couple of moves that contains your move and the total number of couple of moves. For sample:

1) e4 e5
2) e4 e6
3) e4 Nf6
4) d4 e5
5) d4 e6

these are 5 couples of moves and the probability of the move e5 is:

2/5
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
flok

Re: chance

Post by flok »

Ah thanks!
User avatar
Luis Babboni
Posts: 464
Joined: Sat Feb 28, 2015 4:37 pm
Location: Argentina

Re: chance

Post by Luis Babboni »

BTW, are chess engines deterministics?
I mean, have some engines random behavior in some cases or always do the same in the same circumstances?
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: chance

Post by stegemma »

Luis Babboni wrote:BTW, are chess engines deterministics?
I mean, have some engines random behavior in some cases or always do the same in the same circumstances?
The problem is defining "in the same circumstances". If considered literally then the answer is "yes". The "in the same circumstances" would mean that:

- you start from the same position (obviously)
- the code remains unchanged
- the random generator eventually used starts from the same seed
- anything happens in the same laps of time

If you change even a single condition, then the engine could change its behavior.
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
kbhearn
Posts: 411
Joined: Thu Dec 30, 2010 4:48 am

Re: chance

Post by kbhearn »

most engines these days running in single threaded mode are almost deterministic. they don't have any intentional randomness and thus will search the same tree in the same order and the only difference is how much clock time vs real processor time they take before they have to move and that shouldn't change the move very often. You will get slightly different games as one move changed is enough to change everything after it. If they have a nodes-based-time mode that would make singlethreaded operation deterministic.

once you add a second thread that goes out the window as it's no longer about the total amount of time they have to search but the timing of each thread compared to the other - and that will vary. this then leads to different hash table contents each time you reach a node, different cuts taken, different accidental superpositions, and it's very likely that games will diverge before too long.
User avatar
Luis Babboni
Posts: 464
Joined: Sat Feb 28, 2015 4:37 pm
Location: Argentina

Re: chance

Post by Luis Babboni »

Thanks!

What is this "random generator"?
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: chance

Post by stegemma »

Luis Babboni wrote:Thanks!

What is this "random generator"?
It's a function that generates random numbers. In effect, it is a pseudo-random generator because giving an initial number (the "seed") the generated sequence is always the same. Often the seed is choose from the current date/time, so you have new sequence at any run of the program.

The pseudo-random sequence is not perfect but is good enough for our engines.
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com