Posts Tagged ‘ games ’

Hangman in R: A learning experience

July 28, 2012
By
Hangman in R: A learning experience

I love when people take a sophisticated tool and use it to play video games. Take R for example. I first saw someone create a game for R at talk.stats.com. My friend Dason inspired me to more efficiently waste time … Continue reading →

Read more »

Wasting away again in Martingaleville

December 1, 2011
By
Wasting away again in Martingaleville

Alright, I better start with an apology for the title of this post. I know, it’s really bad. But let’s get on to the good stuff, or, perhaps more accurately, the really frightening stuff. The plot shown at the top of this post is a simulation of the martingale betting strategy. You’ll find code for

Read more »

The fun Package: Use R for Fun!

August 16, 2011
By
The fun Package: Use R for Fun!

A couple of days ago we released a package named fun to CRAN, but I did not dare to send an announcement to [email protected] as usual. This package is a collection of some classical computer games (e.g. the Mine sweeper and Five in a row) as well as other funny stuff. Some examples: ## install.packages('fun')

Read more »

Dicetributions – episode I

May 29, 2011
By
Dicetributions – episode I

Suppose the following game with two players: In every round, the two players pick a random number, each. Instead of using a dice, they pick a number from an interval. Player A picks a number from and player B from . Variation 1. The greater number wins. Who is more likely to win? It

Read more »

Smaller or greater? – episode II

May 20, 2011
By
Smaller or greater? – episode II

In a previous post I introduced the following game: Suppose you play the following game: Someone holds a set of cards with the numbers {1,2,…,N} in random order, opens up the first card and asks if the next card is greater or smaller. Every time you predict correctly, you get one point, while every wrong

Read more »

100 Prisoners, 100 lines of code

July 9, 2010
By
100 Prisoners, 100 lines of code

In math and economics, there is a long, proud history of placing imaginary prisoners into nasty, complicated scenarios. We have, of course, the classic Prisoner’s Dilemma, as well as 100 prisoners and a light bulb. Add to that list the focus of this post, 100 prisoners and 100 boxes. In this game, the warden places

Read more »

The guessing game in R (with a twist, of course)

May 27, 2010
By

Maybe you remember playing this one as a kid. If you are about my age, you may have even created a version of this game as one of your first computer programs. You guess a number, the computer tells you if you if you are too low or high. I’ve limited the number of maximum

Read more »