TITLE: Probability that a number is divisible by 11
QUESTION [22 upvotes]: The digits $1, 2, \cdots, 9$ are written in random order to form a nine digit number. Then, the probability that the number is divisible by $11$ is $\ldots$
I know the condition for divisibility by $11$ but I couldn't guess how to apply it here.
Please help me in this regard. Thanks.

REPLY [3 votes]: The rule of divisibility by $11$ is as follows:
The difference between the sum of digits at odd places and the sum of the digits at even places should be $0$ or a multiple of $11$. 
We also know that the sum of all the digits will be $45$ as $1 + 2 + ... + 9 = 45$.
Let $x$ denote sum of digits at even position s and $y$ denote sum of digits at odd places, or vice versa. 
Case 1 (difference is $0$):
$$x + y = 45$$
$$x - y = 0$$
Thus, $2x = 45$, or $x = 22.5$ which cannot be obtained.
Case 2 (difference is $11$):
$$x + y = 45$$
$$x - y = 11$$
Thus, $2x = 56$, or $x = 28$ and $y = 17$. This is a valid possibility.
Case 3 (difference is $22$):
$$x + y = 45$$
$$x - y = 22$$
Thus, $2x = 67$, or $x = 33.5$, which cannot be obtained.
As you can see, the difference between the sum of the digits at odd places and the sum of the digits at even places must be $11$. 
Now, imagine that there are $9$ placeholders (representing the $9$ digits of the $9$-digit number). Either the sum of the digits at odd places ($5$ odd places) should be $28$, or the sum of the digits at even places ($4$ even places) should be $28$. 
We write down the possibilities:
$2$ ways to express $28$ as a sum of $4$ numbers between $1$ and $9$.
$9$ ways to express $28$ as a sum of $5$ numbers between $1$ and $9$.
In the first case, there are $4!$ ways of arranging the $4$ numbers (that add up to $28$) and $5!$ ways of arranging the $5$ other numbers (that add up to $17$). Hence, no. of ways$ = 2 * 4! * 5!$
In the second case, there are $5!$ ways of arranging the $5$ numbers ( that add up to $28$) and $4!$ ways of arranging the $4$ other numbers (that add up to $17$). Hence, no. of ways$ = 9 * 5! * 4!$
Total favourable possibilities$$= 2 * 4! * 5! + 9 * 5! * 4!$$
$$= 4! * 5! * (2 + 9)$$
$$= 4! * 5! * 11$$
Also, total no. of ways of arranging $9$ numbers to form a $9$-digit number = $9!$
Hence, probability$=P= (4! * 5! * 11)/9!$
$$= 11/126$$