Probability | Conditional | Joint Poisson


Question

Suppose that the number of people who visit a yoga studio each day is a Poisson random variable with mean \(\lambda\). Suppose further that each person who visits is, independently, female with probability \(p\) or male with probability \(1−p\). Find the joint probability that exactly \(n\) women and m men visit the academy today.


Solution

Dissecting the problem. I will try giving a brief explanation of the solution here. For a high detail of the problem, please refer to the text. Notice that there a constraint on the sum itself but \(n\) and \(m\) themselves could be variables given that they add up-to a number. The probability that we need can be denoted as follows. \[P\{N_1=n, N_2=m\} = \overset{\infty}{\underset{i=0}{\Sigma}} P\{N_1=n, N_2=m | N = i\} P\{N=i\}\] where \( N = N_1 + N_2\). The probability that \(P\{N=i\}\) is a poisson distribution shown as \[e^{-\lambda} \frac{λ^{n+m}}{(n+m)!}\] Since there are two components to the poisson count, we need to introduce a binomial here and simplifying them we get two probabilities as \[P\{N_1=n\} = e^{-\lambda p} \frac{(\lambda p)^n}{n!}\] \[P\{N_2=m\} = e^{-\lambda q} \frac{(\lambda q)^m}{m!}\]

Reference: Sheldon Ross Probability Modelling Edition 10


Simulations

Approach to the simulations for this problem



    ClearAll[genderDivide]

    genderDivide[n_, p_: 0.5] :=
     Module[{genderDivide =
        RandomChoice[{p, 1 - p} -> {0, 1}, n]}, {Count[genderDivide, 0],
       Count[genderDivide, 1]}]

    Table[
     Module[{plot},
      plot = BarChart[
        Plus @@@
         GatherBy[
          genderDivide[#, p] & /@
           Sort@RandomVariate[PoissonDistribution[5], 10000],
          Total@# &],
        ChartLayout -> "Stacked",
        LabelingFunction -> (Placed[Rotate[#, 90 \[Degree]], Above] &),
        Frame -> True,
        PlotLabel -> Style["Probability for females = " <> ToString@p, 20],
        FrameLabel -> (Style[#, 15] & /@ {"Stacked Counts",
            "Total number of people"}),
        ImageSize -> 788, ChartLegends -> {"Female", "Male"}];
      Export[StringReplace[NotebookFileName[],
        ".nb" -> "_stacked_chart_" <> ToString[Round[10 p]] <> ".svg"],
       plot,
       ImageSize -> 1000, ImageResolution -> 800]
      ]
     , {p, 0.1, 0.9, 0.1}]


Theoretical Probabilities with Special Cases

Full Code