From Adam Wagner comes a curious case of colonies:
You are studying a new strain of bacteria, Riddlerium classicum (or R. classicum, as the researchers call it). Each R. classicum bacterium will do one of two things: split into two copies of itself or die. There is an 80 percent chance of the former and a 20 percent chance of the latter.
If you start with a single R. classicum bacterium, what is the probability that it will lead to an everlasting colony (i.e., the colony will theoretically persist for an infinite amount of time)?
Extra credit: Suppose that, instead of 80 percent, each bacterium divides with probability p. Now what’s the probability that a single bacterium will lead to an everlasting colony?
Each R. classicum bacterium will do one of two things: split into two copies of itself with probability $p$ or die with probability $1-p$.
Let the probability of colony extinction be $D$. This probability is the sum of $1-p$, representing death of the initial bacterium, and $p\cdot D^2$, representing the probability that the progeny line from each offspring also goes to extinction. This yields:
$$D= (1 - p) + p\cdot D^2$$
$$0= pD^2 - D + (1 - p)$$
Factoring:
$$0 = (pD - (1 - p))(D - 1)$$
$$0 = (pD + p - 1)(D - 1)$$
$$0 = (p(D + 1) - 1)(D - 1)$$
Solving the left factor:
$$p(D + 1) = 1$$
$$D = \frac{1}{p}-1$$
However, in order to have an Everlasting colony, D is constrained:
$$1 > \frac{1}{p} - 1 ≥ 0$$
$$2 > \frac{1}{p} ≥ 1$$
$$\frac{1}{2} < p ≤ 1$$
For $0 ≤ p ≤ \frac{1}{2}$, $D = 1$, from the earlier right factor, meaning Extinction is certain. For $p = 0.8$, the probability of an Everlasting Colony is:
$$1 - (\frac{1}{p} - 1) = 2 - \frac{1}{p} = 2 - \frac{1}{.8} = \frac{3}{4} = 0.75$$from IPython.display import Image
Image(filename = 'R.Classicum.png')
#Create a list of probabilities.
xvals = [p/1000 for p in range(0, 1001)]
#Initiate empty lists.
extinction = []
everlasting = []
for x in xvals :
if x < 0.5 :
#Certainty for p < 1/2.
extinction.append(1)
everlasting.append(0)
else :
#Probabilities from above calculations.
extinction.append((1 / x) - 1)
everlasting.append(2 - (1 / x))
import matplotlib.pyplot as plt
plt.figure(figsize = (12, 7.5))
#Everlasting and Extinction lines, along with answer.
plt.plot(xvals, everlasting, c = 'green', linewidth = 5, label = "Everlasting", zorder = 1)
plt.plot(xvals, extinction, c = 'blue', linewidth = 5, label = "Extinction", zorder = 2)
plt.scatter(0.8, 0.75, c = 'purple', linewidth = 10, zorder = 3)
plt.annotate('(0.8, 0.75)',
xy = (0.8, 0.78),
xytext = (0.6, 0.9),
fontsize = 12,
arrowprops = dict(facecolor = 'purple',
connectionstyle = "angle3, angleA = 0, angleB = 90"))
#Set titles and axes.
plt.title("Colony End Behavior of Riddlerium Classicum", fontsize = 24)
plt.xlabel("Probability of Division (R. Classicum)", fontsize = 18)
plt.ylabel("Probability of End Behavior", fontsize = 18)
#Set legend.
plt.legend(title = "End Behavior", fontsize = 12).get_title().set_fontsize(18)