CDF and PDF of absolute difference of two exponential random variables.











up vote
0
down vote

favorite












I'm studying probability theory and came across an exercise problem that I would like to request some help with. Here's the problem:






Let $X$ and $Y$ be i.i.d. random variables with Expo($1$), and let $Z = | X - Y |$. Find the CDF and PDF of $Z$.






My attempt



begin{align}
F_Z(z) & = P(Z le z)\
& = P(|X - Y| le z) \
& = P(-z le X - Y le z) \
& = P(X - Y le z) - P(X - Y le -z) \
& = P(X le Y + z) - P(X le Y - z) \
& = F_X(Y + z) - F_X(Y - z) \
& = (1 - e^{-(Y + z)}) - (1 - e^{-(Y - z)}) \
& = e^{-(Y - z)} - e^{-(Y + z)} \
end{align}






begin{align}
f_Z(z) & = frac{d}{dz}F_Z(z) \
& = frac{d}{dz}(e^{-(Y-z)} - e^{-(Y + z)}) \
& = e^{-(Y - z)} + e^{-(Y + z)} \
end{align}






The problems/questions that I have are




  1. I'm not sure if this approach is even correct. I'm sure that I have to find the CDF first then differentiate it, but is this the correct way?


  2. How do I handle the $Y$ in the final equations?



Thank you.










share|cite|improve this question




























    up vote
    0
    down vote

    favorite












    I'm studying probability theory and came across an exercise problem that I would like to request some help with. Here's the problem:






    Let $X$ and $Y$ be i.i.d. random variables with Expo($1$), and let $Z = | X - Y |$. Find the CDF and PDF of $Z$.






    My attempt



    begin{align}
    F_Z(z) & = P(Z le z)\
    & = P(|X - Y| le z) \
    & = P(-z le X - Y le z) \
    & = P(X - Y le z) - P(X - Y le -z) \
    & = P(X le Y + z) - P(X le Y - z) \
    & = F_X(Y + z) - F_X(Y - z) \
    & = (1 - e^{-(Y + z)}) - (1 - e^{-(Y - z)}) \
    & = e^{-(Y - z)} - e^{-(Y + z)} \
    end{align}






    begin{align}
    f_Z(z) & = frac{d}{dz}F_Z(z) \
    & = frac{d}{dz}(e^{-(Y-z)} - e^{-(Y + z)}) \
    & = e^{-(Y - z)} + e^{-(Y + z)} \
    end{align}






    The problems/questions that I have are




    1. I'm not sure if this approach is even correct. I'm sure that I have to find the CDF first then differentiate it, but is this the correct way?


    2. How do I handle the $Y$ in the final equations?



    Thank you.










    share|cite|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm studying probability theory and came across an exercise problem that I would like to request some help with. Here's the problem:






      Let $X$ and $Y$ be i.i.d. random variables with Expo($1$), and let $Z = | X - Y |$. Find the CDF and PDF of $Z$.






      My attempt



      begin{align}
      F_Z(z) & = P(Z le z)\
      & = P(|X - Y| le z) \
      & = P(-z le X - Y le z) \
      & = P(X - Y le z) - P(X - Y le -z) \
      & = P(X le Y + z) - P(X le Y - z) \
      & = F_X(Y + z) - F_X(Y - z) \
      & = (1 - e^{-(Y + z)}) - (1 - e^{-(Y - z)}) \
      & = e^{-(Y - z)} - e^{-(Y + z)} \
      end{align}






      begin{align}
      f_Z(z) & = frac{d}{dz}F_Z(z) \
      & = frac{d}{dz}(e^{-(Y-z)} - e^{-(Y + z)}) \
      & = e^{-(Y - z)} + e^{-(Y + z)} \
      end{align}






      The problems/questions that I have are




      1. I'm not sure if this approach is even correct. I'm sure that I have to find the CDF first then differentiate it, but is this the correct way?


      2. How do I handle the $Y$ in the final equations?



      Thank you.










      share|cite|improve this question















      I'm studying probability theory and came across an exercise problem that I would like to request some help with. Here's the problem:






      Let $X$ and $Y$ be i.i.d. random variables with Expo($1$), and let $Z = | X - Y |$. Find the CDF and PDF of $Z$.






      My attempt



      begin{align}
      F_Z(z) & = P(Z le z)\
      & = P(|X - Y| le z) \
      & = P(-z le X - Y le z) \
      & = P(X - Y le z) - P(X - Y le -z) \
      & = P(X le Y + z) - P(X le Y - z) \
      & = F_X(Y + z) - F_X(Y - z) \
      & = (1 - e^{-(Y + z)}) - (1 - e^{-(Y - z)}) \
      & = e^{-(Y - z)} - e^{-(Y + z)} \
      end{align}






      begin{align}
      f_Z(z) & = frac{d}{dz}F_Z(z) \
      & = frac{d}{dz}(e^{-(Y-z)} - e^{-(Y + z)}) \
      & = e^{-(Y - z)} + e^{-(Y + z)} \
      end{align}






      The problems/questions that I have are




      1. I'm not sure if this approach is even correct. I'm sure that I have to find the CDF first then differentiate it, but is this the correct way?


      2. How do I handle the $Y$ in the final equations?



      Thank you.







      probability exponential-distribution






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited 11 hours ago

























      asked 11 hours ago









      Sean

      20410




      20410






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote













          Sadly, your answer cannot be correct because the random variable $Y$ remains in your CDF and PDF. The CDF of $Z$ should be only a function of $z$ and the parameters.



          Your initial approach is sound, however. Let's see how to complete it.



          $$Pr[Z le z] = Pr[X le Y + z] - Pr[X le Y - z]$$ is correct. Now, let's see how to attack each term on the right. We have
          $$Pr[X le Y + z] = int_{y=0}^infty Pr[X le y + z] f_Y(y) , dy,$$ by the law of total probability. This in turn yields $$Pr[X le Y + z] = int_{y=0}^infty (1 - e^{-(y+z)}) e^{-y} , dy = 1 - e^{-z}/2.$$ Similarly, $$Pr[X le Y - z] = int_{y=0}^infty Pr[X le y - z]f_Y(y) , dy.$$ However, you must be careful here. Whereas in the first case we had no issues with $y + z < 0$, since $y$ and $z$ must both be nonnegative, in this situation we could have $0 le y < z$, in which case $Pr[X le y-z] = 0$, because $X$ cannot be negative. Consequently, we can write this as $$Pr[X le Y - z] = int_{y=z}^infty Pr[X le y-z] f_Y(y) , dy,$$ noting that the lower limit of integration can begin at $y = z$, since on the interval $y in [0,z)$, the integrand is zero.



          I have left the remaining calculations as an exercise. What is your result? Is it surprising? If so, how might you go about verifying it?






          share|cite|improve this answer




























            up vote
            0
            down vote













            Since $Z > 0$ a.s. we can assume that $z > 0$ in $P(Z leq z)$. Then you get $P(X leq Y +z) - P(X leq Y -z)$. Since $X$ and $Y$ are exponentialy distributed they are a.s. positive, so $Y + z > 0$ therefore part $P(X leq Y+z)$ is fine. On the other hand we must be careful with $P(X leq Y-z)$. Since total probability rule
            begin{align}
            P(X leq Y-z) & = P(X leq Y-z |Y leq z)P(Yleq z) + P(X leq Y-z |Y> z)P(Y>z) \
            & = P(Xleq Y-z|Y > z)P(Y>z)
            end{align}

            But what is $P(X leq Y-z)$? It is some number between 0 an 1 dependent only on parameter $z$. But it involves two random variables, so just as in one dimensional case where you integrate density over subcpace of real line to get $P(X leq z)$, here we must integrate joint densities of both random variables over some subspace of plane (since $X$ and $Y$ are independent we can take product of their densities instead). So
            begin{align}
            P(X leq Y -z) & = int_z^{infty} int_0^{y-z} e^{-y}e^{-x}dx dy \
            & = -left(frac{e^{-z}}{2}-e^{-z}right)
            end{align}



            In same way, only that we integrate over different region, we get $P(X leq Y+z) = -left(frac{1}{2}e^{-z}-1right)$. Then when you take in account that $P(Y > z ) = e^{-z}$ everything else is just elementary computation.



            To get PDF you must of course differentiate CDF of $Z$ (in fact $Z$ must be absolutely continuous but in this, as in most cases, it is). But again CDF and PDF respectively must be functions of only $z$.






            share|cite|improve this answer























              Your Answer





              StackExchange.ifUsing("editor", function () {
              return StackExchange.using("mathjaxEditing", function () {
              StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
              StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
              });
              });
              }, "mathjax-editing");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "69"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              noCode: true, onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














               

              draft saved


              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3000818%2fcdf-and-pdf-of-absolute-difference-of-two-exponential-random-variables%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              1
              down vote













              Sadly, your answer cannot be correct because the random variable $Y$ remains in your CDF and PDF. The CDF of $Z$ should be only a function of $z$ and the parameters.



              Your initial approach is sound, however. Let's see how to complete it.



              $$Pr[Z le z] = Pr[X le Y + z] - Pr[X le Y - z]$$ is correct. Now, let's see how to attack each term on the right. We have
              $$Pr[X le Y + z] = int_{y=0}^infty Pr[X le y + z] f_Y(y) , dy,$$ by the law of total probability. This in turn yields $$Pr[X le Y + z] = int_{y=0}^infty (1 - e^{-(y+z)}) e^{-y} , dy = 1 - e^{-z}/2.$$ Similarly, $$Pr[X le Y - z] = int_{y=0}^infty Pr[X le y - z]f_Y(y) , dy.$$ However, you must be careful here. Whereas in the first case we had no issues with $y + z < 0$, since $y$ and $z$ must both be nonnegative, in this situation we could have $0 le y < z$, in which case $Pr[X le y-z] = 0$, because $X$ cannot be negative. Consequently, we can write this as $$Pr[X le Y - z] = int_{y=z}^infty Pr[X le y-z] f_Y(y) , dy,$$ noting that the lower limit of integration can begin at $y = z$, since on the interval $y in [0,z)$, the integrand is zero.



              I have left the remaining calculations as an exercise. What is your result? Is it surprising? If so, how might you go about verifying it?






              share|cite|improve this answer

























                up vote
                1
                down vote













                Sadly, your answer cannot be correct because the random variable $Y$ remains in your CDF and PDF. The CDF of $Z$ should be only a function of $z$ and the parameters.



                Your initial approach is sound, however. Let's see how to complete it.



                $$Pr[Z le z] = Pr[X le Y + z] - Pr[X le Y - z]$$ is correct. Now, let's see how to attack each term on the right. We have
                $$Pr[X le Y + z] = int_{y=0}^infty Pr[X le y + z] f_Y(y) , dy,$$ by the law of total probability. This in turn yields $$Pr[X le Y + z] = int_{y=0}^infty (1 - e^{-(y+z)}) e^{-y} , dy = 1 - e^{-z}/2.$$ Similarly, $$Pr[X le Y - z] = int_{y=0}^infty Pr[X le y - z]f_Y(y) , dy.$$ However, you must be careful here. Whereas in the first case we had no issues with $y + z < 0$, since $y$ and $z$ must both be nonnegative, in this situation we could have $0 le y < z$, in which case $Pr[X le y-z] = 0$, because $X$ cannot be negative. Consequently, we can write this as $$Pr[X le Y - z] = int_{y=z}^infty Pr[X le y-z] f_Y(y) , dy,$$ noting that the lower limit of integration can begin at $y = z$, since on the interval $y in [0,z)$, the integrand is zero.



                I have left the remaining calculations as an exercise. What is your result? Is it surprising? If so, how might you go about verifying it?






                share|cite|improve this answer























                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  Sadly, your answer cannot be correct because the random variable $Y$ remains in your CDF and PDF. The CDF of $Z$ should be only a function of $z$ and the parameters.



                  Your initial approach is sound, however. Let's see how to complete it.



                  $$Pr[Z le z] = Pr[X le Y + z] - Pr[X le Y - z]$$ is correct. Now, let's see how to attack each term on the right. We have
                  $$Pr[X le Y + z] = int_{y=0}^infty Pr[X le y + z] f_Y(y) , dy,$$ by the law of total probability. This in turn yields $$Pr[X le Y + z] = int_{y=0}^infty (1 - e^{-(y+z)}) e^{-y} , dy = 1 - e^{-z}/2.$$ Similarly, $$Pr[X le Y - z] = int_{y=0}^infty Pr[X le y - z]f_Y(y) , dy.$$ However, you must be careful here. Whereas in the first case we had no issues with $y + z < 0$, since $y$ and $z$ must both be nonnegative, in this situation we could have $0 le y < z$, in which case $Pr[X le y-z] = 0$, because $X$ cannot be negative. Consequently, we can write this as $$Pr[X le Y - z] = int_{y=z}^infty Pr[X le y-z] f_Y(y) , dy,$$ noting that the lower limit of integration can begin at $y = z$, since on the interval $y in [0,z)$, the integrand is zero.



                  I have left the remaining calculations as an exercise. What is your result? Is it surprising? If so, how might you go about verifying it?






                  share|cite|improve this answer












                  Sadly, your answer cannot be correct because the random variable $Y$ remains in your CDF and PDF. The CDF of $Z$ should be only a function of $z$ and the parameters.



                  Your initial approach is sound, however. Let's see how to complete it.



                  $$Pr[Z le z] = Pr[X le Y + z] - Pr[X le Y - z]$$ is correct. Now, let's see how to attack each term on the right. We have
                  $$Pr[X le Y + z] = int_{y=0}^infty Pr[X le y + z] f_Y(y) , dy,$$ by the law of total probability. This in turn yields $$Pr[X le Y + z] = int_{y=0}^infty (1 - e^{-(y+z)}) e^{-y} , dy = 1 - e^{-z}/2.$$ Similarly, $$Pr[X le Y - z] = int_{y=0}^infty Pr[X le y - z]f_Y(y) , dy.$$ However, you must be careful here. Whereas in the first case we had no issues with $y + z < 0$, since $y$ and $z$ must both be nonnegative, in this situation we could have $0 le y < z$, in which case $Pr[X le y-z] = 0$, because $X$ cannot be negative. Consequently, we can write this as $$Pr[X le Y - z] = int_{y=z}^infty Pr[X le y-z] f_Y(y) , dy,$$ noting that the lower limit of integration can begin at $y = z$, since on the interval $y in [0,z)$, the integrand is zero.



                  I have left the remaining calculations as an exercise. What is your result? Is it surprising? If so, how might you go about verifying it?







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered 9 hours ago









                  heropup

                  61.8k65997




                  61.8k65997






















                      up vote
                      0
                      down vote













                      Since $Z > 0$ a.s. we can assume that $z > 0$ in $P(Z leq z)$. Then you get $P(X leq Y +z) - P(X leq Y -z)$. Since $X$ and $Y$ are exponentialy distributed they are a.s. positive, so $Y + z > 0$ therefore part $P(X leq Y+z)$ is fine. On the other hand we must be careful with $P(X leq Y-z)$. Since total probability rule
                      begin{align}
                      P(X leq Y-z) & = P(X leq Y-z |Y leq z)P(Yleq z) + P(X leq Y-z |Y> z)P(Y>z) \
                      & = P(Xleq Y-z|Y > z)P(Y>z)
                      end{align}

                      But what is $P(X leq Y-z)$? It is some number between 0 an 1 dependent only on parameter $z$. But it involves two random variables, so just as in one dimensional case where you integrate density over subcpace of real line to get $P(X leq z)$, here we must integrate joint densities of both random variables over some subspace of plane (since $X$ and $Y$ are independent we can take product of their densities instead). So
                      begin{align}
                      P(X leq Y -z) & = int_z^{infty} int_0^{y-z} e^{-y}e^{-x}dx dy \
                      & = -left(frac{e^{-z}}{2}-e^{-z}right)
                      end{align}



                      In same way, only that we integrate over different region, we get $P(X leq Y+z) = -left(frac{1}{2}e^{-z}-1right)$. Then when you take in account that $P(Y > z ) = e^{-z}$ everything else is just elementary computation.



                      To get PDF you must of course differentiate CDF of $Z$ (in fact $Z$ must be absolutely continuous but in this, as in most cases, it is). But again CDF and PDF respectively must be functions of only $z$.






                      share|cite|improve this answer



























                        up vote
                        0
                        down vote













                        Since $Z > 0$ a.s. we can assume that $z > 0$ in $P(Z leq z)$. Then you get $P(X leq Y +z) - P(X leq Y -z)$. Since $X$ and $Y$ are exponentialy distributed they are a.s. positive, so $Y + z > 0$ therefore part $P(X leq Y+z)$ is fine. On the other hand we must be careful with $P(X leq Y-z)$. Since total probability rule
                        begin{align}
                        P(X leq Y-z) & = P(X leq Y-z |Y leq z)P(Yleq z) + P(X leq Y-z |Y> z)P(Y>z) \
                        & = P(Xleq Y-z|Y > z)P(Y>z)
                        end{align}

                        But what is $P(X leq Y-z)$? It is some number between 0 an 1 dependent only on parameter $z$. But it involves two random variables, so just as in one dimensional case where you integrate density over subcpace of real line to get $P(X leq z)$, here we must integrate joint densities of both random variables over some subspace of plane (since $X$ and $Y$ are independent we can take product of their densities instead). So
                        begin{align}
                        P(X leq Y -z) & = int_z^{infty} int_0^{y-z} e^{-y}e^{-x}dx dy \
                        & = -left(frac{e^{-z}}{2}-e^{-z}right)
                        end{align}



                        In same way, only that we integrate over different region, we get $P(X leq Y+z) = -left(frac{1}{2}e^{-z}-1right)$. Then when you take in account that $P(Y > z ) = e^{-z}$ everything else is just elementary computation.



                        To get PDF you must of course differentiate CDF of $Z$ (in fact $Z$ must be absolutely continuous but in this, as in most cases, it is). But again CDF and PDF respectively must be functions of only $z$.






                        share|cite|improve this answer

























                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          Since $Z > 0$ a.s. we can assume that $z > 0$ in $P(Z leq z)$. Then you get $P(X leq Y +z) - P(X leq Y -z)$. Since $X$ and $Y$ are exponentialy distributed they are a.s. positive, so $Y + z > 0$ therefore part $P(X leq Y+z)$ is fine. On the other hand we must be careful with $P(X leq Y-z)$. Since total probability rule
                          begin{align}
                          P(X leq Y-z) & = P(X leq Y-z |Y leq z)P(Yleq z) + P(X leq Y-z |Y> z)P(Y>z) \
                          & = P(Xleq Y-z|Y > z)P(Y>z)
                          end{align}

                          But what is $P(X leq Y-z)$? It is some number between 0 an 1 dependent only on parameter $z$. But it involves two random variables, so just as in one dimensional case where you integrate density over subcpace of real line to get $P(X leq z)$, here we must integrate joint densities of both random variables over some subspace of plane (since $X$ and $Y$ are independent we can take product of their densities instead). So
                          begin{align}
                          P(X leq Y -z) & = int_z^{infty} int_0^{y-z} e^{-y}e^{-x}dx dy \
                          & = -left(frac{e^{-z}}{2}-e^{-z}right)
                          end{align}



                          In same way, only that we integrate over different region, we get $P(X leq Y+z) = -left(frac{1}{2}e^{-z}-1right)$. Then when you take in account that $P(Y > z ) = e^{-z}$ everything else is just elementary computation.



                          To get PDF you must of course differentiate CDF of $Z$ (in fact $Z$ must be absolutely continuous but in this, as in most cases, it is). But again CDF and PDF respectively must be functions of only $z$.






                          share|cite|improve this answer














                          Since $Z > 0$ a.s. we can assume that $z > 0$ in $P(Z leq z)$. Then you get $P(X leq Y +z) - P(X leq Y -z)$. Since $X$ and $Y$ are exponentialy distributed they are a.s. positive, so $Y + z > 0$ therefore part $P(X leq Y+z)$ is fine. On the other hand we must be careful with $P(X leq Y-z)$. Since total probability rule
                          begin{align}
                          P(X leq Y-z) & = P(X leq Y-z |Y leq z)P(Yleq z) + P(X leq Y-z |Y> z)P(Y>z) \
                          & = P(Xleq Y-z|Y > z)P(Y>z)
                          end{align}

                          But what is $P(X leq Y-z)$? It is some number between 0 an 1 dependent only on parameter $z$. But it involves two random variables, so just as in one dimensional case where you integrate density over subcpace of real line to get $P(X leq z)$, here we must integrate joint densities of both random variables over some subspace of plane (since $X$ and $Y$ are independent we can take product of their densities instead). So
                          begin{align}
                          P(X leq Y -z) & = int_z^{infty} int_0^{y-z} e^{-y}e^{-x}dx dy \
                          & = -left(frac{e^{-z}}{2}-e^{-z}right)
                          end{align}



                          In same way, only that we integrate over different region, we get $P(X leq Y+z) = -left(frac{1}{2}e^{-z}-1right)$. Then when you take in account that $P(Y > z ) = e^{-z}$ everything else is just elementary computation.



                          To get PDF you must of course differentiate CDF of $Z$ (in fact $Z$ must be absolutely continuous but in this, as in most cases, it is). But again CDF and PDF respectively must be functions of only $z$.







                          share|cite|improve this answer














                          share|cite|improve this answer



                          share|cite|improve this answer








                          edited 8 hours ago

























                          answered 9 hours ago









                          Jan Rems

                          163




                          163






























                               

                              draft saved


                              draft discarded



















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3000818%2fcdf-and-pdf-of-absolute-difference-of-two-exponential-random-variables%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Le Mesnil-Réaume

                              Ida-Boy-Ed-Garten

                              web3.py web3.isConnected() returns false always