Let $T$ be an exponential random variable with parameter $\lambda$. In this post, we are going to find the expected value of $\text{min}(T,1)$ with four different method each of which is beautiful in its own way.
Yours Aye
Me
Let $T$ be an exponential random variable with parameter $\lambda$. In this post, we are going to find the expected value of $\text{min}(T,1)$ with four different method each of which is beautiful in its own way.
Consider the problem of finding the probability of not finding a pair (not two consecutive cards of the same rank) from a well shuffled pack. We already discussed this problem in this post where I could this stackexchange post that uses Generating function to solve the problem.
I was eventually able to understand the Generating function approach in the SE post. I'll postpone that for a later post as we'll be looking at something equally interesting in this post. We'll be using the usual well known approach that is indispensable in this type of problems.
Using the ideas in the SE post, we see that the probability of not finding a pair in a pack of well shuffled deck is given by the integral,
$\displaystyle \mathbb{P}(\text{No pair})=\frac{1}{52!}\int_0^\infty e^{-z} (z^4-12z^3+36z^2-24z)^{13}\,dz$
Notice that this is not exactly in the form given in the SE post but we'll probe how the two expressions are equivalent in a later post. For now, let's focus just on the integral. Let,
$\displaystyle I_{4,n}=\int_0^\infty e^{-z} (z^4-12z^3+36z^2-24z)^n\,dz$
To apply Lapalce's method, we manipulate the above like as shown below.
$\displaystyle I_{4,n}=\int_0^\infty e^{n(-z/n+\ln(z^4-12z^3+36z^2-24z))}\,dz$
We now need the value of $z=z_0$ where the function $f(z)=-z/n+\ln(z^4-12z^3+36z^2-24z)$ is maximized. Here's where things get a little interesting.
Even though, it seems to be very hard to find the exact value of $z_0$, with some experimentation, it seems $z_0 \approx 4n+3$ for large $n$.
Expanding $f(z)$ at $z=4n+3$ and keeping terms upto $O(n^{-1})$, we see thatUsing the Normal approximation, we then have,
$I_{4,n} \approx e^{-4n-3}(256n^4-288n^2-96n+9)^n\sqrt{2\pi}\sqrt{4n}$
Let $\mathbb{P}_{j,n}(\text{No Pair})$ be the probability of getting no pair in a pack of $nj$ cards where each card has an integer from $1$ to $n$ and each integer has $j$ cards. Then,
$\displaystyle\mathbb{P}_{j,n}(\text{No Pair})=\frac{I_{j,n}}{(nj)!}$
Using Stirling's approximation, we know that
$n!~\approx \sqrt{2\pi n}e^{-n}n^n$
Therefore,
$\displaystyle \mathbb{P}_{4,n}(\text{No Pair})\approx \frac{e^{-4n-3}(256n^4-288n^2-96n+9)^n\sqrt{2\pi}\sqrt{4n}}{\sqrt{2\pi}\sqrt{4n}e^{-4n}(4n)^{4n}}$
Simplifying further, we get
$\displaystyle \mathbb{P}_{4,n}(\text{No Pair})\approx e^{-3}\left(1-\frac{288n^2+96n-9}{256n^4}\right)^n\approx e^{-3}\left(1-\frac{9}{8n}\right)$
Doing this for different $j$, I was able to see that, in general,
$\displaystyle \mathbb{P}_{j,n}(\text{No Pair})\approx e^{1-j}\left(1-\frac{(j-1)^2}{2nj}\right)$
The famous Laplace Sunrise problem asks for the probability of the sun rising tomorrow given that it has risen for the past $n$ days. In this post, we generalize this problem to a setup where the population size is finite and how it changes the required probability.
Mathematically, we are looking for the posterior distribution of the unknown parameter $p$ such that
$X|p \sim \text{Bin}(n,p)$ and $p \sim \text{Beta}(\alpha,\beta)$
Let's say we shuffle a standard 52-card deck and draw cards one by one looking for.consecutive cards that form a pair (two cards with the same rank).
I was interested in this question after seeing this StackExchange post. Though the post does not offer an exact solution, the approximate solution given there was really interesting. When I solved the question finding the exact solution, I was really surprised by how good the approximation is.
In this post, we will solving a similar question both exactly and approximately. We are interested in the expected number of draws without replacement before drawing two Aces in a row.
Just to be clear, there may be cases we exhaust all the cards without finding two Aces in a row. In these cases, the number of cards drawn will obviously be 52.
Let $N$ be the random variable indicating the number of draws and we want $\mathbb{E}(N)$.
To solve this in exact form, we first need the probability of drawing $j$ Aces when drawing $k$ cards from the deck such that the Aces are not together. Let's denote this event by $T_{j,k}$. Then it is easy to see that,
$\displaystyle\mathbb{P}(T_{j,k})=\mathbb{P}(j\text{ Aces in }k\text{ draws})\mathbb{P}(\text{Aces are not consecutive})$
The first term is textbook Hypergeometric. For the second term, we lay the $k-j$ non-Ace cards giving us $k-j+1$ spaces between them. We simply have to $j$ spaces out of these for the Aces. Therefore,
$\displaystyle\mathbb{P}(T_{j,k})=\frac{\binom{4}{j}\binom{48}{k-j}}{\binom{52}{k}}\cdot \frac{\binom{k-j+1}{j}}{\binom{k}{j}}$
Factorial moments are defined as the expected value of the falling factorial of a random variable. In this post, we are going to try to compute the (scaled) Factorial moments of certain distributions without a direct computation.
The Factorial moment of a random variable $X$ is given by
$$\mathbb{E}[(X)_r]=\mathbb{E}[X(X-1)(X-2)\cdots (X-r+1)]$$
For our purposes, we focussing on the following definition which differs from the above only by a constant factor.
$$\displaystyle\mathbb{E}\left[\binom{X}{r}\right]=\mathbb{E}\left[\frac{(X)_r}{r!}\right]$$
Let's start with the famous Binomial distribution. The Binomial random variable $X$, with parameters $n$ and $p$, is the number of successes in a sequence of $n$ independent draws (with replacement), each with a success probability $p$.
Taking a cue from Problem of 7 of Strategic Practice 8 of Stat 110, $\binom{X}{k}$ denotes the set of draws where all the draws in the set result in a success. Creating an Indicator random variable for each set and using the linearity of expectations, we have
$$\displaystyle\mathbb{E}\left[\binom{X}{k}\right]=\binom{n}{k}\cdot p^k$$
We now move on to the Hypergeometric distribution (which is exactly the Stat 110 problem quoted above). Let $X$ denote the number of white balls from an Urn containing $N$ balls of which $K$ are white in a sample of $n$ draws. This is exactly the same problem given in Stat 110 quoted above.
$$\displaystyle\mathbb{E}\left[\binom{X}{k}\right]=\binom{n}{k}\cdot \frac{\binom{K}{k}}{\binom{N}{k}}$$
That is, we've considered an Indicator random variable for each $k$-set of draws and used the Linearity of Expectation. Note that $X$ is the number of successes where a 'success' is viewed as draw that gives a white ball.
Alternately, we can view a 'success' as a white ball that gets drawn. This way, we can solve the problem by considering an Indicator random variable for each $k$-set of white balls. Then,
$$\displaystyle\mathbb{E}\left[\binom{X}{k}\right]=\binom{K}{k}\cdot \frac{\binom{k}{k}\binom{N-k}{n-k}}{\binom{N}{n}}$$
Again, using the Linearity of Expectation, we restrict our attention to only a particular $k$-set of white balls. The probability that we are interested is that this particular set gets drawn when drawing $n$ balls. This is again a Hypergeometric distribution where only this particular set constitute 'successes' and rest are considered failures.
We now get to the Negative Binomial distribution with parameter $p$ and $j$ where $X$ denotes the number of failures we encounter before the $r$'th success. It can be verified with direct calculation that
$$\displaystyle\mathbb{E}\left[\binom{X}{k}\right]=\binom{k+r-1}{k}\left(\frac{q}{p}\right)^k$$
While the calculation is itself is not hard, I could not get a nice 'story' proof for the above. Rather we come back to this problem after the next case.
We now move to the Negative Hypergeometric distribution which will be most interesting aspect of this post. Here, again in the context of Urn and balls, $X$ denotes the number of black balls (failures) we get before the $r$'th white ball (success) from a population of $N$ balls in which $K$ are white.
Here again, $\binom{X}{k}$ denotes the $k$-set of draws that are black balls (failures) that gets drawn before the $r$'th white ball (success). Let $I_j,j \in \{1,2,\cdots,N-K\}$ be $1$ if the $j$th black ball (failure) gets drawn before the $r$'th white ball (success) and $0$ otherwise. Let the indicator random variable $I_S$ be the product of all the indicator random variable in the set $S$. Then,
$\displaystyle\mathbb{E}\left[\binom{X}{k}\right] =\sum_{S_k \subset \{1,2,\cdots,N-K\}}\mathbb{E}(I_{S_k})=\binom{N-K}{k}\mathbb{E}(I_1I_2\cdots I_k)=\binom{N-K}{k}\mathbb{P}(E)$
where $S_k$ denotes a $k$-element subset and $E$ denotes the event that failures $1$ to $k$ occur before the $r$'th success.
In other words, the probability that we want is the probability that we draw (without replacement) $k$ specific black balls from a bag containing $K$ white balls and $N-K$ black balls before the $r$'th white ball. This is a nice question by itself.
Consider an Urn with $A$ green balls and $B$ red balls. Two players A and B play a game where they draw balls from this Urn one at a time (without replacement). If the drawn ball is green, Player A gets a point. Else, Player B gets a point.
If Player A needs $a$ points to win the game whereas Player B needs $b$ points, the question that we address in this post concerns the probability that Player A wins the match.
As the title says, this is just the Problem of points but without replacement. We've already encountered the problem in our blog in the post titled A note on Partial fractions where we saw how Pascal and Fermat independently solved the problem with different reasoning.
Interestingly, Pascal reasoning involves the (CDF of) Neg. Binomial distribution whereas Fermat's idea involves the (CDF of) Binomial distribution. The central insight in both their ideas is in realising that we'll need a maximum of $a+b-1$ games to conclude the match.
Let's consider the original Problem for points for a moment. If we let $p$ and $q$ represent the probability of A and B winning a single game, then using Pascal's idea,
$\displaystyle \mathbb{P}(\text{A wins the match})=\sum_{k=0}^{b-1}\binom{k+a-1}{k}p^aq^k$
where the individual terms are probabilities from the Neg. Binomial distribution, $NB(a,p)$.
Using Fermat's idea,
$\displaystyle \mathbb{P}(\text{B wins the match})=\sum_{k=b}^{a+b-1}\binom{a+b-1}{k}q^kp^{a+b-1-k}$
where the individual terms are probabilities from the Binomial distribution, $B(a+b-1,p)$.
Now using our discussion about the Neg. Hypergeometric distribution in the previous case and Pascal's idea, we could solve the Without-Replacement case of the Problem of points. Or we could go for simplicity and use the Hypergeometric distribution and Fermat's idea.
Either way, let $P(A,a,B,b)$ be the probability Player A winning the game in the setup described at the start of the post and $M$ be a very large number. It should be clear the classical case can be derived out of this setup as $P(pM,a,qM,b)$ with $p+q=1$.
Obviously, when $A=B$ and $a=b$, either player has an equal chance of winning because of symmetry. Similarly, when $A=B$ and $a<b$, Player A has an advantage. Same goes when $a=b$ and $A>B$.
But consider $p(50,25,40,20)$. Player A has 10 more balls than Player B but needs 5 more points to win the game. It isn't immediately clear whether this is advantageous to Player A or not? In this case, the probability of Player A winning the match is only (approx.) 49.07%.
Naturally, we might think as we break symmetry, the match skews towards one way. Perhaps the most surprising result about the Without-Replacement case of Problem of points is the one family of parameters that form an exception.
Consider $p(21, 11, 19, 10)$. Player A has two more balls than Player B but needs one extra point to win the match. Surprisingly, this match is evenly poised. Not just this, for positive integer $n$,
$\displaystyle p(2n+1,n+1,2n-1,n)=\frac{1}{2}$
Clearly, the parameters that define the game lacks symmetry. Still the game is evenly poised between the two players. I could neither come up with a reason nor a simple explanation of why this should be the case? If you can, please post it in the comments below.
I wanted to create a post about the Hypergeometric distribution, one of the most important distributions in probability theory, as a prelude to my next post.
The probability mass function of a Hypergeometric distribution with parameters $N$, $K$ and $n$ is given by
$\displaystyle f(k;N,K,n)=\mathbb{P}(X=k)=\frac{\binom{K}{k}\binom{N-K}{n-k}}{\binom{N}{n}}$
The distribution has several symmetries which will be the key content of this post.
To start with, the role of successes and failures could be swapped. In terms of probability, this means that $f(k;N,K,n)=f(n-k;N,N-K,n)$. The binomial coefficients in the numerator of $f(k;N,K,n)$ gets swapped with this transformation.
In the next setup, the role of drawn and not drawn elements could be swapped. In terms of probability, this gives $f(k;N,K,n)=f(K-k;N,K,N-n)$. This amounts to invoking the symmetry of the binomial coefficient $^nC_k=^nC_{n-k}$.
Finally, the role of drawn elements and successes could be swapped as well. In probability terms, this becomes $f(k;N,K,n)=f(k;N,n,K)$. In other words,
$\displaystyle \mathbb{P}(X=k)=\binom{n}{k}\frac{\binom{N-n}{K-k}}{\binom{N}{K}}$
I find this pretty for two reasons. Firstly, there are two 'nCk' terms with the lowercase pair in the numerator and the uppercase in the denominator which gives it a nice structure. Secondly, and most importantly, this brings out the parallel with the Binomial distribution.
Comparing the probability of $k$ successes which we have above with that of a $\text{Bin}(n,k)$, we have,
$\displaystyle \frac{\binom{N-n}{K-k}}{\binom{N}{K}} \approx \left(\frac{K}{N}\right)^k\left(1-\frac{K}{N}\right)^{n-k}$
where $N \gg n$ and ratio of $K$ and $N$ is finite. This can be seen as an asymptotic expression for the ratio of two binomial coefficients.
To make better use of this asymptotic expression, let $K=pN$ and $p+q=1$. Then, the above can be rewritten as
$\displaystyle p^iq^j \approx \frac{\binom{N-i-j}{K-i}}{\binom{N}{K}}$
Lastly, all the above symmetries can be brought under a single umbrella by using beautiful idea from Duality and Symmetry in the Hypergeometric distribution. Surprisingly, this idea is relatively unknown. The authors show that the probability associated with the Hypergeometric distribution can also be written as,
$\displaystyle \mathbb{P}(X=k)=\binom{N}{k,n-k,K-k}\bigg/ \binom{N}{n}\binom{N}{K}$
where the numerator should be understood as the multinomial coefficient.
Finally, we come to visit the lesser known relative of the Hypergeometric distribution - the Negative Hypergeometric distribution. Just like the Hypergeometric parallels the Binomial, the Neg. Hypergeometric parallels the Neg. Binomial distribution.
We could use the exact idea of Neg. Binomial to derive the probability expression for Neg. Hypergeometric. But considering what we've seen so far, we could do better.
Let $Y$ be a Neg. Binomial variable that counts number of failures encountered until the $r$th success and $W$ be the corresponding Neg. Hypergeometric variable. We know that
$\displaystyle \mathbb{P}(Y=k)=\binom{k+r-1}{k}p^rq^k$
Now we just have to make use of the asymptotic expression above to derive the same for the Neg. Hypergeometric case. We have,
$\displaystyle \mathbb{P}(W=k)=\binom{k+r-1}{k}\frac{\binom{N-k-r}{K-r}}{\binom{N}{K}}$
Neat, isn't it?