Question 10.16: Prove that for any integer p > 1, if p isn’t pseudoprime,...

Prove that for any integer p > 1, if p isn’t pseudoprime, then p fails the Fermat test for at least half of all numbers in Zp+Z^{+}_{p}.

The blue check mark means that this solution has been answered and checked by an expert. This guarantees that the final answer is accurate.
Learn more on how we answer questions.

Call a a witness if it fails the Fermat test for p; that is, if ap1≢1a^{p-1} \not\equiv 1  (mod p).
Let ZpZ^{*}_{p} be all numbers in {1, . . . , p − 1} that are relatively prime to p. If p isn’t pseudoprime, it has a witness a in ZpZ^{*}_{p}.

Use a to get many more witnesses. Find a unique witness in ZpZ^{*}_{p} for each nonwitness. If d ∈ ZpZ^{*}_{p} is a nonwitness, you have dp11d^{p-1}\equiv 1 (mod p). Hence (da mod p)p1≢1(da  mod  p)^{p-1} \not\equiv 1 and so da mod p is a witness. If  d1d_{1} and d2d_{2} are distinct nonwitnesses in ZpZ^{*}_{p}, then d1ad_{1} a mod p d2a\neq d_{2}a mod p. Otherwise, (d1d2)a0(d_{1}-d_{2}) a\equiv 0 (mod p), and thus (d1d2)a=cp(d_{1}-d_{2}) a = cp for some integer c. But d1d_{1} and d2d_{2} are in ZpZ^{*}_{p}, and thus (d1d2)<p(d_{1}-d_{2})\lt p, so a=cp/(d1d2)a= cp/ (d_{1}-d_{2}) and p have a factor greater than 1 in common, which is impossible because a and p are relatively prime. Thus, the number of witnesses in ZpZ^{*}_{p} must be as large as the number of nonwitnesses in  ZpZ^{*}_{p}, and consequently at least half of the members of ZpZ^{*}_{p} are witnesses.

Next, show that every member b of Zp+Z^{+}_{p} that is not relatively prime to p is a witness. If b and p share a factor, then beb^{e} and p share that factor for any e>0e \gt 0. Hence bp1≢1b^{p-1} \not\equiv 1 (mod p). Therefore, you can conclude that at least half of the members of Zp+Z^{+}_{p} are witnesses.

Related Answered Questions

Question: 10.7

Verified Answer:

If M is a probabilistic TM that runs in polynomial...