Hello everyone,
I'm currently working on a project using excel, and I've run into a problem involving a mathematical formula.
For my project, I have to compute a formula consisting of a binomial probability multiplied by a factor, summed for a range of values.
Formula:
AF(i,t)= ∑ [Combin(n,k)*p*(1-p)^(n-k)]*[Absolute value ((k/n)-p)]
The first factor of the formula: [Combin(n,k)*p*(1-p)^(n-k)] is the binomial probability of having k number of successes in n number of trials. The p is the chance of success. I'm am aware of the fact that there is a formula in excel for computing the binomial probability (Binom.Dist). So the formula could also be displayed in this manner:
Formula:
AF(i,t)= ∑ Binom.Dist(k,n,p,False)*[Absolute value ((k/n)-p)]
The second factor of the formula: [Absolute value ((k/n)-p)] is just the absolute value of k/n minus the change of success.
In my database, I have determined p and n for every particular case (I have to do this calculation for , and those are both in an individual cell. I am able to compute this formula for a single k, my problem however is the sigma before the formula. I need to compute this formula for the range of 0 to n, and sum the values into a single value. To give an example, imagine I have a number of 2 trials (n=2). the chance of success is 0,4. Then I have to compute the individual binomial probability of 0 (k=0) number of successes in 2 trials, multiplied by the second factor: absolute value((0/2)-0,4). Then I have to compute the binomial probability of 1 (k=1) number of successes in 2 trials, multiplied by the second factor: absolute value((1/2)-0,4). Finally I have to repeat this for 2 number of successes in 2 trials. This will result in three values, which need to be summed up into a single value. Because of the size of the database, this formula has to fit into one cell (so I can copy it down the database).
I need a way to insert a row of values (0 to n) for k into both the factors of the formula. And the formula should be computed in the way described above. So the Binomial probability of every particular k should be multiplied with the Absolute value of ((k/n)-p) of that particular k. And then the values of 0 to n should be added up to a single value.
I hope there is a way to do this in Excel, and that someone can help me do it. I apologize in advance if my description is not clear or if I elaborated too much.
Bookmarks