Calculate density using convolution formula

In summary: Thinking)Yes, it does! (Smile)In summary, the conversation discusses the use of the convolution formula to determine the density of a sum of independent identically distributed random variables. It explains the process step by step and calculates the integral in each case. Ultimately, the result matches the expected outcome.
  • #1
mathmari
Gold Member
MHB
5,049
7
Hey! :eek:

Let $X_1, X_2, X_3$ be i.i.d. with $X_1 \sim U[0, 1]$. I want to determine the density of $S=X_1+X_2+X_3$ using the convolution formula.

I have done the following:

Since $X_1, X_2, X_3$ are i.i.d. we have that they are independent identically distributed random variables. Since $X_1 \sim U[0, 1]$ we have that $X_1$ is distributed uniformly on the interval $[0,1]$.

So, all random variables $X_1, X_2, X_3$ are distributed uniformly on the interval $[0,1]$, right?

Then for the distribution we have that $$f_{X_1}(x)=f_{X_2}(x)=f_{X_3}(x)=\left\{\begin{matrix}
1 & \text{ if } 0\leq x\leq 1\\
0 & \text{ otherwise }
\end{matrix}\right.$$ To determine the density of $S=X_1+X_2+X_3$ we do the following:

We calculate first the density of $Y:=X_1+X_2$ using the convolution formula.

\begin{align*}f_Y(y)&=\int_{-\infty}^{+\infty}f_{X_1}(x)f_{X_2}(y-x)dx \\ & = \int_0^1f_{X_2}(y-x)dx \\ & = \int_0^1 1_{\{0\leq y -x\leq 1\}}dx \\ & = \int_0^1 1_{\{y-1\leq x\leq y\}}dx \end{align*}

At some notes I saw that this integral is equal to $$\left\{\begin{matrix}
y ,& 0\leq y\leq 1\\
2-y ,& 1\leq y\leq 2\\
0 ,& \text{ otherwise }
\end{matrix}\right.$$ How do we get that result? (Wondering) We apply again the convolution formula for $f_Y:=f_{X_1+X+2}$ and $f_{X_3}$.

\begin{align*}f_S(s)&=\int_{-\infty}^{+\infty}f_{Y}(x)f_{X_3}(s-x)dx \\ & = \int_0^1xf_{X_3}(s-x)dx+\int_1^2(2-x)f_{X_3}(s-x)dx \\ & = \int_0^1 x\cdot 1_{\{0\leq s -x\leq 1\}}dx +\int_1^2(2-x)\cdot 1_{\{0\leq s -x\leq 1\}}dx \\ & = \int_0^1 x\cdot 1_{\{s-1\leq x\leq s\}}dx +\int_1^2(2-x)\cdot 1_{\{s-1\leq x\leq s\}}dx\end{align*}

Is everything correct do far? How can we calculate the last integrals? (Wondering)
 
Physics news on Phys.org
  • #2
mathmari said:
\begin{align*}f_Y(y)&= \int_0^1 1_{\{y-1\leq x\leq y\}}dx \end{align*}

At some notes I saw that this integral is equal to $$\left\{\begin{matrix}
y ,& 0\leq y\leq 1\\
2-y ,& 1\leq y\leq 2\\
0 ,& \text{ otherwise }
\end{matrix}\right.$$ How do we get that result?

Hey mathmari! (Smile)

We have to split the integral into cases:
\begin{align*}f_Y(y)&= \int_0^1 1_{\{y-1\leq x\leq y\}}dx \\
&= \begin{cases}
\int_0^1 1_{\{y-1\leq x\leq y\}}dx & \text{if }y< 0\\
\int_0^1 1_{\{y-1\leq x\leq y\}}dx & \text{if }0 \le y< 1\\
\int_0^1 1_{\{y-1\leq x\leq y\}}dx& \text{if }1 \le y < 2\\
\int_0^1 1_{\{y-1\leq x\leq y\}}dx& \text{if } 2 \le y\\
\end{cases}
\end{align*}
Can we calculate it now? (Wondering)
 
  • #3
I like Serena said:
We have to split the integral into cases:
\begin{align*}f_Y(y)&= \int_0^1 1_{\{y-1\leq x\leq y\}}dx \\
&= \begin{cases}
\int_0^1 1_{\{y-1\leq x\leq y\}}dx & \text{if }y< 0\\
\int_0^1 1_{\{y-1\leq x\leq y\}}dx & \text{if }0 \le y< 1\\
\int_0^1 1_{\{y-1\leq x\leq y\}}dx& \text{if }1 \le y < 2\\
\int_0^1 1_{\{y-1\leq x\leq y\}}dx& \text{if } 2 \le y\\
\end{cases}
\end{align*}
Can we calculate it now? (Wondering)

If $y<0$ then $x$ is not in the interval $[0,1]$, so we have that $\int_0^1 1_{\{y-1\leq x\leq y\}}dx=\int_0^1 0dx=0$.

If $0 \le y< 1$ then we have that $-1\leq y-1\leq x\leq y<1$. Do we have to split it further?

If $1 \le y < 2$ then $0\leq y-1\leq x\leq y<2$. At the part $1<x<2$ the function is $0$. So, do we have to split this also further?

If $2 \le y$ then $x$ is bigger than in the interval $[0,1]$, so we have that $\int_0^1 1_{\{y-1\leq x\leq y\}}dx=\int_0^1 0dx=0$.

(Wondering)
 
  • #4
mathmari said:
If $y<0$ then $x$ is not in the interval $[0,1]$, so we have that $\int_0^1 1_{\{y-1\leq x\leq y\}}dx=\int_0^1 0dx=0$.

If $2 \le y$ then $x$ is bigger than in the interval $[0,1]$, so we have that $\int_0^1 1_{\{y-1\leq x\leq y\}}dx=\int_0^1 0dx=0$.

Good! (Nod)

mathmari said:
If $0 \le y< 1$ then we have that $-1\leq y-1\leq x\leq y<1$. Do we have to split it further?

If $1 \le y < 2$ then $0\leq y-1\leq x\leq y<2$. At the part $1<x<2$ the function is $0$. So, do we have to split this also further?

No need to split it further.
Just consider that the bounds of our integral are for $0\le x < 1$. (Thinking)
 
  • #5
I like Serena said:
No need to split it further.
Just consider that the bounds of our integral are for $0\le x < 1$. (Thinking)

Ah do we want that $[0,1]\subseteq [y-1, y]$ ? (Wondering)
 
  • #6
mathmari said:
Ah do we want that $[0,1]\subseteq [y-1, y]$ ? (Wondering)

It's more like that we want to look at the interval $[0,1]\cap [y-1, y]$ in each case ... (Thinking)
 
  • #7
I like Serena said:
It's more like that we want to look at the interval $[0,1]\cap [y-1, y]$ in each case ... (Thinking)

If $y<0$ then the intersection is empty. The same holds when $y>2$. If $0\leq y\leq 2$ then the intersection is not empty. Right?
Why do we split the interval $[0,2]$ into two intervals?

(Wondering)
 
  • #8
mathmari said:
If $y<0$ then the intersection is empty. The same holds when $y>2$. If $0\leq y\leq 2$ then the intersection is not empty. Right?
Why do we split the interval $[0,2]$ into two intervals?

Because the bounds are different. I think we'll see when we work it out. (Thinking)
 
  • #9
We have the following:
\begin{align*}&\begin{cases}
\int_0^1 1_{\{y-1\leq x\leq y\}}dx & \text{if }y< 0\\
\int_0^1 1_{\{y-1\leq x\leq y\}}dx & \text{if }0 \le y< 1\\
\int_0^1 1_{\{y-1\leq x\leq y\}}dx& \text{if }1 \le y < 2\\
\int_0^1 1_{\{y-1\leq x\leq y\}}dx& \text{if } 2 \le y\\
\end{cases} \\ & =\begin{cases}
\int_0^1 0dx & \text{if }y< 0\\
\int_0^y dx & \text{if }0 \le y< 1\\
\int_{y-1}^1 dx& \text{if }1 \le y < 2\\
\int_0^1 0dx& \text{if } 2 \le y\\
\end{cases} \\ & =\begin{cases}
0 & \text{if }y< 0\\
y & \text{if }0 \le y< 1\\
1-(y-1)=2-y& \text{if }1 \le y < 2\\
0& \text{if } 2 \le y\\
\end{cases}
\end{align*}

since when $0\leq y<1$ then $[y-1,y]\cap [0,1]=[0,y]$ and when $1\leq y<2$ then $[y-1,y]\cap [0,1]=[y-1,1]$, right? (Wondering)
 
  • #10
mathmari said:
since when $0\leq y<1$ then $[y-1,y]\cap [0,1]=[0,y]$ and when $1\leq y<2$ then $[y-1,y]\cap [0,1]=[y-1,1]$, right?

Right! (Nod)

Wait! Doesn't that look like the result we were supposed to get? (Wait)
 
  • #11
I like Serena said:
Right! (Nod)

Wait! Doesn't that look like the result we were supposed to get? (Wait)

Ah ok! Wir haben folgendes:

mathmari said:
We apply again the convolution formula for $f_Y:=f_{X_1+X+2}$ and $f_{X_3}$.

\begin{align*}f_S(s)&=\int_{-\infty}^{+\infty}f_{Y}(x)f_{X_3}(s-x)dx \\ & = \int_0^1xf_{X_3}(s-x)dx+\int_1^2(2-x)f_{X_3}(s-x)dx \\ & = \int_0^1 x\cdot 1_{\{0\leq s -x\leq 1\}}dx +\int_1^2(2-x)\cdot 1_{\{0\leq s -x\leq 1\}}dx \\ & = \int_0^1 x\cdot 1_{\{s-1\leq x\leq s\}}dx +\int_1^2(2-x)\cdot 1_{\{s-1\leq x\leq s\}}dx\end{align*}

Wir bekommen folgdnes :
\begin{align*}f_S(s)&=\int_{-\infty}^{+\infty}f_{Y}(x)f_{X_3}(s-x)dx \\ & = \int_0^1xf_{X_3}(s-x)dx+\int_1^2(2-x)f_{X_3}(s-x)dx \\ & = \int_0^1 x\cdot 1_{\{0\leq s -x\leq 1\}}dx +\int_1^2(2-x)\cdot 1_{\{0\leq s -x\leq 1\}}dx \\ & = \int_0^1 x\cdot 1_{\{-s\leq -x\leq 1-s\}}dx +\int_1^2(2-x)\cdot 1_{\{0\leq s -x\leq 1\}}dx \\ & = \int_0^1 x\cdot 1_{\{s-1\leq x\leq s\}}dx +\int_1^2(2-x)\cdot 1_{\{s-1\leq x\leq s\}}dx\end{align*}
Wir berechnen die zwei Integral getrennt:
  • $\displaystyle{\int_0^1 x\cdot 1_{\{s-1\leq x\leq s\}}dx}$ :
    \begin{align*}\int_0^1 x\cdot 1_{\{s-1\leq x\leq s\}}dx&=\begin{cases}
    \int_0^1 x\cdot 1_{\{s-1\leq x\leq s\}}dx & \text{wenn }s< 0\\
    \int_0^1 x\cdot 1_{\{s-1\leq x\leq s\}}dx & \text{wenn }0 \le s< 1\\
    \int_0^1 x\cdot 1_{\{s-1\leq x\leq s\}}dx& \text{wenn }1 \le s < 2\\
    \int_0^1 x\cdot 1_{\{s-1\leq x\leq s\}}dx& \text{wenn } 2 \le s\\
    \end{cases} \\ & = \begin{cases}
    \int_0^1 x\cdot 0dx & \text{wenn }s< 0\\
    \int_0^s x dx & \text{wenn }0 \le s< 1\\
    \int_{s-1}^1 xdx& \text{wenn }1 \le s < 2\\
    \int_0^1 x\cdot 0dx& \text{wenn } 2 \le s\\
    \end{cases} \\ & = \begin{cases}
    0& \text{wenn }s< 0\\
    \frac{s^2}{2} & \text{wenn }0 \le s< 1\\
    \frac{1}{2}-\frac{(s-1)^2}{2}& \text{wenn }1 \le s < 2\\
    0& \text{wenn } 2 \le s\\
    \end{cases} \\ & = \begin{cases}
    \frac{s^2}{2} & \text{wenn }0 \le s< 1\\
    \frac{1}{2}-\frac{s^2-2s+1}{2}& \text{wenn }1 \le s < 2\\
    0& \text{sonst } \\
    \end{cases} \\ & = \begin{cases}
    \frac{s^2}{2} & \text{wenn }0 \le s< 1\\
    -\frac{s^2-2s}{2}& \text{wenn }1 \le s < 2\\
    0& \text{sonst } \\
    \end{cases}\end{align*}
  • $\displaystyle{\int_1^2(2-x)\cdot 1_{\{s-1\leq x\leq s\}}dx}$ :
    \begin{align*}\int_1^2(2-x)\cdot 1_{\{s-1\leq x\leq s\}}dx&=\begin{cases}
    \int_1^2(2-x)\cdot 1_{\{s-1\leq x\leq s\}}dx & \text{wenn }s< 1\\
    \int_1^2(2-x)\cdot 1_{\{s-1\leq x\leq s\}}dx & \text{wenn }1 \le s< 2\\
    \int_1^2(2-x)\cdot 1_{\{s-1\leq x\leq s\}}dx& \text{wenn }2 \le s < 3\\
    \int_1^2(2-x)\cdot 1_{\{s-1\leq x\leq s\}}dx& \text{wenn } 3 \le s\\
    \end{cases} \\ & = \begin{cases}
    \int_1^2(2-x)\cdot 0 dx & \text{wenn }s< 1\\
    \int_1^s(2-x)dx & \text{wenn }1 \le s< 2\\
    \int_{s-1}^2(2-x)dx& \text{wenn }2 \le s < 3\\
    \int_1^2(2-x)\cdot 0 dx& \text{wenn } 3 \le s\\
    \end{cases} \\ & = \begin{cases}
    0& \text{wenn }s< 1\\
    \left (2s-\frac{s^2}{2}\right )-\left (2-\frac{1^2}{2}\right ) & \text{wenn }1 \le s< 2\\
    \left (4-\frac{2^2}{2}\right )-\left (2(s-1)-\frac{(s-1)^2}{2}\right ) & \text{wenn }2 \le s < 3\\
    0& \text{wenn } 3 \le s\\
    \end{cases} \\ & = \begin{cases}
    2s-\frac{s^2}{2}-\frac{3}{2} & \text{wenn }1 \le s< 2\\
    \left (4-2\right )-\left (2s-2-\frac{s^2-2s+1}{2}\right ) & \text{wenn }2 \le s < 3\\
    0& \text{sonst } \\
    \end{cases} \\ & = \begin{cases}
    2s-\frac{s^2}{2}-\frac{3}{2} & \text{wenn }1 \le s< 2\\
    2-2s+2+\frac{s^2}{2}-s+\frac{1}{2} & \text{wenn }2 \le s < 3\\
    0& \text{sonst } \\
    \end{cases} \\ & = \begin{cases}
    -\frac{s^2}{2}+2s-\frac{3}{2} & \text{wenn }1 \le s< 2\\
    \frac{s^2}{2}-3s+\frac{9}{2} & \text{wenn }2 \le s < 3\\
    0& \text{sonst } \\
    \end{cases}\end{align*}

Wir bekommen also folgendes:
\begin{align*}f_S(s)&=\int_0^1 x\cdot 1_{\{s-1\leq x\leq s\}}dx +\int_1^2(2-x)\cdot 1_{\{s-1\leq x\leq s\}}dx \\ & = \begin{cases}
\frac{s^2}{2} & \text{wenn }0 \le s< 1\\
-\frac{s^2-2s}{2}-\frac{s^2}{2}+2s-\frac{3}{2}& \text{wenn }1 \le s < 2\\
\frac{s^2}{2}-3s+\frac{9}{2} & \text{wenn }2 \le s < 3\\
0& \text{sonst } \\
\end{cases} \\ & = \begin{cases}
\frac{s^2}{2} & \text{wenn }0 \le s< 1\\
-s^2+3s-\frac{3}{2}& \text{wenn }1 \le s < 2\\
\frac{s^2}{2}-3s+\frac{9}{2} & \text{wenn }2 \le s < 3\\
0& \text{sonst } \\
\end{cases}\end{align*}

Us everything correct? (Wondering)
 
  • #12
Dein Ergebnis scheint mit Wolfram übereinzustimmen. (Nod)
 
  • #13
I like Serena said:
Dein Ergebnis scheint mit Wolfram übereinzustimmen. (Nod)

Danke! (Giggle) (Mmm)
 

1. How do I calculate density using the convolution formula?

The convolution formula for calculating density is: density = mass / volume. This means that to find the density of an object, you need to divide its mass by its volume.

2. What units should I use for mass and volume in the convolution formula?

Mass should be measured in grams (g) or kilograms (kg), and volume should be measured in cubic centimeters (cm3) or cubic meters (m3). It is important to use consistent units in order to get an accurate result.

3. Can the convolution formula be used for any type of object?

Yes, the convolution formula can be used to calculate the density of any object, as long as you know its mass and volume. However, it is most commonly used for solid objects, as it can be difficult to accurately measure the volume of liquids and gases.

4. How do I interpret the density value calculated using the convolution formula?

Density is a measure of how much mass is contained within a certain volume. A higher density means that an object is more compact and has more mass per unit of volume. A lower density means the object is less compact and has less mass per unit of volume.

5. Are there any limitations to using the convolution formula for calculating density?

While the convolution formula is a useful tool for calculating density, it may not always be accurate. This is because it assumes that the object being measured has a uniform density throughout. If the object has irregular shapes or varying density, the result may not be entirely accurate. In such cases, other methods such as displacement or Archimedes' principle may be more appropriate.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
749
Replies
0
Views
366
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
490
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
726
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
Replies
3
Views
740
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
823
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
2K
Back
Top