An urn contains n+m balls, n red and m black

let X be the number of red balls chosen without replacement before a black one is chosen. We are intressted in E(x). To obtain this quantity, number red balls from 1 to n and define Xi, i=1,...,n by

Xi{ 1 of red ball i is chosen ,

0 otherwise

so i get what's going on....firstly, the probability of drawing a red ball is n/n+m...and i need to show that the answer is the mean of a geometric dist: 1/p.

So i need to write E(x)= summation of i from 1 to n (xi)

but i don't know how to proceed... something like sum(xi* P(xi))... i dont really know how to insert the notation either