0
$\begingroup$

I am trying to find a formula to check if the sample size (10) I am using to check the runtime of an algorithm is enough for the current system and system load.

I am collecting 10 samples of algorithm run time and claiming that the mean value is the runtime of the algorithm. But I want to use mean, standard deviation to reverse calculate how many samples I need to take in a particular system to make sure mean value is within 95% confidence level to the population mean. I want to increase and rerun the algorithm with calculated sample size needed. Eg: I may have to run the algorithm 20 times now.

Problem is we don't know the population size.

I checked Find sample size for 95% of confidence given variance

According to the link, if I want the 5% error margin of the current mean and to have 95% confidence sample size $N$ can be calculated like this.

$$ N = \frac{1.96^2}{\left(0.05 \times mean\right)^2} \times \left(\frac{n_0}{n_0 -1}\right)\times Z_c $$ $$ n_0 = 10 \\ Z_c \quad \text{is standard deviation of the samples} $$

But I have been using and equation I learned from my bachelors which I am now unable to find the source.

$$ N = \lceil\frac{1.96 \times Z_c}{0.05 \times mean}\rceil $$

Can someone clarify if this is valid in this context and correct and what to use? I think we can assume the observations follow a normal distribution.

$\endgroup$

0

You must log in to answer this question.

Browse other questions tagged .