172 ADVANCED ACCEPTANCE/REJECTION
∏
i
h
1
(r)/[r
n
n!/n
n
]=(n
n
/n!)(h
1
(r)/r)
n
. By Sterling’s inequality, n! ≥ (n/e)
n
√
2
π
n.
Hence n
n
/n! ≤ e
n
(2
π
n)
−1/2
.Sincer ≥ 1, h
1
(r)=e
−1
[r +(1/2)ln(r)+exp(1) −1],
so
h
1
(r)
r
= e
−1
1 +
(1/2)ln(r)+e −1
r
≤ e
−1
e
[(1/2) ln(r)+e−1]/r
.
Therefore,
n
n
n!
·
h
1
(r)
r
n
≤
e
n
√
2
π
n
·e
−n
exp((1 /2)ln(r)+e −1)/
γ
=(2
π
n)
−1/2
(
γ
n)
0.5/
γ
e
(e−1)/
γ
= O(n
−0.5+0.5/
γ
).
Each step requires at most n
2
operations to compute the bounds, making the
running time (on average) at most O (n
1.5+0.5/
γ
) steps.
9.2.6 Sinkhorn balancing
So how does the lower bound help when the matrix is not regular? Recall that if
a row (or column) of the matrix is multiplied by a constant, then the permanent is
multiplied by the same constant.
Therefore, by dividing each row by its sum, it is possible to make a matrix whose
row entries are all 1, and whose permanent is related in a known way to the original
matrix.
However, the column sums might not be 1. So divide the columns by their sums.
This might have messed up the rows, however. So next divide the rows by their sum.
Continue moving back and forth between rows and columns until the matrix is almost
regular. This procedure is known as Sinkhorn balancing [116].
More precisely, if X and Y are diagonal matrices, then XAY is a scaling of A
where per(A)=per(XAY)/[per(X)per(Y )]. From the definition, the permanent of a
diagonal matrix is just the product of its entries. By keeping track of the scaling done
to rows and columns at each step, when Sinkhorn balancing is ended the matrices X
and Y will be known.
The question then becomes: how many steps must be taken before the resulting
matrix is close to balanced? To answer this question, it is necessary to have a notion
of how close the matrix is to being doubly stochastic.
Definition 9.3. Say that diagonal matrices X and Y scale A to accuracy
α
if both the
row and columns sums of XAY all fall in [1 −
α
,1 +
α
].
In [75], it was shown that the ellipsoid method could be used to obtain such a
scaling in O(n
4
ln(ln(1/
α
)n/
α
)) time. While a useful theoretical result, the ellipsoid
method is very co mplex to code and can suffer from numerical instability.
In practice, simply employing the method of rescaling the rows, then the