# Distribution of a two-part sampling process

I have a known distribution $$f(x)$$ (in fact, I can safely assume that $$f(x)$$ is the Maxwell-Boltzmann distribution, i.e. $$f(x)\propto x^2 \exp(-x^2)$$). I take $$N$$ samples from the distribution, but am only interested in a subset of these samples: samples that are larger than $$x_0$$ (a fixed and known value). I'll denote the number of samples that satisfy this condition $$M$$, and the subset itself I'll denote $$X_{x_0}$$. For each of the $$M$$ samples in $$X_{x_0}$$, I perform a Bernoulli trial with a constant probability $$p$$. What I'm interested to know is the variance of the number of successful trials. So, my two questions are:

1. Am I correct in thinking that the distribution of the number $$M$$ (number of samples larger than $$x_0$$) is binomial: $$f(M) = B(N,p_{x_0})$$, where $$p_{x_0} = \int_{x_0}^{\infty} f(x)dx$$? (I assume I'm correct, but I'm never sure when it comes to probability theory and statistics).
2. Second, and more important question: is there an expression of the variance of the number of successful trials? Or perhaps it's possible to derive a closed-form expression for the distribution of the number of successful trials? So I assume it would depend on three parameters: number of initial samples $$N$$, probability $$p_{x_0}$$ of a sample exceeding the treshold value $$x_0$$, and probability $$p$$ of a successful Bernoulli trial.

Thanks!

For each $$x_i$$ of the $$N$$ samples you perform simultaneously two checks: Is $$x_i$$ larger than $$x_0$$ (with probability $$p_{x_0}$$ and then your Bernoulli trial with probability $$p$$. Assuming independence of this trial and the check $$x_i > x_0$$ the probability is $$p \cdot p_{x_0}$$ that you have a successful trial. Thus (assuming independence of the particles) $$B(N,p \cdot p_{x_0})$$ is the distribution of successful trials with expectation $$N \cdot p \cdot p_{x_0}$$ and variance $$N \cdot p \cdot p_{x_0} \cdot (1- p \cdot p_{x_0})$$.