The formulas concerning the calculation of the sample size to estimate a proportion $p$ in for finite populations are provided on this website. It also contains the derivations.
In short, the sample size necessary for estimating a population proportion $p$ of a finite population with $(1-\alpha)100\%$ confidence and a margin of error no larger than $\epsilon$ is:
$$
n = \frac{m}{1+\frac{m-1}{N}}
$$
where
$$
m=\frac{z_{1-\alpha/2}^{2}\hat{p}(1-\hat{p})}{\epsilon^{2}}.
$$
$N$ denotes the population size, $z_{1-\alpha/2}$ the $(1-\alpha/2)$-quantile of the standard normal distribution and $\hat{p}$ the estimated proportion.
For $N=580, \alpha=0.05, \epsilon=0.1, \hat{p}=0.5$ (i.e. 95% confidence), we get $n\approx 83$. If we take $\alpha = 0.1$ which corresponds to 90% confidence, we get $n\approx 61$.
The more precise we want our estimate of the popultion proportion to be, the higher our sample size needs to be.
This means that the lower $\alpha$, the higher the necessary sample size will be. The following graph illustrates this (for $N=580, \epsilon=0.1, \hat{p}=0.5$):
The necessary sample size will also increase with decreasing margin of error $\epsilon$ (note the reversed $x$-axis; graph for $N=580, \alpha=0.05, \hat{p}=0.5$):
In order to find the required sample size $n,$ you need a confidence level (such as $.95 = 95\%)$ and a margin
of error (such as $\pm .03 = \pm 3\%).$
So that an explicit answer to your question doesn't get lost in a
longer explanation of confidence intervals: No. There's no restriction that the confidence level
and the margin of error must add to $1.$
The calculator in the link also asks for a population size, but that
is not important unless you're thinking you might sample more than 10%
of the population. So if this is for a nationwide poll in a large
country with millions of eligible subjects, you can ignore that
part. (If you're using the calculator in the link, you'd enter
something like $10\,000\,000).$
The margin of error for a 95% confidence interval from a poll is
$\pm 1.96\sqrt{\frac{p(1-p)}{n}},$ where $n$ is the sample size
and $p$ is the true population proportion with the relevant attribute
(such as favoring Proposition A on in an upcoming election).
The margin of error is the proportion (percentage in your link)
that determines the width of your confidence interval. Maybe you'd
like to say that the true proportion is $0.55 \pm 0.03$ or $55\% \pm 3\%.$
Then $E = .03 = 3\%.$
Not knowing $p,$ you could either guess what $p$ might be,
or take the worst case, which is $p = 1/2$ (giving the largest possible
margin of error). Then for a 95% confidence interval (CI), you'd have
a CI of the form $\hat p \pm E.$ So $E=1.96\sqrt{\frac{p(1-p)}{n}}.$
If you're taking $p = 1/2,$ then you have $E = 1.96\sqrt{.25/n} \approx 1/\sqrt{n}.$
So, if $E = 3\%,$ then $n \approx 1/(.03^2) = 1111$ subjects.
Note: Here's why I say that $p = 1/2$ is the 'worst case', leading to the largest
margin of error. The factor $Q = p(1 - p)$ in the margin of error reaches its
maximum when $p = 1/2.$ So the margin of error $E$ is maximized when $p = 1/2$ and for a fixed value of $E$ that leads to the largest required $n.$
plot(p, Q, type="l", lwd=2)
abline(v = 1/2, col="green2")
Best Answer
Assume a sample size of 200, with mean (mu) = 20, and standard deviation (sigma) = 10.
I'm using Python for this example, but you can see that we are:
1) generating an array of 200 normally distributed random numbers
2) Obtaining the 25th and 75th quantile.
Now, when you say "90% margin of error", I am assuming you mean a 90% "confidence interval". In this case, your margin of error is 10%.
Using the scipy library (also from Python), we can obtain a 90% confidence interval as follows:
More detail can be found on the above here.
You can now see that we generate an array where the values would fall within the 90% confidence interval:
The above is obviously dependent on which software you are using and what dataset you are working with, but hopefully you might find these guidelines useful.