probability of sum of two integers less than an integer Two integers [not necessarily distinct] are chosen from the set {1,2,3,...,n}. What is the probability that their sum is <=k?
My approach is as follows. Let a and b be two integers. First we calculate the probability of the sum of a+b being equal to x [1<=x<=n]. WLOG let a be chosen first. For b= x-a to be positive, we must have 1<=a < x. This gives (x-1) possible values for a out of total n possible values. Probability of valid selection of a= (x-1)/n. For each valid selection of a, we have one and only one possible value of b. Only 1 value of b is then valid out of total n possible values. Thus probability of valid selection of b= 1/n. Thus probability of (a+b= x) = (x-1)/n(n-1).
Now probability of (a+b<=k)
= Probability of (a+b= 2) + probability of (a+b= 3) + ... + probability of (a+b= k) 
= {1+2+3+4+5+...+(k-1)}n(n-1)
= k(k-1)/n(n-1).
Can anybody please check if my approach is correct here?

Let $s=a+b$
I will find $P(s=k)$.
Clearly for $k<0$ and for $k>2n$ then $P(s=k)=0$ 
The other cases are as follows.
Let $x$ be the total no. of pairs $a,b$
Case 1:$k\le n$
Total no. of ways of selecting $a,b$ as an ordered pair such that $s=k$ is $(k-1)$.
Now as according to the question there is no ordering so to remove this ordering we have to divide this by $2$ if $k$ is odd(Reason:as there are no case where $a=b$ so the no. of ways in which $a,b$ can occur as ordered tuple is twice their own number).If $k$ is even then we have to subtract $1$ from it then divide it by $2$ and then again add $1$ to it.
SO we have ,
$P(s=k)=\frac{k-1}{2x},\text{if k is odd}$
$P(s=k)=\frac{k}{2x},\text{if k is even}$
Case 2:$k>n$
Again we will take ordered $(a,b)$ at first.
In this case it is better to visualise the case using dots and bars.
There are $k$ dots.In between these $k$ dots we will put a bar and call the number of dots on left side of the bar as $a$ and the dots on the right side of the bar as $b$.
But there is a restriction that $a,b\le n$
We can easily handle this restriction by allowing to put the bar $k-n$ th dot and $n+1$ th dot.
So the number of places to put the dot equals $(n+1-k+n)=2n-k+1$
Now again if $2n-k+2$ is odd or $k$ is odd then we have to divide this by $2$ else we have to subtract $1$ and divide it by $2$ and then add $1$.
So we have,
$P(s=k)=\frac{2n-k+1}{2x},\text{if k is odd}$
$P(s=k)=\frac{2n-k+2}{2x},\text{if k is even}$
Now we will find $x$.
There are $n$ choices for each $a$ and $b$. So the no. of ordered pairs $(a,b)$ equals $n^2$
Now according to $n$ is even or odd we must have,
$x=n^2/2 \text{if n is even}$
$x=(n^2+1)/2 \text {if n is odd}$
