A restaurant drawing setup

A few weeks ago a restaurant offered my wife and I entry into a weekly drawing for a gift certificate. They mentioned a little twist by which a first-time entrant would have their ticket remain in the pot until they win. I wondered how such a drawing would play out and if it gave us a reasonably higher chance of winning over a normal drawing in which the pot is cleared each week.

I don’t know exactly how this drawing is carried out, but let’s hypothesize the following setup: first-time entrants place a red ticket in the pot and repeat entrants place a blue ticket in the pot. Each week a ticket is drawn from the pot (the winner), and then all of the blue tickets are removed from the pot. Notice that if the blue ticket of a repeat customer is drawn, their red ticket remains in the pot. This would be the case if the restaurant didn’t bother to go through all the red tickets to find the one corresponding to the drawn blue ticket, which seems reasonable if they were doing this by hand.

Imagine that n red tickets and m blue tickets are added each week, and that Ni red tickets have built up from previous weeks. The probability that a red ticket will win the drawing is (Nin) / (Ninm), and the probability that a blue ticket will win is m / (Ninm). If a red ticket wins, Ni+1 = Nin – 1 red tickets are carried over to the next week, otherwise Ni+1Nin are carried over.

Clearly, if n > 1 then the Ni increase to infinity because Ni+1Ni every week. For the case of n = 1, we know that Ni never decreases, and that for each week there is a positive probability that it increases. Since there is always a positive probability that Ni increases, it will do so infinitely many times, and since it never decreases, it goes to infinity.

NYT: What 2,000 Calories looks like

New York Times: What 2,000 Calories looks like.

Takeaways:

  1. Make your own meals,
  2. Skip the sugary drinks,
  3. Comparing apples to oranges is horrifically unfair: Potbelly’s sandwich was a “big Italian sandwich” (looks like a 12″) with mayo weighing in at 1,088 kcal, and Subway’s was a 6″ cold-cut combo without mayo for 375 kcal. But Subway’s 6″ Italian BMT starts at 410 kcal; double that for a 12″ and add a tablespoon of mayo (110 kcal) for 930 kcal!

Itasca: a Beamer theme

I think most of the default Beamer themes look terrible. Clashing colors, inconsistencies between flat and “3D” graphics (I’m looking at you, ball bullet points), and general visual clutter bring back memories of the early 90’s internet. In my opinion, the least offensive themes are the simplest – black text on a white background, perhaps with a single blue accent color for titles, bullet points, et cetera.

Themes like this one are quite common in biostatistics presentations. Sometimes better bullet points are used. From the Beamer Theme Matrix.
Themes like this one are quite common in biostatistics presentations. Sometimes better bullet points are used. From the Beamer Theme Matrix.

The theme pictured above has a few things I like and a few I don’t.

The good:

  1. Mostly black text on white background – easy to read.
  2. Blue highlights make it easy to pick out important bits – titles and bullet points.
  3. Section titles provide context for each slide.
  4. Current page number makes it

The bad:

  1. Too many colors gets distracting.
  2. Clunky bullet points.
  3. Unnecessary information abounds – presentation title, subsection titles, author, date, total page number
  4. Presentation controls

I’ll get to an explanation of why I find points 5-8 bad, but first, here’s a slide from my own attempt at a theme:

itasca-example
Itasca theme – click to enlarge.

This slide actually looks a lot like the blog with the theme I’m currently using. Consistency, right? The full example presentation is available on GitHub.

Continue reading “Itasca: a Beamer theme”

Remembering the meaning behind the numbers

Rebecca Steorts gave a talk at the University of Minnesota this afternoon on record linkage and de-duplication with an application to the ongoing Syrian Civil War.

I often deal with survival plots like the following:

chemo-surv

While a plot like this represents deaths, I’m able to see them in the abstract in part because I can consider the deaths unavoidable. On top of that, the area between the curves communicates hope for the future in the form of improved treatments. However, Rebecca presented us with figures like the following:

By GraysonWiki & Futuretrillionaire [CC-BY-SA-3.0], via Wikimedia Commons
By GraysonWiki & Futuretrillionaire [CC-BY-SA-3.0], via Wikimedia Commons
Though not graphic, these images viscerally affected me. Each bar represents hundreds to thousands of deaths in a week that were not only unnecessary, but undeniably our (humanity’s) own fault. Today, the death toll is around 200,000.

I got into biostatistics to help to treat and prevent disease, and I felt helpless sitting in the auditorium hearing about casualties of war. Now, writing this, I realize that while my work likely won’t contribute to the prevention of war casualties, I have an opportunity to do a small part by voting carefully in the midterm election next week.

Plot that! Public trust in physicians and care satisfactions among industrialized countries

The New England Journal of Medicine published a perspective piece yesterday entitled Public Trust in Physicians – U.S. Medicine in International Perspective. The gist of the article was that surveys have indicated a sharp decline in Americans’ trust in physicians over the last fifty years. One passage that stood out to me was the following:

Indeed, the United States is unique among the surveyed countries in that it ranks near the bottom in the public’s trust in the country’s physicians but near the top in patients’ satisfaction with their own medical treatment.

The article includes a table that ranks twenty-nine industrialized countries by the percentage of people who say that their doctors can be trusted and again by the percentage of people who say that they were satisfied with the treatment they received during their last visit. The table is reproduced at the end of this post.

As much numerical information is present in the table, I think that data like this could be more easily digestible in a graphical format. Even just taking the countries and the percent estimates, we can produce the following plot.

Trust in Physicians vs Care Satisfaction

Now we can more easily see the trend between trust and satisfaction, as well as the outliers. We see that trust in physicians tends to increase with care satisfaction, as expected. Additionally, even though Americans trust their physicians less than citizens of other countries considered here, their satisfaction with the care they receive is among the highest. We can also immediately see the reverse analogue: the Taiwanese have a level of trust in their physicians on par with the primary good cluster, but are very poorly satisfied with the care they receive.

Examining the primary extremes of the distribution, we see the Netherlands, Switzerland, and Denmark performing exceptionally well in both trust and satisfaction, and Russia, Poland, and Bulgaria lagging behind in both. Finally, note the ranges of these scores: trust ranges from nearly 90% to just below 50% while satisfaction begins near 0% and breaks 60% in only two countries. Even among the best performing countries here, satisfaction with care seems fairly low.

Continue reading “Plot that! Public trust in physicians and care satisfactions among industrialized countries”

The IMDB user ratings of the mathematical thriller Travelling Salesman are unusually polarized

Today I came across the Quora question If I just proved that P = NP, how do I start taking over the world? One of the answers mentioned the 2012 film Travelling Salesman, a cerebral thriller which explores some possible ramifications of being able to solve all NP problems in polynomial time. The trailer is below.

I had seen the trailer back when the movie was first released but never ended up seeing the movie. If I recall correctly I expected it to be corny, inaccurate, or both. After watching the trailer again I headed to its IMDB page to see how it was received. I wasn’t surprised to see a “weighted average” rating of 5.6 (IMDB uses a weighting system to prevent vote stuffing). However, the user reviews were overwhelmingly positive. Curious, I checked the histogram of user ratings for the movie.

ts

Usually, the ratings of movies that are neither exceptionally highly nor exceptionally poorly rated have distributions that are roughly a truncated bell shape with small bumps at “1” and “10”, the minimum and maximum scores. A pair of examples are shown below.

pi prim

It’s generally accepted that people who have strong opinions (e.g. “1” or “10”) are more likely to rate and review, but the unusual relative size of the bumps in the distribution for Travelling Salesman make me wonder if there’s something else going on, perhaps a somewhat unique audience that has been particularly polarized by some aspect of the film. A less interesting explanation is that the groups of people who rate exceptionally high or low do so early, and as more people rate the movie, the relative size of the bumps decreases. Either way, I’m intrigued enough to watch the film sometime soon. Tonight, though, my fiancée and I have the second episode of a two-part Deep Space 9 sequence whose first episode turned out to be a cliff-hanger.

Update (October 26, 2014): We watched the movie last night, and I’m feeling more confident about the polarizing aspect hypothesis. While the mathematics were a central plot point, the movie turned out to be more about power and responsibility immediately after a proof that P=NP was found. On top of that, the movie consists almost entirely of an argument in a conference room. So, I suspect that the audience who enjoy philosophical discussions of power and politics would have enjoyed the film, the audience that was expecting either (a) math or (b) actual depiction of consequences would be disappointed. Absurdly, I was most disappointed that the details of the proof itself were never discussed.