# Confidence Intervals meaning [duplicate]

Lets say I know population std. deviation $\sigma=5$ and sample size $n=60$. Now lets say my sample mean is $\overline{X}=98$. I already know from central limit theorem that 95% of the time the sample mean will lie in the range of 1.96 std. dev. from population mean $\mu$. With this I can estimate the range of population mean. Now lets say my sample is extremely bad by chance(note my sample size isnt that big) i.e. all are outliers to the right or all to the left (such that its outside 95%). Now my sample mean is way off the population mean. Using this if I now estimate the population mean the range wont obviously have the population mean but I will say that it contains the population mean with 95% confidence but thats not the case. Am I missing something??

The idea is the following: If you would resample again and again from the same population and calculate your confidence interval the same way, then roughly $95\%$ of the confidence intervals will contain the true population mean. This does not guarantee that YOUR confidence interval contains the true value.

And furthermore I think you should make yourself clear that $95\%$ confidence and $100\%$ confidence, or analogously $100\%$ probability and $95 \%$ probability are not the same. Just because the confidence interval has a high probability of containing the true population mean, does not mean that it is impossible that it is not the case.

With this I can estimate the range of population mean

Population mean is unknown but it's assumed to be a constant. You don't have a range of population means.

but I will say that it contains the population mean with 95% confidence but thats not the case

Your 95% confidence interval is not an indication that the population mean is inside the interval. You don't know because the population mean is unknown. The definiton from wikipedia:

The confidence interval can be expressed in terms of samples (or repeated samples): "Were this procedure to be repeated on numerous samples, the fraction of calculated confidence intervals (which would differ for each sample) that encompass the true population parameter would tend toward 90%.