Three numbers are chosen at random between 1 and $n$ (say $n=500$).What will be the probability of those numbers to be in arithmetic progression?
I don't know how to count the number of favorable events. Sample space={(1,2,3),(4,5,6),(18,20,21)........} favorable events={(2,4,6),(8,12,16),(10,20,30),(50,100,150... and many more)} I can count the sample space but how do i count the favorable events. Some insight could help?
I have assumed that three randomly chosen numbers are distinct.
Let $d$ be the common difference of the arithmetic progression. Then it is easy to see that $d$ must take an integer value between $1$ and $249$ inclusive. So for any one of these $d$ values, let $a$ be the smallest of the trio in the arithmetic progression. Then we just have to count the number of distinct $a$s we can have for each $d$.
First let's consider $d=1$, then $a$ can be between $1$ and $498$.
For $d=2$, $a$ is between $1$ and $496$.
It quickly becomes evident that the range of values $a$ can take for any given $d$ is from the set $\{1, 2, \cdots , 500-2d\}$, and this is easily shown to be true since if $a$ is the smallest, then $a+2d$ is the largest of the trio and must not exceed $500$
So the number of different trio of APs we can form is: $$\sum_{i=1}^{249} (500-2i)$$ Can you determine this value? (Note that if three randomly chosen numbers can be the same, then the sum takes $i$ from $0$ not $1$, otherwise it should be the same).
Edit: I realized that $n=500$ is an example, and the asker wanted general $n$. In this case $d$ can take values between $1$ (or $0$ if non distinct integers are picked) and $\lfloor{\frac{n-1}{2}}\rfloor$.
In this case we get $$\sum_{i=1}^{\lfloor{\frac{n-1}{2}}\rfloor}n-2i$$