DungeonsAndDragonsDice

Back to Problem Solutions forum

Vladimir_V     2015-06-24 15:52:48

for this task my code provides at least two solutions for every line for exanple for thr first line i have 1d6 and 4d8 acctuLly both varants are corect

Vladimir_V     2015-06-24 15:55:26

sometimes i have one solutions for every line , but this case is one from ten. in most of the cases i have at least two

Vladimir_V     2015-06-24 16:27:51

second and third line of 100 numbers have both numbers from 1 to 9 so the answer is 1d10 or 1d12. Please help to understand this problem

Guy Gervais     2015-06-24 20:41:27
User avatar

You need to consider more than just the range of the numbers. The frequency on each number is also important. 4d6 and 2d12 might produce similar ranges (4-24 and 2-24), but probability of each individual result will be different. You need to look at the frequency of each given line and determine what is the closest match.

Vladimir_V     2015-06-25 05:13:05

what do you mean by frequency ? give me an example of line frequency.at this stage a have several variants for every line based on idia that the result has all 100 numbers in intself. now how tochoose one from 3 or 4.

gfor example my code finds for: 0 line : 1d6,1d10,1d12 1 line : 4d10,3d12,4d8 2 line : 3d6,4d4

based on what i have to chose just variant for each line ?

Guy Gervais     2015-06-25 21:55:07
User avatar

By frequency I mean that some numbers will appear more than others depending on what combination of die you use.

Let's say you need numbers below 12:

If you use 1d12, then every number between 1 and 12 has an equal chance of appearing and the list should contain about an equal number of each.

If you use 2d6, the distribution looks like this:

01: 0
02: 1
03: 2
04: 3
05: 4
06: 5
07: 6
08: 5
09: 4
10: 3
11: 2
12: 1

...so you should see a lot more 6s, 7s and 8s than the other numbers. About 1/6th of the numbers should be 7s.

If you use 3d4, you still get numbers below 12, but now the distribution looks like this:

01: 0
02: 0
03: 1
04: 3
05: 6
06: 10
07: 12
08: 12
09: 10
10: 6
11: 3
12: 1

...so you should have a lot of 6s, 7s, 8s and 9s and very few 3s and 12. 3/16th of the numbers should be 7s and 8s.

You have to use those probabilities to figure out which combination of dice is more likely and use that as the answer.

Please login and solve 5 problems to be able to post at forum