Project 20: Binomial Probability Distribution
Project 20: Variables 'n' and 'p' have been initialized. There is also a working method available called binomialpdf.
n is the number of trials (3 in the example given)
p is probability of success on any trial (.3 in the example given)
binomialpdf(n,p,k) returns the probability of getting 'k' successes out of 'n' trials (if the probability of success on any trial is 'n').
binomialpdf(3, .3,1) returns .441
binomialpdf(3, .3,2) returns .189
Task: Appropriately initialize an array called 'binomialProbs'. The array should hold the probabilities for each possible number of successes from least to greatest.
Example: If n = 3, and p = .3, the binomialProbs = [.343, .441, .189, .027].
Note: You can assume 'binomialProbs' has been initialized as an empty array (or ArrayList if you are coding in Java)
**If your code works for 5 test cases in a row, you can enter your e-mail address.