17
$\begingroup$

Why is

Around[10, 1]^2
  1. +- 20

and

Around[10, 1] Around[10, 1]

giving 100 +- 14 ?

Just curious I would suspect them to be the same but I'm not an expert on this for sure.

$\endgroup$
1
  • $\begingroup$ If the intent for Around in Mathematica is for propagating errors, then this is almost certainly a bug. Interestingly enough, I think the second one is correct, whereas the first is not. $\endgroup$ – march Apr 17 '19 at 15:27
23
$\begingroup$

There's a subtlety here.

When operating together multiple Arounds, the two uncertainties will be considered separate and independent (in the statistical sense). Thus the result will be different from squaring a single one.

Consider

N@StandardDeviation@
  TransformedDistribution[
    x y, 
   {x \[Distributed] NormalDistribution[10, 1], 
    y \[Distributed] NormalDistribution[10, 1]}]

(* 14.1774 *)

versus

N@StandardDeviation@TransformedDistribution[x^2, {x \[Distributed] NormalDistribution[10, 1]}]

(* 20.0499 *)

The same can also be observed with addition:

Around[10, 1] + Around[10, 1]
(* Around[20., 1.4142135623730951`] *)

2 Around[10, 1]
(* Around[20., 2.] *)

To specify that all occurrences of an Around expression are the same, use AroundReplace.

For example, compare

x^2 + x /. x -> Around[1, .1]
(* Around[2., 0.223606797749979] *)

with

AroundReplace[x^2 + x, x -> Around[1, .1]]
(* Around[2., 0.30000000000000004`] *)
$\endgroup$
3
  • 1
    $\begingroup$ Also, AroundReplace[ x1 x2, {{x1, x2} -> VectorAround[{10., 10.}, {{1., 1.}, 1.}]}] vs AroundReplace[ x1 x2, {{x1, x2} -> VectorAround[{10., 10.}, {{1., 1.}, 0.}]}]. $\endgroup$ – b.gates.you.know.what Apr 17 '19 at 15:49
  • 1
    $\begingroup$ @b.gatessucks a beautiful demonstration of VectorAround. $\endgroup$ – Searke May 13 '19 at 14:15
  • $\begingroup$ @Searke Thanks ! $\endgroup$ – b.gates.you.know.what May 13 '19 at 17:19
4
$\begingroup$

How Around works should be explained by an example.

For an el. Double cable of length l, conductor distance a and conductor radius r, the following values were measured. We are looking for the absolute uncertainty of the mean value of the inductance L: enter image description here

mittlereMessunsicherheit[f_, vars_List, dvars_List] := Sqrt@Inner[Times, Grad[f, vars]^2, dvars^2]

params = {
   l -> Quantity[2, "km"], dl -> Quantity[10, "m"],
   r -> Quantity[2, "cm"], dr -> Quantity[50, "\[Mu]m"],
   a -> Quantity[0.3, "m"], da -> Quantity[3, "mm"],
   \[Mu]0 -> UnitConvert[Quantity[1, "MagneticConstant"]]
   };
vars = {l, r, a};
dvars = {dl, dr, da};
L = \[Mu]0/\[Pi] l (Log[(a - r)/r] + 1/4);

dL = mittlereMessunsicherheit[L, vars, dvars]

enter image description here

UnitConvert[L /. params, "mH"] \[PlusMinus] UnitConvert[dL /. params, "mH"] // EngineeringForm

enter image description here

Same calculation now with Around:

params2 = {
   l -> Around[Quantity[2, "km"], Quantity[10, "m"]],
   r -> Around[Quantity[2, "cm"], Quantity[50, "\[Mu]m"]],
   a -> Around[Quantity[0.3, "m"], Quantity[3, "mm"]],
   \[Mu]0 -> UnitConvert[Quantity[1, "MagneticConstant"]]
   };
L = UnitConvert[L /. params2, "mH"]

enter image description here

Let us turn to OP's questions.

1.)

Around[10, 1]*Around[10, 1]

enter image description here

We have

M = x*y;
dM = mittlereMessunsicherheit[M, {x, y}, {dx, dy}]

enter image description here

params = {x -> 10, dx -> 1, y -> 10, dy -> 1};

and we obtain

M \[PlusMinus] dM /. params // N

enter image description here

2.)

Around[10, 1]^2

enter image description here

M = x^2;
dM = mittlereMessunsicherheit[M, {x}, {dx}]

enter image description here

M \[PlusMinus] dM /. {x -> 10, dx -> 1}

enter image description here

I explained Around in a different way, as Szabolcs formulated it in his answer. The error calculation is well known to us, but that Around performs the same calculation has not been known.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.