about | help | code help+videos | done | prefs |
Disclaimer: Math-heavy question ------ A company has come up with a promotion where customers have a 1 in n chance of winning a prize (for every product purchased). n is in the range from 1 to 50. Define a function that when passed the value of N, returns the number of products a customer must purchase to have a p% (p is a value between 0 and 100) or greater probability of winning at least one prize. min_purchases_required(4, 40) → 2 min_purchases_required(10, 50) → 7 min_purchases_required(1, 99) → 1 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 5 Post-solution available
Copyright Nick Parlante 2017 - privacy