If $a$ and $b$ are any two numbers chosen uniformly at random from the set of integers $$\{1,2,3,\ldots,39\}$$ then the probability $7a-9b=0$ is?

I don't get how to relate to the condition $7a-9b=0$. Can somebody help?

  • 1
    $\begingroup$ Is the choice $a=b$ possible (even if it does not satisfy the equation), or must $a$ and $b$ be different? $\endgroup$ Apr 26, 2018 at 15:48
  • $\begingroup$ may or may not be the same.Be specific to the wordings of questions which permits both. $\endgroup$ Apr 26, 2018 at 15:50
  • $\begingroup$ Although independence seems implied by uniformity, you should probably specify it. $\endgroup$
    – Brian Tung
    Apr 26, 2018 at 16:11

4 Answers 4


You will notice that if $$a=9n,b=7n$$ where $n$ is some positive integer, then $$7a-9b=0$$

The largest possible $n$ in this case is $4$.

Thus the pairs of $(a,b)$ you can have are $$(9,7),(18,14),(27,21),(36,28)$$

Finding the probability shouldn't be an issue.

$$p=4\cdot\frac1{39}\cdot\frac1{38}=\frac2{741}$$ if each number is chosen once only $$p=4\cdot\frac1{39}\cdot\frac1{39}=\frac4{1521}$$ if each number may be chosen twice.

  • $\begingroup$ 4/741 isn't it right? $\endgroup$ Apr 26, 2018 at 15:53
  • $\begingroup$ You missed a 2 its 39C2 in combination $\endgroup$ Apr 26, 2018 at 15:54

The problem is the find probability that the two numbers are solutions of the equation $7a-9b=0$. Set \begin{eqnarray} [39]&=&\{1,2,3,\ldots,38,39\}\\ E&=&\left\{(a,b): a,b\in [39]\right\}\\ A&=&\left\{(a,b)\in E : 7a-9b=0\right\} \end{eqnarray} Notice that if $7a-9b=0$, then $$ a=9\frac{b}{7}, $$ i.e. $b=7k$. Taking into account the fact that $a,b \in [39]$, we get $k=1,2,3,4$ in other words $$ A=\{(9, 7),(18,14),(27, 21),(36,28)\} $$ The probability is therefore $$ p(A)=\frac{|A|}{|E|}=\frac{4}{39^2}\approx 0.002629 $$


We have that $a = \frac97 b$ and since $a$ is a positive integer $b$ must be a positive multiple of $7$. The possible values of $b$ are hence $\{7,14,21,28,35\}$, with corresponding values of $a$ in $\{9,18,27,36,45\}$.

Since $45$ is outside our set, the possible $(a,b)$ pairs are hence

$$\{(7,9), (14,18), (21,27), (28, 36)\}$$

That's $4$ valid $(a,b)$ pairs. The total number of $(a,b)$ pairs is $39^2$ and hence the probability is $$\frac4{39^2}\simeq 0.263\%.$$


Solve the integer equation $7a-9b=0$:

$7a=9b\Rightarrow 9|a$ because $GCD(7;9)=1$.

Let $a=9k$ ($k$ is a positive integer because $a\ge 1$) then $b=\dfrac{7a}{9}=7k.$

  • $k=1\Rightarrow a=9;b=7$

  • $k=2\Rightarrow a=18;b=14$

  • $k=3\Rightarrow a=27;b=21$

  • $k=4\Rightarrow a=36;b=28$

  • $k\ge 5\Rightarrow a\ge 45;b\ge 35$, the result is invalid.

There are only four pairs out of $\dfrac{39!}{2!37!}$ possible pairs satisfy the equation.

If repetitions are allowed then there are $39^2$ ways to choose pairs of numbers, not $\dfrac{39!}{2!37!}$.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .