[This article was first published on R – Xi'an's Og, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
The optimal strategy is to follow A while the score is zero, C when the score is 3, and B otherwise. The corresponding winning probability is 0.8548, as checked by the following code
win=function(n=1,s=0){ if(n==4)return((s==3)+.4*(!s)+.8*(s==2)) else{return(max(c( .4*win(n+1,s+3)+.3*win(n+1,s+1)+.3*win(n+1,s), .1*win(n+1,s+3)+.8*win(n+1,s+1)+.1*win(n+1,s), win(n+1,s))))}}
To leave a comment for the author, please follow the link and comment on their blog: R – Xi'an's Og.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.