Detecting Unfair Dice in Casinos with Bayes’ Theorem


I saw an interesting problem that requires Bayes’ Theorem and some simple R programming while reading a bioinformatics textbook.  I will discuss the math behind solving this problem in detail, and I will illustrate some very useful plotting functions to generate a plot from R that visualizes the solution effectively.

The Problem

The following question is a slightly modified version of Exercise #1.2 on Page 8 in “Biological Sequence Analysis” by Durbin, Eddy, Krogh and Mitchison.

An occasionally dishonest casino uses 2 types of dice.  Of its dice, 97% are fair but 3% are unfair, and a “five” comes up 35% of the time for these unfair dice.  If you pick a die randomly and roll it, how many “fives”  in a row would you need to see before it was most likely that you had picked an unfair die?”

Read more to learn how to create the following plot and how it invokes Bayes’ Theorem to solve the above problem!

unfair die plot

Read more of this post

Sulfur Dioxide, Sulfur Trioxide and Acid Rain: Pollution from Burning Coal


It is well known that burning coal produces carbon dioxide, which contributes to the accumulation of greenhouse gases in the Earth’s atmosphere and, according to the Intergovernmental Panel on Climate Change, is a major source of anthropogenic global warming and climate change.  However, burning coal releases 2 other drastic but lesser known pollutants - sulfur dioxide and sulfur trioxide - which are responsible for numerous health problems and acid rain.


Bituminous Coal – A low-grade coal with high sulfur content

Source: “Minerals and Materials Photo Gallery”,  U.S House Subcommittee on Energy and Natural Resources

via Wikimedia

Read more of this post


Get every new post delivered to your Inbox.

Join 248 other followers