Expected number of collisions for balls and bins problem $n$ number of balls are thrown randomly to $m$ number of bins, standing in a row. The balls are labeled as $1,2,3,....n$ and bins are also labeled as $1,2,3,...,m$. The probability of $i_{th}$ ball enters in the $j_{th}$ bin is $p_{ij}$ where $\sum_{j=1}^{m}p_{ij}=1$ for all $i$. What is the expected number of collisions when all $n$ balls are thrown? Assume that balls enter into the bins are independent events (e.g the event 1st ball goes to the 5th bin and 3rd ball enters to the 5th bin are independent events). 
Clarification:
Note that we count collisions over distinct and unordered pairs, that is, if three balls fall into one bin, three collisions are counted.
 A: The chance that balls $i$ and $k$, $i\ne k$, enter the same bin $j$ is $p_{ij}p_{kj}$ because these balls are thrown independently.  Since they cannot collide in more than one distinct bin, and a collision must occur in some bin, the chance that these balls collide anywhere is the sum over bins of their chances of collision:
$$\Pr(i\text{ and }k\text{ collide}) = \sum_{j=1}^m p_{ij}p_{kj}.$$
This chance also is the expected number of collisions of balls $i$ and $k$.  Summing over all distinct balls gives the expected total number of collisions $N$ (because expectation is linear):
$$\mathbb{E}(N) = \sum_{1\le i\lt k \le n} \sum_{j=1}^m p_{ij}p_{kj}.$$
This can be written in matrix form in terms of the matrix $\mathbb{P} = (p_{ij})$ and the constant $n$-vector $\mathbf{1} = (1,1,\ldots, 1)^\prime$ as 
$$\mathbb{E}(N) = \frac{1}{2}\left(\mathbf{1}^\prime \mathbb{P}\mathbb{P}^\prime\mathbf{1} - Tr(\mathbb{P}\mathbb{P}^\prime)\right).$$

Simulations support the correctness of this result.  For instance, the following R code simulates $10,000$ throws of $n=5$ balls into $m=8$ bins using randomly generated probabilities $p_{ij}$. (Note the implementation of the formula for $\mathbb{E}(N)$: it takes just two simple lines at the end where q and then the answer f are calculated.)  Its output is
   Mean      SE Formula       Z 
 1.3489  0.0113  1.3487  0.0200

This states that the formula for $\mathbb{E}(N)$ is $1.3487$, whereas the average number of collisions observed is $1.3489\pm 0.0113$, which is just $Z=0.02$ standard errors away from the formula (indicating very close agreement).  Similarly close agreement is obtained when varying either $n$ or $m$.
#
# Generate a random transition matrix.
#
n <- 5
m <- 8
set.seed(17)
p <- matrix(rexp(n*m), n)
p <- p / rowSums(p)
#
# Throw balls into bins.
#
throw <- function(p) {
  sum(choose(table(sapply(1:nrow(p), function(i) sample(1:ncol(p), 1, prob=p[i, ]))), 2))
}
sim <- replicate(1e4, throw(p))
#
# Compare the results to the formula
#
mu <- mean(sim)
se <- sd(sim) / sqrt(length(sim))
q <- crossprod(t(p))
f <- sum(q[lower.tri(q)])
(round(c(Mean=mu, SE=se, Formula=f, Z=(mu-f)/se), 4))

A: If I understood well the problem, the answer should be the sum of binomial distributions. 
Pick for example one bin. Being that every bin have the same probability of receive a ball, then the probability of a ball to fall in that chosen bin is 1/m. So you calculate the expectation of the binomial variable with n balls and p = 1/m of having more than 1 ball in a bin. And then make the sum over all the bins.
EDIT
To give you a formula. First, give that n can be big, it's better to calculate the probability of a ball not falling in the bin or only falling once. That is:
$$ P(x=0 \, or \, x=1) = (1-1/m)^n + n(1/m)(1-1/m)^{n-1} $$
so the probability of having n ball colliding should be
$$ P = m\left[1 - (1-1/m)^n - n(1/m)(1-1/m)^{n-1}\right] $$
