We present a randomized approximation algorithm for counting contingency tables, m × n non-negative integer matrices with given row sums R = (r1, . . . , rm) and column sums C = (c1, . . . , cn). We define smooth margins (R,C) in terms of the typical table and prove that for such margins the algorithm has quasi-polynomial NO(lnN) complexity, where N = r1 + · · · + rm = c1 + · · · + cn. Various ...