We present a near-optimal reduction from approximately counting the cardinality of a discrete set to approximately sampling elements of the set. An important application of our work is to approximating the partition function Z of a discrete system, such as the Ising model, matchings or colorings of a graph. The standard approach to estimating the partition function Z(β∗ ) at some desired inverse temperature β∗ is to define a sequence, which we call a cooling schedule, β0 = 0 < β1 < · · · < β = β∗ where Z(0) is trivial to compute and the ratios Z(βi+1)/Z(βi) are easy to estimate by sampling from the distribution corresponding to Z(βi). Previous approaches required a cooling schedule of length O∗ (ln A) where A = Z(0), thereby ensuring that each ratio Z(βi+1)/Z(βi) is bounded. We present a cooling schedule of length = O∗ ( √ ln A). For well-studied problems such as estimating the partition function of the Ising model, or approximating the number of co...