# Let X and Y be independent random variables each having the uniform density on {0,1,...,N}. Find P(X=Y).

Let X and Y be independent random variables each having the uniform density on {0,1,...,N}. Find P(X=Y).
You can still ask an expert for help

• Questions are typically answered in as fast as 30 minutes

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

shosautesseleol
Using the law of the total probability (conditioning on X), we have that
$P\left(X=Y\right)=\sum _{x=0}^{N}P\left(X=Y|X=x\right)P\left(X=x\right)$
$=\sum _{x=0}^{N}P\left(Y=x\right)P\left(X=x\right)$
$=\sum _{x=0}^{N}\frac{1}{N+1}\ast \frac{1}{N+1}$
$=\frac{1}{\left(N+1{\right)}^{2}}\sum _{x=0}^{N}1$
$=\frac{\left(N+1\right)}{\left(N+1{\right)}^{2}}=\frac{1}{N+1}$