Talk:Pig the dice game/Player: Difference between revisions

Content added Content deleted
(→‎Strategy: Random play as a baseline.)
Line 30: Line 30:
return max(chance_roll, chance_yield) // choose better prospect</lang>
return max(chance_roll, chance_yield) // choose better prospect</lang>
Note that this is a recursive relation, and the P function can't be evaluated just like that due to infinite recursions. There are ways around it by doing matrix iterations or some such, assuming a single function for probability makes sense -- depending on the game type, it's possible that there's no optimal strategy, in which case either the probability matrix won't converge, or there could be multiple stable solutions, etc. I don't think that happens for this game, but calculating the matrix can still be quite daunting. --[[User:Ledrug|Ledrug]] 06:01, 15 September 2012 (UTC)
Note that this is a recursive relation, and the P function can't be evaluated just like that due to infinite recursions. There are ways around it by doing matrix iterations or some such, assuming a single function for probability makes sense -- depending on the game type, it's possible that there's no optimal strategy, in which case either the probability matrix won't converge, or there could be multiple stable solutions, etc. I don't think that happens for this game, but calculating the matrix can still be quite daunting. --[[User:Ledrug|Ledrug]] 06:01, 15 September 2012 (UTC)

:Hi Ledrug, Sounds good but I don't want to add a particular strategy to the task description so that people can at least try something that they find easy to code. --[[User:Paddy3118|Paddy3118]] 11:28, 15 September 2012 (UTC)

I should at least include a strategy of random play in my solution so that I can gauge any other strategy against it.--[[User:Paddy3118|Paddy3118]] 11:28, 15 September 2012 (UTC)