On Sunday, 8 October 2017 01:10:14 UTC-4, Francesco Bonazzi wrote:
This result is definitely wrong.
Sorry, ignore my previous answer, that result is correct. If you sum n + n, you are summing the same random value. To get the effect of summing two uniform distributions, just define a new uniform distribution:
In [8]: m = Uniform('m', 0, 1)
In [9]: density(n+m)
Out[9]:
⎛⎧ 1 ⎞ ⎛⎧
⎜⎪ 0 for ─── < 1⎟ ⎜⎪
⎜⎪ │z│ ⎟ ⎜⎪
z ↦ - ⎜⎨ ⎟ + ⎜⎨
⎜⎪ ╭─╮0, 2 ⎛2, 1 │ 1⎞ ⎟ ⎜⎪ ╭─╮0, 2 ⎛2, 1 │
⎜⎪z⋅│╶┐ ⎜ │ ─⎟ otherwise ⎟ ⎜⎪z⋅│╶┐ ⎜ │ ─
⎝⎩ ╰─╯2, 2 ⎝ 1, 0 │ z⎠ ⎠ ⎝⎩ ╰─╯2, 2 ⎝ 1, 0 │ p
1 ⎞
0 for ─────── < 1⎟
│z - 1│ ⎟
⎟
1 ⎞ ╭─╮0, 2 ⎛2, 1 │ 1 ⎞ ⎟
────────────────⎟ - │╶┐ ⎜ │ ─────────────────⎟ otherwise ⎟
olar_lift(z - 1)⎠ ╰─╯2, 2 ⎝ 1, 0 │ polar_lift(z - 1)⎠ ⎠
The integral is unable to simplify the expression, but that's another issue.