[This article was first published on R – Curtis Miller's Personal Website, 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.

Pat Bagley is easily my favorite political cartoonist, period. For the politically aware in Utah, he is almost legendary, enjoying superstar status. I’ve been aware of him since I was a kid, and I always loved his cartoons. Not only does his artistic style appeal to me, he has a way of illustrating a situation in politics that explains it more clearly than a thousand words. His cartoons are humorous, though darkly so. And with every one, you can’t help but feel he’s had the last word.

I was very lucky to meet Mr. Bagley in 2016. It was at PechaKucha Night 2016, hosted by the Salt Lake City chapter of Women in Architecture, a professional organization promoting the advancement of women in architecture (a profession dominated by men). My gender gap studies were making headlines throughout 2015 (you can find a list here), and the group wanted me to give a very short talk on the topic. Pat Bagley was also a speaker that night, and clearly the star attraction both to the audience and the other speakers as well. Everyone wanted a picture with Pat Bagley.

And we got one:

I did not say much to Mr. Bagley. I told him he was my favorite political cartoonist bar none. He thanked me for the compliment (I got the impression that it was one he heard frequently), and he did not mind that I would be using one of his cartoons in my presentation, one inspired by my research. But otherwise we did not talk much; mostly I just listened to him shoot the breeze with one of the other speakers, discussing politics both national and local and his disgust with the behavior of the Utah state legislature, along with life at the Salt Lake Tribune. (You can guess what he said by watching this clip from Last Week Tonight with John Oliver on the plight of local newspapers; both he and the editor of the Tribune, who I sat with at an Honor’s College fundraising dinner in 2015, have said the Tribune has felt those pressures, along with those brought on by a business deal with the LDS Church-owned Deseret News that, thankfully, no longer exists.) Every once in a while I would make a comment, but otherwise I was on the periphery. During my presentation, I gave him the shoutout he deserved, and he told me as I walked off the stage that he thought my presentation was excellent. That meant a lot to me.

Mr. Bagley, being the star attraction, presented last. His presentation consisted of describing life as a political cartoonist and showing some of his favorite cartoons, which commented on Utah political and Mormon culture and the uncomfortable relationship between the legislature and the LDS Church. (I don’t think a video of his talk exists online, unfortunately.) It was simple but enjoyable, a great end to a great night, and I am just as big a fan as ever (as is obvious by the signed cartoon below).

On October 27th of this year, the Tribune published this Bagley cartoon:

The game is clearly playable, even though it’s no more fun than a game of Shoots and Ladders (and it’s obviously not supposed to be fun; it’s supposed to make a depressing point about life for those in poverty). I saw the cartoon/board game while the students in my R lab were working on their assignments. I spent a few minutes analyzing the game, and realized its simple structure could easily be analyzed via a Markov chain. Upon that realization I had no choice but to follow through with the analysis; it was an itch that had to be scratched.

The game terminates when the player gets evicted. One could also consider “winning” the game being a state that ends the game. Eviction and a “win” can be considered absorbing states in the chain. Furthermore, other than the blue, yellow, and orange spaces, every colored space ends in eviction. The only way to “win” is to land on every grey space after the orange space (seven heads in a row, which has a probability of $\frac{127}{128} \approx 0.992$ of occurring).

Analyzing the above board, I came up with the following transition matrix, which I program into R:

gmat <- rbind(c(0, .5, .5, 0, 0, 0, 0, 0, 0, 0),
c(0, 0, .5, .5, 0, 0, 0, 0, 0, 0),
c(1, 0, 0, 0, 0, 0, 0, 0, 0, 0),
c(0, 0, 0, 0, .5, .5, 0, 0, 0, 0),
c(0, 0, 0, 0, 0, .5, .5, 0, 0, 0),
c(0, 0, 0, 0, 0, 1, 0, 0, 0, 0),
c(0, 0, 0, 0, 0, .5, 0, .5, 0, 0),
c(0, 0, 0, 0, 0, .5, 0, 0, .5, 0),
c(0, 0, 0, 0, 0, .5, 0, 0, 0, .5),
c(0, 0, 0, 0, 0, 0, 0, 0, 0, 1))


Ten states are possible, with the sixth state representing eviction and the last a “win”, both of which are absorbing states. The chain will end in either of the two states with some probability. The questions are:

1. What is the probability of ending in each of these absorbing states?
2. How long will it take to complete the game?

These are well-known problems and the solution is easy to find; in my case, I just looked up the solution on Wikipedia.

First, I extract the matrices $Q$ and $R$, as described in the Wikipedia article:

(Q  <- gmat[c(1:5,7:9), c(1:5, 7:9)])

##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
## [1,]    0  0.5  0.5  0.0  0.0  0.0  0.0  0.0
## [2,]    0  0.0  0.5  0.5  0.0  0.0  0.0  0.0
## [3,]    1  0.0  0.0  0.0  0.0  0.0  0.0  0.0
## [4,]    0  0.0  0.0  0.0  0.5  0.0  0.0  0.0
## [5,]    0  0.0  0.0  0.0  0.0  0.5  0.0  0.0
## [6,]    0  0.0  0.0  0.0  0.0  0.0  0.5  0.0
## [7,]    0  0.0  0.0  0.0  0.0  0.0  0.0  0.5
## [8,]    0  0.0  0.0  0.0  0.0  0.0  0.0  0.0

(R <- gmat[c(1:5, 7:9), c(6,10)])

##      [,1] [,2]
## [1,]  0.0  0.0
## [2,]  0.0  0.0
## [3,]  0.0  0.0
## [4,]  0.5  0.0
## [5,]  0.5  0.0
## [6,]  0.5  0.0
## [7,]  0.5  0.0
## [8,]  0.5  0.5


I also need the matrix $N = (I - Q)^{-1}$:

(N <- solve(diag(1, 8) - Q))

##      [,1] [,2] [,3] [,4] [,5] [,6]  [,7]   [,8]
## [1,]    4    2    3    1  0.5 0.25 0.125 0.0625
## [2,]    2    2    2    1  0.5 0.25 0.125 0.0625
## [3,]    4    2    4    1  0.5 0.25 0.125 0.0625
## [4,]    0    0    0    1  0.5 0.25 0.125 0.0625
## [5,]    0    0    0    0  1.0 0.50 0.250 0.1250
## [6,]    0    0    0    0  0.0 1.00 0.500 0.2500
## [7,]    0    0    0    0  0.0 0.00 1.000 0.5000
## [8,]    0    0    0    0  0.0 0.00 0.000 1.0000


This is all we need to get the information we want. The matrix containing the probability of absorption is $B = NR$, found below:

N %*% R

##         [,1]    [,2]
## [1,] 0.96875 0.03125
## [2,] 0.96875 0.03125
## [3,] 0.96875 0.03125
## [4,] 0.96875 0.03125
## [5,] 0.93750 0.06250
## [6,] 0.87500 0.12500
## [7,] 0.75000 0.25000
## [8,] 0.50000 0.50000


The first column represents the state of being “evicted”, the second “winning”. The first number in the first column represents the probability of being evicted at the start of the game. There is a better chance than it initially seemed to “win” the game, thanks to the impossibility of being evicted for a few rounds in the game; it’s after one passes the eviction square that the “point of no return” is crossed. That said, a 97% chance of losing the game every time you play hardly makes for a fun experience.

The expected number of steps until absorption is found below:

N %*% rep(1, times = 8)

##         [,1]
## [1,] 10.9375
## [2,]  7.9375
## [3,] 11.9375
## [4,]  1.9375
## [5,]  1.8750
## [6,]  1.7500
## [7,]  1.5000
## [8,]  1.0000


Well, that was fun. But is the game’s depiction realistic? No, not really. I have no data to back this up, but I’m sure that more than 3% of families in poverty keep their home by the end of the month. That said, having come from a family where life went from lower-middle-class to de facto poverty in a few years, I can say he effectively captured the unfairness.

To leave a comment for the author, please follow the link and comment on their blog: R – Curtis Miller's Personal Website.

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.

# Never miss an update! Subscribe to R-bloggers to receive e-mails with the latest R posts.(You will not see this message again.)

Click here to close (This popup will not appear again)