Probability that all the children are girls given a condition

Question

A family has \(n\) children, \(n \geq 2\). What is the probability that all of their children are girls for the following cases:

a) We ask the father: “Do you have at least one daughter?” He responds “Yes!”

b) We pick one of them at random and find out that she is a girl

c) We ask the father, “Do you have at least one daughter named Lilia?” He replies, “Yes!”

Here you can assume that if a child is a girl, her name will be Lilia with probability \(\alpha \ll 1\) independently from other children’s names. If the child is a boy, his name will not be Lilia.

Answer

Let us chart down what we know:

\(E_1 \Rightarrow \text{Event that atleast one of the children is daughter}\) \(E_2 \Rightarrow \text{Event that the random child we picked was a girl}\) \(E_3 \Rightarrow \text{Event that atleast one of the children is a daughter named Lilia}\) \(G_n \Rightarrow \text{Event that all the } n \text{ children are girls}\)

To find,

\[P(G_n|E_1) \Rightarrow \text{Probability that all the children are girls given } E_1\] \[P(G_n|E_2) \Rightarrow \text{Probability that all the children are girls given } E_2\]

Let,

\[G_i \Rightarrow \text{Event that all the } i \text{ children are girls}\]

Part A

Let us calculate \(P(G_n|E_1)\):

\[P(G_n|E_1) = \frac{P(G_n \cap E_1)}{P(E_1)}\] \[P(E_1) = P(E_1 \cap G_0) + P(E_1 \cap G_1) + P(E_1 \cap G_2) + .... + P(E_1 \cap G_n)\] \[P(E_1 \cap G_i) = P(E_1|G_i)P(G_i)\] \[P(E_1 \cap G_0) = P(E_1|G_0)P(G_0) = 0\]

Then,

\[P(E_1 \cap G_1) = P(E_1|G_1)P(G_1)\]

As we know that atleast one of the children is a girl:

\[P(E_1|G_1) = 1\]

Probability of having a single girl child considering all the combinations possible:

\[P(G_1) = \frac{1}{2^n}*{}^n \mathrm{ C }_1\]

So,

\[P(E_1 \cap G_1) = \frac{1}{2^n}*{}^n \mathrm{ C }_1\]

The above can be generalized as following:

\[P(E_1 \cap G_i) = \frac{1}{2^n}*{}^n \mathrm{ C }_i\]

So,

\[P(E_1) = \frac{1}{2^n}*\sum_{i=1}^n {}^n \mathrm{ C }_i\]

Using binomial expansion for \((1 + x)^n\) we find that the summation is equal to \(2^{n} - 1\)

\[P(E_1) = \frac{2^n - 1}{2^n}\] \[P(G_n|E_1) = \frac{P(G_n \cap E_1)}{P(E_1)}\] \[\begin{aligned} P(G_n|E_1) &= \frac{\frac{1}{2^n}*{}^n \mathrm{ C }_n}{\frac{2^n - 1}{2^n}} \end{aligned}\] \[\boxed{P(G_n|E_1) = \frac{1}{2^n - 1}}\]

Part B

Let us calculate \(P(G_n|E_2)\):

\[P(G_n|E_2) = \frac{P(G_n \cap E_2)}{P(E_2)}\] \[P(E_2) = P(E_2 \cap G_0) + P(E_2 \cap G_1) + P(E_2 \cap G_2) + .... + P(E_2 \cap G_n)\] \[P(E_2 \cap G_i) = P(E_2|G_i)P(G_i)\] \[P(E_2 \cap G_0) = P(E_2|G_0)P(G_0) = 0\]

Then,

\[P(E_2 \cap G_1) = P(E_2|G_1)P(G_1)\]

As we pick the child randomly and turns out to be a girl:

\[P(E_2|G_1) = \frac{1}{n}\]

Probability of having a single girl child considering all the combinations possible:

\[P(G_1) = \frac{1}{2^n}*{}^n \mathrm{ C }_1\]

So,

\[P(E_2 \cap G_1) = \frac{1}{2^n}*\frac{1}{n}*{}^n \mathrm{ C }_1\]

The above can be generalized as following:

\[P(E_2 \cap G_i) = \frac{1}{2^n}*\frac{i}{n}*{}^n \mathrm{ C }_i\]

So,

\[P(E_2) = \frac{1}{2^n}*\frac{1}{n}*\sum_{i=1}^n i*{}^n \mathrm{ C }_i\]

Using binomial expansion for \((1 + x)^n\) we find that the summation is equal to \(n*2^{n-1}\)

\[P(E_2) = \frac{1}{2}\] \[P(G_n|E_2) = \frac{P(G_n \cap E_2)}{P(E_2)}\] \[\begin{aligned} P(G_n|E_2) &= \frac{\frac{1}{2^n}*\frac{n}{n}*{}^n \mathrm{ C }_n}{\frac{1}{2}} \end{aligned}\] \[\boxed{P(G_n|E_2) = \frac{1}{2^{n-1}}}\]

Part C

Let us calculate \(P(G_n|E_3)\):

\[P(G_n|E_3) = \frac{P(G_n \cap E_3)}{P(E_3)}\] \[P(E_3) = P(E_3 \cap G_0) + P(E_3 \cap G_1) + P(E_3 \cap G_2) + .... + P(E_3 \cap G_n)\] \[P(E_3 \cap G_i) = P(E_3|G_i)P(G_i)\] \[P(E_3 \cap G_0) = P(E_3|G_0)P(G_0) = 0\]

Then,

\[P(E_3 \cap G_1) = P(E_3|G_1)P(G_1)\]

To calculate \(P(E_3|G_1)\) we know that the probability that atleast one girl is named \(Lilia\) is same is the complement of the probability that no girl is named \(Lilia\).

\[P(E_3|G_1) = 1 - P({E_3}^c|G_1)\] \[P({E_3}^c|G_1) = (1 - \alpha)^1\] \[P(E_3|G_1) = 1 - (1 - \alpha)^1\]

Probability of having a single girl child considering all the combinations possible:

\[P(G_1) = \frac{1}{2^n}*{}^n \mathrm{ C }_1\]

So,

\[P(E_3 \cap G_1) = \big[1 - (1 - \alpha)\big]*\frac{1}{2^n}*{}^n \mathrm{ C }_1\]

The above can be generalized as following:

\[P(E_3 \cap G_i) = \big[1 - (1 - \alpha)^i\big]*\frac{1}{2^n}*{}^n \mathrm{ C }_i\]

So,

\[P(E_3) = \frac{1}{2^n}*\sum_{i=1}^n \big[1 - (1 - \alpha)^i\big]*{}^n \mathrm{ C }_i\] \[P(E_3) = \frac{1}{2^n}* \Big[ \sum_{i=1}^n {}^n \mathrm{ C }_i - \sum_{i=1}^n (1 - \alpha)^i*{}^n \mathrm{ C }_i \Big]\]

Using binomial expansion for \((1 + x)^n\) we find that:

\[\sum_{i=1}^n {}^n \mathrm{ C }_i = 2^n - 1\] \[\sum_{i=1}^n (1 - \alpha)^i*{}^n \mathrm{ C }_i = (2 - \alpha)^n - 1\] \[P(E_3) = \frac{1}{2^n}*\big[ 2^n - 1 - ((2 - \alpha)^n - 1) \big]\] \[P(E_3) = \frac{1}{2^n}*\big[ 2^n - (2 - \alpha)^n \big]\] \[P(G_n|E_3) = \frac{P(G_n \cap E_3)}{P(E_3)}\] \[P(G_n \cap E_3) = \big[1 - (1 - \alpha)^n\big]*\frac{1}{2^n}*{}^n \mathrm{ C }_n\] \[\begin{aligned} P(G_n|E_3) &= \frac{\big[1 - (1 - \alpha)^n\big]*\frac{1}{2^n}*{}^n \mathrm{ C }_n}{\frac{1}{2^n}*\big[ 2^n - (2 - \alpha)^n \big]} \end{aligned}\] \[\boxed{P(G_n|E_3) = \frac{1 - (1 - \alpha)^n}{2^n - (2 - \alpha)^n}}\]

References

  1. Probability course chapter 1 problems (Problem 37 & 39 & 38)
  2. Finding the sum: \(\sum_{i=1}^n i*{}^n \mathrm{ C }_i\)

Will it be HEADS ?

Question

A box contains two coins: a regular coin and one fake two-headed coin (\(P(H)=1\)). I choose a coin at random and toss it \(n\) times. If the first \(n\) coin tosses result in heads, what is the probability that the \((n+1)^{th}\) coin toss will also result in heads?

Answer

Let us chart down what we know:

\[A \Rightarrow \text{Event that first 'n' tosses are heads}\] \[C_1 \Rightarrow \text{Event that regular coin is chosen}\] \[\text{Probability of heads given regular coin, } P(H|C_1) = \frac{1}{2}\] \[C_2 \Rightarrow \text{Event that two-headed coin is chosen}\] \[\text{Probability of heads given two-headed coin, } P(H|C_2) = 1\]

To find,

\[B \Rightarrow \text{Event that } (n + 1)^{th} \text{ toss is heads}\]

Now, let’s calculate the probability of event \(A\) happening for each of the coins:

\[P(A|C_1) = \frac{1}{2}*\frac{1}{2}*\frac{1}{2}*\text{...n times} = \frac{1}{2^n}\] \[P(A|C_2) = 1*1*1*\text{...n times} = 1\]

\(P(A) = P(A \cap C_1) + P(A \cap C_2)\) \(P(A) = P(A|C_1)P(C_1) + P(A|C_2)P(C_2)\) \(P(A) = \Big[\frac{1}{2^n}*\frac{1}{2}\Big] + \Big[1*\frac{1}{2} \Big] = \frac{1}{2}*\Big[\frac{1}{2^n} + 1\Big]\)

Now, before we calculate \(P(B)\), we first need to know the probability of the coin based on \(n\) observations of heads. Also, one needs to note that \((n+1)^{th}\) toss is independent of other tosses, so we have:

\[P(B) = P(C_1|A)P(H|C_1) + P(C_2|A)P(H|C_2)\]

where,

\[P(C_1|A) \rightarrow \text{Probability that regular coin is chosen given the event A}\] \[P(C_2|A) \rightarrow \text{Probability that two-headed coin is chosen given the event A}\]

Now, let’s calculate, \(P(C_1|A) \text{ & } P(C_2|A)\)

\[P(C_1|A) = \frac{P(A \cap C_1)}{P(A)}\] \[P(C_1|A) = \frac{\frac{1}{2^n}*\frac{1}{2}}{\frac{1}{2}*\Big[\frac{1}{2^n} + 1\Big]} = \frac{1}{2^n + 1}\] \[P(C_2|A) = \frac{P(A \cap C_2)}{P(A)}\] \[P(C_2|A) = \frac{\Big[1*\frac{1}{2} \Big]}{\frac{1}{2}*\Big[\frac{1}{2^n} + 1\Big]} = \frac{2^n}{2^n + 1}\]

\(P(C_2|A)\) shows us that, higher the \(n\), closer will be probability that two-headed coin is chosen to \(1\).

Now plugging the above values will give,

\[P(B) = \frac{1}{2^n + 1}*\frac{1}{2} + \frac{2^n}{2^n + 1}*1\] \[\boxed{P(B) = \frac{2^{n+1} + 1}{2^{n+1} + 2}}\]

So, the probability \(P(B)\) tends to \(1\) as \(n\) tends to \(\infty\).

References

  1. Probability course chapter 1 problems (Problem 36)

Is this email a SPAM ?

Question

One way to design a spam filter is to look at the words in an email. In particular, some words are more frequent in spam emails. Suppose that we have the following information:

  • \(50\%\) of emails are spam
  • \(1\%\) of spam emails contain the word “refinance”
  • \(0.001\%\) of non-spam emails contain the word “refinance”

Suppose that an email is checked and found to contain the word “refinance”. What is the probability that the email is spam?

Answer

Let’s chart down the data we know from the question:

\[S \Rightarrow \text{Event that the email is spam}\] \[P(S) = 0.5 \implies P(S^c) = 0.5\] \[P(R) \Rightarrow \text{Probability that email contains the word "refinance"}\]

Given,

\[P(R \cap S) = \frac{1}{100}\] \[P(R \cap S^c) = \frac{0.001}{100}\]

So,

\[P(R) = P(R \cap S) + P(R \cap S^c) = \frac{1.001}{100}\]

To find, \(P(S|R) \Rightarrow \text{Probability that email is spam given that it contains the word "refinance"}\)

\[P(S|R) = \frac{P(S \cap R)}{P(R)} = \frac{\frac{1}{100}}{\frac{1.001}{100}} = \frac{1}{1.001}\] \[\therefore P(S|R) = 0.999000999\]

One important observation, we see that “refinance” word occurs only \(1\%\) of the time in spam emails, but since this occurrence (\(P(R \cap S)\)) forms larger chunk of the total occurrence (\(P(R)\)), we see the probability of the email being spam is \(0.999\) if it contains the word “refinance”.

But this is not what we would have thought firstly, based on our intuition. Solving such problems will extend our common sense by mathematical means, this extends to lots of things happening around us. How Not To Be Wrong by Jordan Ellenberg is a book encouraging such thinking.

References

  1. Probability course chapter 1 problems (Problem 31)
  2. How Not To Be Wrong

Solving a Probability puzzle

Introduction

Here I explain about the approach to solve a probability puzzle. I was very happy when I could crack this not so difficult but a bit confusing (for me) puzzle from the android app mentioned in the reference. This is puzzle number 12 of the EASY PEASY section.

Question

Assumption: Probabiltiy of boy being born is 0.51 and that of girl being born is 0.49, and births are independent.

You’re a researcher interested in large families: as part of your latest project, you’ve decided to interview 50 families in which there are exactly eight children. The graph below illustrates the possible outcomes for a single family. What’s the probability that you find one or more families in which the children are all of same gender (i.e. all boys or all girls) ?

png

Approach and Answer

Here it is easy to find the probability such that all the families does not have children of same gender which is actually the complement of the probabilty of our interest.

So, we first get the probabiltiy of a family that not all children are of same gender.

\[E_{11} \Rightarrow \text{Probability that all children in the family are of boys}\] \[P(E_{11}) = 0.51^8\] \[E_{12} \Rightarrow \text{Probability that all children in the family are of girls}\] \[P(E_{12}) = 0.49^8\] \[E_1 \Rightarrow \text{Probability that all children in the family are of same gender}\] \[P(E_1) = P(E_{11}) + P(E_{12})\] \[P(E_1) = ( 0.49^8 + 0.51^8 )\] \[E_2 \Rightarrow \text{Probability that all children in the family are NOT of same gender}\] \[P(E_2) = 1 - P(E_1)\] \[P(E_2) = 1 - ( 0.49^8 + 0.51^8 ) = 0.9920999\]


\[\text{Now, that we got probability for $\textbf{a}$ family, we extend this to $\textbf{50}$ families.}\]


\[E_3 \Rightarrow \text{Probability that no family has children of same gender}\] \[P(E_3) = (P(E_2))^{50} = 0.672621\]


Here, we have the probabiltiy that no family has children of same gender. To get the probability that atleast one family has all children of same gender, we just need to subtract the above probability from 1.

\[E_4 \Rightarrow \text{Probability atleast one family has all children of same gender}\] \[P(E_4) = 1 - P(E_3) = 0.3273787\]

Here, we need to understand that events \(E_3\) and \(E_4\) are complement to each other, i.e., \(E_4\) occurs only when \(E_3\) does not occur.

So, probability that atleast one family has all children of same gender is \(0.3273787\).

References

  1. Probability puzzles android app

Learning Probability

Introduction

Topics

  1. Set theory
  2. Random experiments
  3. Combinatorics

References

  1. Online probability course
  2. Probability puzzles android app

To-Do

  1. Add more links and references as and when I finish reading and understanding concepts and topics.