D&D.Sci

Meta

Analysis

001 - D&D.Sci stats

  • STR: 6/20
  • CON: 14/20
  • DEX: 13/20
  • INT: 13/20
  • WIS: 12/20
  • CHA: 4/20
Link to original

Record of other student results of their Great Quest: https://raw.githubusercontent.com/H-B-P/d-and-d-sci/main/d_and_d_sci.csv.

Positive overload

I have a couple of ideas: I can search, through the dataset and find the closest entry with positive overload — I can bonus points for each stat point higher than the one in the dataset.

def calculate_distance_with_positive_overload(stats: dict) -> int:
    def __sum(acc, entry):
        if entry[0] == "result":
            return acc
        return acc + entry[1] - STATS[entry[0]]
 
    return reduce(__sum, stats.items(), 0)
 
result = min(dataset, key=calculate_distance_with_positive_overload)

In that case, the result is:

,cha,con,dex,int,str,wis,result
8,14,14,10,2,8,12,succeed

with the score of -2.

Note

Negative values indicate that overall I’ve already scored higher.

Calculate only lacking scores

Alternatively, I can reduce only lacking stats, and discard the ones in which I’ve already scored enough.

def calculate_distance_only_lacking(stats: dict) -> int:
    def __sum(acc, entry):
        if entry[0] == "result":
            return acc
        return acc + max(0, entry[1] - STATS[entry[0]])
 
    return reduce(__sum, stats.items(), 0)

With this modification, we get:

,cha,con,dex,int,str,wis,result
3306,4,11,13,14,7,11,fail

…which is an unfortunate result with a score of 2.

Calculate only successful lacking scores

This is an alteration of the previous algorithm, where we search only successful datasets.

only_success = filter(lambda ds: ds["result"] == "succeed", dataset)
closest_success_lacking = min(only_success, key=calculate_distance_lacking)

This, thankfully, gives us:

,cha,con,dex,int,str,wis,result
1981,5,14,15,12,6,9,succeed

…with a score of 3. This is good, but it doesn’t necessarily guaranteed us a success. We might overcompensate and thus fail.

Calculate guaranteed success

I think the best solution would be to find any 10 score dataset, so that we can alter our stats to match it perfectly.

Sadly, there’s no such entry

def calculate_distance_abs(stats: dict) -> int:
    def __sum(acc, entry):
        if entry[0] == "result":
            return acc
        distance = entry[1] - STATS[entry[0]]
        if distance < 0:
            return 9999
        return acc + distance
 
    return reduce(__sum, stats.items(), 0)
 
 
guaranteed_success = filter(
    lambda ds: calculate_distance_abs(ds) == 10, only_success
)
assert len(list(guaranteed_success)) == 0

Calculate potential success

Without a guaranteed success, the best thing we can do is to minimize the positive error:

potential_success = filter(
    lambda ds: 9 <= calculate_distance_abs(ds) <= 11, only_success
)
assert len(list(potential_success)) == 5

Five entries to consider:

,cha,con,dex,int,str,wis,result
1081,6,16,16,13,8,12,succeed
2773,8,14,14,13,11,13,succeed
3881,4,16,13,16,8,14,succeed
4562,10,14,13,15,6,13,succeed
6316,5,14,13,14,13,12,succeed

…and compare to our stats:

001 - D&D.Sci stats

  • STR: 6/20
  • CON: 14/20
  • DEX: 13/20
  • INT: 13/20
  • WIS: 12/20
  • CHA: 4/20
Link to original

#ΔSTRΔCONΔDEXΔINTΔWISΔCHASUM
108122300211
277350101411
38812203209
45620002169
63167001019

Assets