Question: VBA Coding Question Create a VBA function called binomial(x,n,p) with arguments for x (number of successes), n (total number of trials), and p (probability of

VBA Coding Question

VBA Coding Question Create a VBA function called binomial(x,n,p) with arguments for

Create a VBA function called binomial(x,n,p) with arguments for x (number of successes), n (total number of trials), and p (probability of success) that determines the cumulative probability [F(x)] of a binomial distribution. In other words, binomial should output the sum of the following series from x = 0 to x = k: Here, f(x: n, p) = C) px (1-p)"-x The term (x) can be solved simply using the combin(n,x) function in Excel (l.e. you can borrow Excel's combin function when you solve this problem in VBA) As an example: F(3; 10,0.5) = f(0; 10,0.5) + f(1; 10,0.5) f(2 10,0.5) + f(3; 10,0.5) 10-o, (10 10-1 10-2 (10 = 0, 172 You can use the preceding result to check your binomial function. You can also use Excel's built- in cumulative binomial function binom.dist(x,n,p,TRUE) to check your solution for other values of x, n, and p but you cannot use the binom.dist function in your solution (i.e., you cannot borrow this function from Excel). You should be able to do this in 6 or 7 lines of code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!