TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Hacking “Chutes and Ladders” using R

80 pointsby jsvinealmost 10 years ago

7 comments

etermalmost 10 years ago
I don&#x27;t want to knock the article, since this kind of exploration is fun and well written blogs are always a joy to read.<p>But knowing some statistics, the entire of Snakes and Ladders is an absorbing markov chain [1] and can be very quickly analyzed as such without having to resort to sampling.<p>Random sampling is easy but take a step back and the entire state space is an integer in [1,100]. (Actually there are fewer than 100 states because the bottom of a ladder or top of a snake isn&#x27;t a state).<p>The state transitions are very easy to model, they&#x27;re just 1&#x2F;6 to each of the 6 next states (sometimes fewer, in which case they just add).<p>Having constructed our markov chain, we can instantly and accurately get back our time-to-victory from each square.<p>[1] <a href="http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Absorbing_Markov_chain" rel="nofollow">http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Absorbing_Markov_chain</a>
评论 #9687974 未加载
评论 #9689323 未加载
评论 #9687968 未加载
baldfatalmost 10 years ago
Great read. I have one suggestion:<p>Get better games.<p>My 5 year old LOVES King of Tokyo playing with me as a family. <a href="https:&#x2F;&#x2F;boardgamegeek.com&#x2F;boardgame&#x2F;70323&#x2F;king-tokyo" rel="nofollow">https:&#x2F;&#x2F;boardgamegeek.com&#x2F;boardgame&#x2F;70323&#x2F;king-tokyo</a><p>Also Animal Upon Animal is a fun game with my kid. It is a stacking game with animals and kids love it. <a href="https:&#x2F;&#x2F;boardgamegeek.com&#x2F;boardgame&#x2F;17329&#x2F;animal-upon-animal" rel="nofollow">https:&#x2F;&#x2F;boardgamegeek.com&#x2F;boardgame&#x2F;17329&#x2F;animal-upon-animal</a><p>There are so many good games for kids and almost no one knows about them.
评论 #9687843 未加载
评论 #9687762 未加载
minimaxiralmost 10 years ago
As a note for the quantative analysis aspect of the code, I <i>strongly</i> recommend looking into dplyr, especially since you have very many subset and column-wise operations: <a href="http:&#x2F;&#x2F;cran.rstudio.com&#x2F;web&#x2F;packages&#x2F;dplyr&#x2F;vignettes&#x2F;introduction.html" rel="nofollow">http:&#x2F;&#x2F;cran.rstudio.com&#x2F;web&#x2F;packages&#x2F;dplyr&#x2F;vignettes&#x2F;introdu...</a><p>I almost quit R due to the tedious verbosity of the default syntax, but dplyr made it simple and fast.
mturmonalmost 10 years ago
Previously, related posts:<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=3386970" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=3386970</a><p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6323427" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6323427</a><p>The first of these is more sophisticated than the current post, because it calculates the distributions analytically using the fact that the move sequence is Markov and the transition matrix is known. So, exact probabilities can be found.
cschmidtalmost 10 years ago
That is just the analysis I think about doing every time I play Chutes and Ladders with my daughter. I think &quot;I should just simulate this game, it would be much more fun.&quot;
评论 #9687919 未加载
Mitchhhsalmost 10 years ago
Thanks for this awesome analysis. I&#x27;ve been wanting to do a simulation of how much of Settlers of Catan is luck vs skill. Has anyone seen an analysis like this completed?
评论 #9688619 未加载
errtnsdalmost 10 years ago
The same topic on: <a href="http:&#x2F;&#x2F;datagenetics.com&#x2F;blog&#x2F;november12011&#x2F;" rel="nofollow">http:&#x2F;&#x2F;datagenetics.com&#x2F;blog&#x2F;november12011&#x2F;</a> with more in depth explanations.