Probability of getting the sum of two numbers selected from two ranges as odd. Consider two integers N and M. 
One number is selected from a range of 1 to N.
Another number is selected from a range of 1 to M.
What is the probability that the sum of the two numbers is odd?
Note:
I figured out that, whenever either N or M is even, the probability will be 1/2. But what if both or any one of them is odd.

$A \equiv \text{Number selected from the range $1\ldots N$ is odd}\\
B \equiv \text{Number selected from the range $1\ldots M$ is odd}
$
Now $P(A) = \frac 1 N\left\lceil\frac N 2\right\rceil,\ P(\bar{A}) = \frac{1}{N}\left\lfloor \frac N 2 \right\rfloor$
and $P(B) = \frac 1 M\left\lceil\frac M 2\right\rceil,\ P(\bar{B}) = \frac{1}{M}\left\lfloor \frac M 2 \right\rfloor$
Then the probability that the sum of the two numbers is odd is
$P(A)P(\bar{B}) + P(\bar{A})P(B)\\
= \dfrac 1 N\left\lceil\dfrac N 2\right\rceil \dfrac{1}{M}\left\lfloor \dfrac M 2 \right\rfloor + \dfrac{1}{N}\left\lfloor \dfrac N 2 \right\rfloor \dfrac 1 M \left\lceil\dfrac M 2\right\rceil\\
= \dfrac{1}{MN}\left( \left\lceil\dfrac N 2\right\rceil \left\lfloor \dfrac M 2 \right\rfloor + \left\lfloor \dfrac N 2 \right\rfloor \left\lceil\dfrac M 2\right\rceil \right)
$
