Relevance of opinion poll (500 people from 10.5 millions) 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
 A: Computing confidence intervals for binomial proportions is an interesting problem that has attracted quite a bit of research. None of the proposed confidence intervals  take the population size into account. You can start here: http://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval
Some of the proposed confidence intervals for your problem are (computed using Stata):
. cii 500 290, wald

                                                         -- Binomial Wald ---
    Variable |        Obs        Mean    Std. Err.       [95% Conf. Interval]
-------------+---------------------------------------------------------------
             |        500         .58    .0220726        .5367385    .6232615

. cii 500 290, exact

                                                         -- Binomial Exact --
    Variable |        Obs        Mean    Std. Err.       [95% Conf. Interval]
-------------+---------------------------------------------------------------
             |        500         .58    .0220726        .5353716    .6236769

. cii 500 290, wilson

                                                         ------ Wilson ------
    Variable |        Obs        Mean    Std. Err.       [95% Conf. Interval]
-------------+---------------------------------------------------------------
             |        500         .58    .0220726        .5362895    .6224906

. cii 500 290, agresti

                                                         -- Agresti-Coull ---
    Variable |        Obs        Mean    Std. Err.       [95% Conf. Interval]
-------------+---------------------------------------------------------------
             |        500         .58    .0220726        .5362852    .6224949

. cii 500 290, jeffreys

                                                         ----- Jeffreys -----
    Variable |        Obs        Mean    Std. Err.       [95% Conf. Interval]
-------------+---------------------------------------------------------------
             |        500         .58    .0220726        .5363799    .6226969

