296 Miscellaneous Exercises
S
41. (a) Show that any deterministic logspace transducer can be simulated
by a family of NC circuits with multiple output wires.
(b) We showed in Theorem 6.1 that the circuit value problem (CVP) is
≤
log
m
-complete for P. Conclude from this and part (a) that CVP ∈
NC if and only if P = NC .
H
42. Consider the following Standard ML program to compute the greatest
common divisor (gcd) of two numbers m, n, not both of which are 0.
fun Euclid(m:int, n:int) : int * int * int =
ifn=0then (1,0,m)
else let
val q = m div n
val r = m mod n
val (s,t,g) = Euclid(n,r)
in
(t,s-t*q,g)
end
Here div computes the quotient and mod the remainder when dividing
m by n using ordinary integer division. Prove that the output of the
program is a triple (s, t, g), where g is the gcd of m and n and s, t are
integers such that sm + tn = g.
H
43. Let a and n be positive integers. Prove that the following are equivalent.
(i) a has an order modulo n; that is, there exists m such that a
m
≡
1(modn).
(ii) a is relatively prime to n;thatis,gcd(a, n)=1.
(iii) a is invertible modulo n; that is, there exists b,1≤ b ≤ n −1, such
that ab ≡ 1(modn).
44. Prove the following amplification lemma for IP and PCP analogous
to Lemma 14.1 for BPP and RP.IfL has an IP (respectively, PCP)
protocol that uses r(n) random bits and makes q(n) queries, then for
any ε>0, L has an IP (respectively, PCP)protocol(P, V )thatuses
kr(n) random bits and makes kq(n) queries and has error probability
bounded by ε,wherek is O(−log ε). In the case of PCP, this means
(i) if x ∈ L then Pr((P, V ) accepts x)=1,