In local news [1] comes with information that 58% of people is for something. This information is based on option pool that ask 500 people from 10.5 million about that question. What is confidence interval for people that are for that something?
To solve this I try following. The $n$ people from $10^7$ is for something. I randomly select 500 of them and I will try to find $n_1,n_2$ for which:
$$ n_1: \frac{\binom{n_1}{290}\binom{10^7-n_1}{210}}{\binom{10^7}{500}}<0.05 $$
$$ n_2: \frac{\binom{n_2}{290}\binom{10^7-n_2}{210}}{\binom{10^7}{500}}>0.95 $$
But this is not easy to solve. So I am looking for some solvable algorithm.
[1] link