Probability of compositions/ Dependency of standard deviation on sample size

30 Views Asked by At

I have following problem. Given is a 2 component solution with components A and B=1-A.

I now want to know the probability of certain compositions for a given mean composition. So if the mean composition is 50/50, how is the probability for your sample to be 90/10?

So obviously, this is a normal distribution where the expectation value is the mean composition $\mu=\frac{A}{1-A}$. The problem is the standard deviation. $\sigma$ has to be a function of A as well, since the normal distribution is getting more narrow the closer A gets so 0 or 1, because if A is 1 or 0 the probability to pick B is equal 0 or respectively equal 1.

So i didn't know how to get to this analytically, but with brute force I found that $\sigma=f(mean(A))$ must somehow be described by the function of an ellipsoid, with its center at A=0.5.

So I wanted to fit that function, when I came to the problem, that $\sigma$ is not only a function of mean(A), but also depends on my sample size N. The larger the sample, the smaller $\sigma$...

So, is there somehow an analytical solution to get $\sigma=f(mean(A),N)$?

Many thanks in advance

Best regards Marc

EDIT: Code to compare normal approximation to binomial and brute force enter image description here

close all

cmp=0.5; mean composition

draws=50; numbers of balls per draw

var=draws cmp (1-cmp); varianz

x=linspace(0,1,101);

y=1/sqrt(var2pi)exp(-0.5(x-cmp).^2/var); normal distribution to binomial distribution

figure subplot(1,2,1)

plot(x,y,'r-')

same but brute force with 10000 draws each 50 balls subplot(1,2,2) cmp=0.5; draws=50;

histogram(sum(rand(draws,10000)>cmp,1)/draws,[0:0.01:1])