Let \(a\), \(b\), \(c\) be integers; where \(a\) and \(b\) are not equal to zero.
Prove that the equation \(ax + by = c\) has integer solutions if and only if \(c\) is divisible by \(d = \mathrm{GCD} (a, b)\).
On a laundry drying line \(n\) socks hang in a random order (the order in which they got out of the washing machine). Among them there are the two favourite socks of the Scattered Scientist. The socks are covered by a drying sheet, so the Scientist does not see them, and takes out one sock by touch. Find the mathematical expectation of the number of socks taken out by the Scientist by the time he has both of his favourite socks.