I am trying to find a way to:
a) Get a number of all the combinations with repetition in an array
b) Get which of these combinations has a sum greater than a given number
Please forgive my terms here, I'm not good at math so a lot of this is just how I think about things.
i.e
E = [1,2,3]
r = 5 // Size of the combination
n = 5 // The number of "picks"
x = 10 // The minimum value of the sum of the combination to make it "valid"
Combinations here are:
[1,1,1,1,1]
[1,1,1,1,2]
...
[1,2,3,3,3] // Because this is > X, this should be counted as a "valid" result
I basically want to get the ratio of "valid" combinations in a series of combinations.
Does this make sense?