How are numerical bonuses combined?

Are there explicit rules for combining numerical bonuses in 5th edition, or is it just left implicitly to "common sense"? There are special cases (e.g. damage resistance and vulnerability, choice of base AC formulae, identical spell/item effects) which are well-defined, but I can’t find a general rule.

Additive and multiplicative bonuses

Example: Longstrider and Haste for a creature with 30′ base walking speed.

Longstrider: You touch a creature. The target’s speed increases by 10 feet until the spell ends.

Haste: Choose a willing creature that you can see within range. Until the spell ends, the target’s speed is doubled […]

Possible interpretations:

  • Always multiply first: (30′ × 2) + 10′ = 70′
  • Always add first: (30′ + 10′) × 2 = 80′
  • Do it in the order the spells were cast
  • Player chooses
  • GM chooses

Multiplicative bonuses with one another

Example: Haste and Boots of Speed for a creature with 30′ base walking speed.

Boots of Speed: While you wear these boots, you can use a bonus action and click the boots’ heels together. If you do, the boots double your walking speed […]

Possible interpretations:

  • Doubling the second time just idempotently repeats the fact that it’s been doubled: max(30′ × 2, 30′ × 2) = 60′
  • Doubling the second time means your speed is quadrupled: 30′ × 2 × 2 = 120′
  • Doubling the second time adds another 100% of your base movement, resulting in an overall tripling: 30′ × (100% + 100% + 100%) = 90′. This was the rule in 3rd edition.

Unable to get numerical result by using Integrate/NIntegrate

Nfunc[x_?NumericQ] :=   E^(-x^2/2)/    Sqrt[2*Pi]*(1/       2 Erf[(x - 0.256048)/Sqrt[2*1.6^2 + 0.231313^2]/Sqrt[2]] -      1/2 Erf[-Infinity/Sqrt[2]]) nume = N[NIntegrate[x*Nfunc[x], {x, -Infinity, Infinity},     Method -> {Automatic, "SymbolicProcessing" -> 0},     PrecisionGoal -> 3, AccuracyGoal -> 3], 4] den = N[Normal[    Integrate[Nfunc[x], {x, -Infinity, Infinity},      GenerateConditions -> False]], 4] nume/den 

I couldn’t get numerator nor denominator. It keeps "executing" for hours. Is there a mistake or isn’t mathematica able to perform this calculation?

I used functions with NumericQ for speeding up calculation, but no luck.

I am looking for a way to assign numerical values to colors (then interpolate a color scale) and then assign numerical values to comparative colors

Hello may name is Chris

I am completely new to programming (but I love it!! I am learning Swift).

I am currently looking for a solution to the mentioned problem. I’m not sure if it is a ML task or if it is better to do it in the traditional way – maybe by comparing and interpolating RGB values. How I imagine that might be easier to understand in the video.

VIDEO (is there a better way to provide a video?)

The color values ​​below were taken before the adjustment and assigned to the assigned values ​​0, 2, 5, 10, 25, 50 and 100. The round section is taken from a photo (by light and shadow you can see that not every color value brings a perfect match. But that shouldn’t be a problem (I hope so) by comparing the pixels and evaluating the color value with the most matching colour at the end). My spontaneous manual evaluation gives a value that should be around 19-20.

I have already thought back and forth whether it is possible to do the whole thing using color values ​​(e.g. R G and B) but that is not so easy since there should also be many different results depending on the color format I am working with.

On the other hand, I don’t know how to solve it using ML. It would be easy to recognize the exact color values ​​0, 2, 5, 10, 25, 50 and 100 – but how can I have intermediate values ​​determined? What do you think? Which approach is the better one? If you have a tip for me, that I know in which direction I have to think further would be great! And if you have an idea how I can work on my problem I would be so grateful!!! … otherwise I think I will need the coming days to find some solution.

Thank you in advance! Chris

Complexity of numerical derivation for general nonlinear functions

In classical optimization literature numerical derivation of functions is often mentioned to be a computationally expensive step. For example Quasi-Newton methods are presented as a method to avoid the computation of first and/or second derivatives when these are “too expensive” to compute.

What are the state of the art approaches to computing derivatives, and what is their time complexity? If this is heavily problem-dependent, I am particularly interested in the computation of first and second order derivatives for Nonlinear Least Squares problems, specifically the part concerning first order derivatives (Jacobians).

Numerical solution of Triple Integration of a Region with Variable Bounds?

I am asked to calculate the mass of the region bounded above by the plane (2x + 3y - z = 2) and below by the triangle on the xy-plane with vertices (0,2),(1,0),(4,0). The density is proportional to the distance from the plane to the xy-plane, so the function is d(x,y,z) = kz.

My limits are:

0 ≤ z ≤ (2x + 3y - 2)

(1 - 0.5y) ≤ x ≤ (4 - 2y)

and 0 ≤ y ≤ 2.

My code is:


but Mathematica doesn’t return a number (if I’m correct, it should be 19k).

Instead I get: k(3-1.5y)(-2+2x+3y)^2.

However if I integrate the function step-by-step:


I do get a numerical value.

Is there a certain syntax that Mathematica requires that I’m not aware of?

What happens when you double the numerical effect of a potion of giant strength?

Potions of Giant Strength give the drinker a new numerical value to their Strength score.

The DMG provides a Potion Miscibility Variant table, one of the effects being :

91-99 The numerical effects and duration of one potion are doubled.

Now say that, with the DM’s approval, a player character mixes a potion of, say, Cloud giant strength (27) with another one and rolls that effect on the above Table, and then drinks that special mixed potion. What would their Strength score be ? 26, 30, or 54 ?

Numerical Accuracy & Sorting Algorithms?

Sedgewick and Wayne talk about how sorting algorithms and, specifically, priority queues are used in devising ways to improve accuracy in floating-point calculations:

Scientific computing is often concerned with accuracy (how close are we to the true answer?). Accuracy is extremely important when we are performing millions of computations with estimated values such as the floating-point representation of real numbers that we commonly use on computers. Some numerical algorithms use priority queues and sorting to control accuracy in calculations.

What “numerical algorithms” use priority queues and sorting like this?

Numerical results for Reduce on an inequality

I am trying to determine the regions parameters (Te, ymin) must belong to for a function to be negative for any argument x greater than zero. I have tried using Resolve

       Resolve[         ForAll[x, (a/x^2)*(Log[x - b] + 1) - (a/x)*(1/(x - b)) - (1/         x^2)*(-b^3 + b) < 0] && x > 0, Reals] 

but no expression could be provided. This is not surprising, as I suppose such expression would involve the solution of trascendental equations.

On the other hand, is there a way to get a numerical output from Resolve? For example, a set of (a, b) parameters values on the boundary of the region for which the function is positive?

I thought maybe Nsolve could take an inequality as an expression, but could not find any examples and could not make it work.

A “brute force” alternative I thought about is to create a grid of (a,b) values, and for each couple of values verify if the function is negative along all the positive x-axis (the last step does not seem obvious neither). Is there a maybe more clever way, fully exploiting Mathematica’s capabilities?

I got intrigued by the answer this post, Reduce a complex inequality but I could not make it work for my case, for example

RegionPlot[ ForAll[x, (a/x^2)*(Log[x - b] + 1) - (a/x)*(1/(x - b)) - (1/    x^2)*(-b^3 + b) < 0], {a, 0.01, 0.5}, {b, 0.001,  0.01}] 

does not seem to be correct syntax.

Thanks a lot