# probability or statistics – Bootstrap to test the average between two different numbers of samples

Let's say that I have the following 2 samples (the real data do not know the probability distribution).

As in the following code, I want to investigate if there is a significant difference between the average of two samples that use the Bayes factor.
Is it necessary to equalize the number of samples to be extracted?

``````A = RandomVariate[NormalDistribution[0, 3],
twenty];
B = RandomVariate[NormalDistribution[1, 3],
100];
MeanA = HistogramDistribution[
Table[Mean[RandomChoice[A, Length[A]]],
{10000}]];
MeanB = HistogramDistribution[
Table[Mean[RandomChoice[B, Length[B]]],
{10000}]];
H0 = Flat[Table[(RandomVariate[MeanA, 1] -
Random variable[MeanA, 1]) ^ 2, {10000}]];
H1 = Flat[Table[(RandomVariate[MeanA, 1] -
Random variable[MeanB, 1]) ^ 2, {10000}]];
Qnt = Quantile[MeanA, 0.95];
Pre = Probability[X[x[X[x< Qnt, Distributed[x,
HistogramDistribution[H0]]]/
Probability[x > Qnt, Distributed[X,
HistogramDistribution[H0]]];
Post = Probability[X[x[X[x< Qnt, Distributed[x,
HistogramDistribution[H1]]]/
Probability[x > Qnt, Distributed[X,
HistogramDistribution[H1]]];
BayesFactor = Post / Pre;
``````