Consecutive Cashes
1. Consecutive Cashes in the World Series of Poker
This next lesson is based on the biggest poker tournament of the year, the World Series of Poker Main Event, held in Las Vegas each summer.2. World Series of Poker
In a poker tournament, all that matters is how long you have chips. If you are the first person to run out of chips, you come in last place. Prize money is awarded to those who are last to run out of chips. In a typical tournament, approximately the top 10 percent of players will win prize money, also known as cashing. In 2010 through 2014, a poker professional named Ronnie Bardah cashed all five years. He garnered much attention for doing so, and the question is, from a probabilistic standpoint, how remarkable was this?3. Simplifying assumptions
We will make some simplifying assumptions to make this problem more manageable. First, we will assume that there are exactly 6000 entrants each year and that it is the same 6000 players each year. We also assume that every player has exactly the same ability. While this is not true in reality, it will give us an idea of the probability that we could expect completely by chance.4. The intersection function
Suppose there are 20 players in a given tournament. Under our simplifying assumptions, each player has the same probability of cashing, so we can use the sample function to simulate who will cash. Suppose that in year 1, we allow 4 people to cash. We can do the same thing for the next year as well. If we want to check whether anyone cashed in both years, by checking if any individual appears in both, we can use the intersect function.5. Storing cashes as a matrix
Now, the challenge in our lesson is that we actually want the intersection of not just two years, but five consecutive years. To do this, it will help to store our results in a matrix, which is done automatically if we generate our results using the replicate function. When used along with a function that will output a vector, replicate will store each iteration in a column of a matrix. The code here demonstrates this with three years.6. The Reduce function
With our cashes stored as a matrix, we can operate on all of them together using the Reduce function. Reduce is similar to sapply, in that it will iterate a function through an object. However, it performs pairwise operations on that object, as opposed to sapply, which simply operates on each element of a vector. The input to Reduce must be a list, so we can use the list function on each column of our cashes matrix. When indexing cashes, we leave the first index blank to indicate that we want every row and then specify which column. The integer zero is returned since there is no one who cashed in all three years. More helpful to us from a coding perspective is that the length is zero. If anyone did cash in all three years, then the length of the in underscore all underscore three variable would be greater than 0.7. Let's simulate the<br> World Series of Poker!
Shuffle up and deal!Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.