Coding newbie here!
I'm trying to fit data to a 2d6 probability, with a couple of caveats.
data
input = { “Blue”: 10.46, “Orange”: 0.57, “Red”: 15.27, “Yellow”: 49.87, “Green”: 3.13:, “Purple”: 20.77 }
2d6 curve
curve = { 2: 2.77, 3: 5.55: , 4: 8.33, 5: 11.11, 6: 13.88, 7: 16.66, 8: 13.88, 9: 11.11, 10: 8.33, 11: 5.55, 12: 2.77 }
Since the input values don't already match the curve values, I need to divide them up. For example, Yellow (49.87) should probably be fitted to 7, 8, 9 and 10 (16.66+13.88+11.11+8.33 = 49.98).
Sometimes there will be more or fewer values in input, but they will always add up to (about) 100. Each point on the curve can only be used once.
The expected output looks something like:
2: Orange
3: Red
4: Yellow
5: Blue
6: Yellow
7: Yellow
8: Purple
9: Red
10: Yellow
11: Purple
12: Green
How would you go about this?
I'm trying to fit data to a 2d6 probability, with a couple of caveats.
data
input = { “Blue”: 10.46, “Orange”: 0.57, “Red”: 15.27, “Yellow”: 49.87, “Green”: 3.13:, “Purple”: 20.77 }
2d6 curve
curve = { 2: 2.77, 3: 5.55: , 4: 8.33, 5: 11.11, 6: 13.88, 7: 16.66, 8: 13.88, 9: 11.11, 10: 8.33, 11: 5.55, 12: 2.77 }
Since the input values don't already match the curve values, I need to divide them up. For example, Yellow (49.87) should probably be fitted to 7, 8, 9 and 10 (16.66+13.88+11.11+8.33 = 49.98).
Sometimes there will be more or fewer values in input, but they will always add up to (about) 100. Each point on the curve can only be used once.
The expected output looks something like:
2: Orange
3: Red
4: Yellow
5: Blue
6: Yellow
7: Yellow
8: Purple
9: Red
10: Yellow
11: Purple
12: Green
How would you go about this?