What have you tried so far? Do you have any experience with c++?
I think you might need to provide more information about the variables involved, and where they are coming from.
I was looking around at some math libraries for c++ and seems there are some viable options for the expected value calculation.
The summation could be achieved with a simple for loop, likewise for the factorial on the denominator.