Homepage Solution manuals Ivan Niven An Introduction to the Theory of Numbers Exercise 2.2.7 ( Probability that $ax \equiv b \pmod{15}$ has at least one solution)

Exercise 2.2.7 ( Probability that $ax \equiv b \pmod{15}$ has at least one solution)

If a is selected at random from 1 , 2 , 3 , , 14 , and b is selected at random from 1 , 2 , 3 , , 15 , what is the probability that ax b ( mod 15 ) has at least one solution? Exactly one solution?

Answers

Proof.

a)
By theorem 2.17, we know that the congruence ax b ( mod 15 ) has at least one solution if and only if 15 a b .

For each fixed a [ [ 1 , 14 ] ] , the number of b [ [ 1 , 15 ] ] such that 15 a b is 15 15 a .

Therefore, the number of ordered pairs ( a , b ) [ [ 1 , 14 ] ] × [ [ 1 , 15 ] ] such that ax b ( mod 15 ) has at least one solution is

N = a = 1 14 15 15 a = 146 .

Sage :

     sum(15//gcd(a,15) for a in range(1,15))

The probability p that ax b ( mod 15 ) has at least one solution is

p = N 14 × 15 = 146 210 = 73 105 0.695

b)
The congruence ax b ( mod 15 ) has exactly one solution if a 15 = 1 .

Therefore, the number N of a [ [ 1 , 14 ] ] such that ax b ( mod 15 ) has exactly one solution is ϕ ( 15 ) = 8 , and the probability p is

p = N 14 = 8 14 = 4 7 0.571

User profile picture
2024-08-18 16:13
Comments