Why do two different population sizes result in nearly equal sample sizes? I have calculated the sample size for two different populations, N1= 29414 and N2= 625 (see code below). Why do I almost get the same sample size n1= 380 and n2= 239. There is not much difference, although the population size is very different...
#z-score (confidence level) 95%
z = 1.96

#Sample proportion)
p = .5

#Margin of error
e = .05

#population size
N1= 29414
N2= 625


# calculate sample size for finite population
Sam= function(z, p, e, N) {
  n = (z^2*p*(1-p)*N)/(z^2*p*(1-p)+N*e^2)
  return(n)
}
Sam(z,p,e,N1)

 A: You learn two things from sampling from a population:

*

*You know the exact answer from the members of the population you sampled (which constrains what the overall population answer can be).

*You learn something about the distribution for the population.

What's the difference between (2) and (1)? Imagine if you were interested about a population, but you could never sample from this population, instead you can get samples from a population with the same properties (but no members of the two populations overlap). You can still get (2) from this second population, but not (1).
On the other hand, the first effect (1) reaches its largest effect, if you sample every member of the population, you know the exact answer for the whole population then.
Now, at some point, once a population is large enough, the first effect (1) becomes almost irrelevant (while it is much more influential for small populations). Then, everything you learn comes from the second effect (2) and for that, the sample size does not really depend on the population size (i.e. you tend towards the limit of an infinite population size).
A: This is really just a comment, but I'll post it as an answer to be able to include the code and plot.
One thing that might yield some insight would be to plot the Sam result from the function, across a range of population N values.
z = 1.96
p = .5
e = .05

Sam= function(z, p, e, N) {
  n = (z^2*p*(1-p)*N)/(z^2*p*(1-p)+N*e^2)
  return(n)
}

M = c(1, 3, 5, 10, 20, 50, 100, 200, 500, 1000, 3000,
      1e4, 3e4, 1e5, 3e5, 1e6, 3e6, 1e7)

n = length(M)
Y = rep(NA, n)

for(i in 1:n){
 Y[i] = Sam(z,p,e, M[i])
}
plot(M, Y, xlab="Population N", ylab="Sample size", log="x")


