Pdf of $|X-Y|$ when $X,Y$ are independent Uniform $[0,a]$ variables












0














Need to find pdf of $ |X-Y| $ .I little confused and not getting answer after taking below limits.
As it is symmetrical I have taken one part of triangle.
Considering lower triangle limits I have taken is x from $ y+z $ to $ a $ and outer limit : y from $ 0 $ to $ a-z $
Not getting expected answer.
Could any help.



Answer:
$f_{z}(z)=frac{2}{a}(1-frac{z}{a})$










share|cite|improve this question





























    0














    Need to find pdf of $ |X-Y| $ .I little confused and not getting answer after taking below limits.
    As it is symmetrical I have taken one part of triangle.
    Considering lower triangle limits I have taken is x from $ y+z $ to $ a $ and outer limit : y from $ 0 $ to $ a-z $
    Not getting expected answer.
    Could any help.



    Answer:
    $f_{z}(z)=frac{2}{a}(1-frac{z}{a})$










    share|cite|improve this question



























      0












      0








      0


      1





      Need to find pdf of $ |X-Y| $ .I little confused and not getting answer after taking below limits.
      As it is symmetrical I have taken one part of triangle.
      Considering lower triangle limits I have taken is x from $ y+z $ to $ a $ and outer limit : y from $ 0 $ to $ a-z $
      Not getting expected answer.
      Could any help.



      Answer:
      $f_{z}(z)=frac{2}{a}(1-frac{z}{a})$










      share|cite|improve this question















      Need to find pdf of $ |X-Y| $ .I little confused and not getting answer after taking below limits.
      As it is symmetrical I have taken one part of triangle.
      Considering lower triangle limits I have taken is x from $ y+z $ to $ a $ and outer limit : y from $ 0 $ to $ a-z $
      Not getting expected answer.
      Could any help.



      Answer:
      $f_{z}(z)=frac{2}{a}(1-frac{z}{a})$







      probability probability-distributions random-variables uniform-distribution






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Dec 22 '18 at 19:58









      StubbornAtom

      5,36411138




      5,36411138










      asked Nov 22 '18 at 12:35









      Pramod_achar

      13




      13






















          2 Answers
          2






          active

          oldest

          votes


















          0














          |X-Y| can be written as below ,



          $ P(|X-Y| leq z )= P(X-Y leq z ,X ge Y )+P(Y-X leq z ,Y >X ) \ $



          The limits can be visualized by drawing rectangle and |x-y| and take area of the other sides,which would be symmetry hence multiple 2.



          $ F_Z(z)=1-2int_{y=0}^{y=a-z} int_{y+z}^{a}f(x,y) dxdy \ $



          After differentiating w.r.t z ,



          $ f_Z(z)=0+2 int_{0}^{a-z} f(y+z,y)dy \ $



          $ =frac{2}{a^{2}}(a-z) $






          share|cite|improve this answer





























            0














            Since $X$ and $Y$ are identically distributed, $P(X-Yle z,Xge Y)=P(Y-Xle z,Yge X)$



            So for $0< z<a$,



            begin{align}
            P(|X-Y|le z)&=2times P(X-Yle z,Xge Y)
            \&=2 int P(X-yle z,Xge ymid Y=y)f_Y(y),dy
            \&=2int P(yle Xle z+y)frac{mathbf1_{0<y<a}}{a},dy
            \&=frac{2}{a}int_0^a int_y^{min(z+y,,,a)}frac{1}{a},dx,dy
            \&=frac{2}{a^2}left[int_0^{a-z}int_y^{z+y},dx,dy+int_{a-z}^aint_y^a,dx,dyright]
            \&=frac{2}{a^2}left(az-frac{z^2}{2}right)
            end{align}



            Hence the pdf of $Z=|X-Y|$ is



            $$f_Z(z)=frac{2}{a^2}(a-z)mathbf1_{0<z<a}$$



            Needless to say, the above algebra for the CDF is not as simple as drawing a picture of the region ${(x,y)in[0,a]^2:|x-y|le z}$ and finding its area.



            Here is a picture for $z=0.6$ and $a=3$: (Also see the case $a=1$ discussed in this post)



            enter image description here






            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',
              autoActivateHeartbeat: false,
              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%2f3009075%2fpdf-of-x-y-when-x-y-are-independent-uniform-0-a-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









              0














              |X-Y| can be written as below ,



              $ P(|X-Y| leq z )= P(X-Y leq z ,X ge Y )+P(Y-X leq z ,Y >X ) \ $



              The limits can be visualized by drawing rectangle and |x-y| and take area of the other sides,which would be symmetry hence multiple 2.



              $ F_Z(z)=1-2int_{y=0}^{y=a-z} int_{y+z}^{a}f(x,y) dxdy \ $



              After differentiating w.r.t z ,



              $ f_Z(z)=0+2 int_{0}^{a-z} f(y+z,y)dy \ $



              $ =frac{2}{a^{2}}(a-z) $






              share|cite|improve this answer


























                0














                |X-Y| can be written as below ,



                $ P(|X-Y| leq z )= P(X-Y leq z ,X ge Y )+P(Y-X leq z ,Y >X ) \ $



                The limits can be visualized by drawing rectangle and |x-y| and take area of the other sides,which would be symmetry hence multiple 2.



                $ F_Z(z)=1-2int_{y=0}^{y=a-z} int_{y+z}^{a}f(x,y) dxdy \ $



                After differentiating w.r.t z ,



                $ f_Z(z)=0+2 int_{0}^{a-z} f(y+z,y)dy \ $



                $ =frac{2}{a^{2}}(a-z) $






                share|cite|improve this answer
























                  0












                  0








                  0






                  |X-Y| can be written as below ,



                  $ P(|X-Y| leq z )= P(X-Y leq z ,X ge Y )+P(Y-X leq z ,Y >X ) \ $



                  The limits can be visualized by drawing rectangle and |x-y| and take area of the other sides,which would be symmetry hence multiple 2.



                  $ F_Z(z)=1-2int_{y=0}^{y=a-z} int_{y+z}^{a}f(x,y) dxdy \ $



                  After differentiating w.r.t z ,



                  $ f_Z(z)=0+2 int_{0}^{a-z} f(y+z,y)dy \ $



                  $ =frac{2}{a^{2}}(a-z) $






                  share|cite|improve this answer












                  |X-Y| can be written as below ,



                  $ P(|X-Y| leq z )= P(X-Y leq z ,X ge Y )+P(Y-X leq z ,Y >X ) \ $



                  The limits can be visualized by drawing rectangle and |x-y| and take area of the other sides,which would be symmetry hence multiple 2.



                  $ F_Z(z)=1-2int_{y=0}^{y=a-z} int_{y+z}^{a}f(x,y) dxdy \ $



                  After differentiating w.r.t z ,



                  $ f_Z(z)=0+2 int_{0}^{a-z} f(y+z,y)dy \ $



                  $ =frac{2}{a^{2}}(a-z) $







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered Dec 22 '18 at 17:32









                  Pramod_achar

                  13




                  13























                      0














                      Since $X$ and $Y$ are identically distributed, $P(X-Yle z,Xge Y)=P(Y-Xle z,Yge X)$



                      So for $0< z<a$,



                      begin{align}
                      P(|X-Y|le z)&=2times P(X-Yle z,Xge Y)
                      \&=2 int P(X-yle z,Xge ymid Y=y)f_Y(y),dy
                      \&=2int P(yle Xle z+y)frac{mathbf1_{0<y<a}}{a},dy
                      \&=frac{2}{a}int_0^a int_y^{min(z+y,,,a)}frac{1}{a},dx,dy
                      \&=frac{2}{a^2}left[int_0^{a-z}int_y^{z+y},dx,dy+int_{a-z}^aint_y^a,dx,dyright]
                      \&=frac{2}{a^2}left(az-frac{z^2}{2}right)
                      end{align}



                      Hence the pdf of $Z=|X-Y|$ is



                      $$f_Z(z)=frac{2}{a^2}(a-z)mathbf1_{0<z<a}$$



                      Needless to say, the above algebra for the CDF is not as simple as drawing a picture of the region ${(x,y)in[0,a]^2:|x-y|le z}$ and finding its area.



                      Here is a picture for $z=0.6$ and $a=3$: (Also see the case $a=1$ discussed in this post)



                      enter image description here






                      share|cite|improve this answer




























                        0














                        Since $X$ and $Y$ are identically distributed, $P(X-Yle z,Xge Y)=P(Y-Xle z,Yge X)$



                        So for $0< z<a$,



                        begin{align}
                        P(|X-Y|le z)&=2times P(X-Yle z,Xge Y)
                        \&=2 int P(X-yle z,Xge ymid Y=y)f_Y(y),dy
                        \&=2int P(yle Xle z+y)frac{mathbf1_{0<y<a}}{a},dy
                        \&=frac{2}{a}int_0^a int_y^{min(z+y,,,a)}frac{1}{a},dx,dy
                        \&=frac{2}{a^2}left[int_0^{a-z}int_y^{z+y},dx,dy+int_{a-z}^aint_y^a,dx,dyright]
                        \&=frac{2}{a^2}left(az-frac{z^2}{2}right)
                        end{align}



                        Hence the pdf of $Z=|X-Y|$ is



                        $$f_Z(z)=frac{2}{a^2}(a-z)mathbf1_{0<z<a}$$



                        Needless to say, the above algebra for the CDF is not as simple as drawing a picture of the region ${(x,y)in[0,a]^2:|x-y|le z}$ and finding its area.



                        Here is a picture for $z=0.6$ and $a=3$: (Also see the case $a=1$ discussed in this post)



                        enter image description here






                        share|cite|improve this answer


























                          0












                          0








                          0






                          Since $X$ and $Y$ are identically distributed, $P(X-Yle z,Xge Y)=P(Y-Xle z,Yge X)$



                          So for $0< z<a$,



                          begin{align}
                          P(|X-Y|le z)&=2times P(X-Yle z,Xge Y)
                          \&=2 int P(X-yle z,Xge ymid Y=y)f_Y(y),dy
                          \&=2int P(yle Xle z+y)frac{mathbf1_{0<y<a}}{a},dy
                          \&=frac{2}{a}int_0^a int_y^{min(z+y,,,a)}frac{1}{a},dx,dy
                          \&=frac{2}{a^2}left[int_0^{a-z}int_y^{z+y},dx,dy+int_{a-z}^aint_y^a,dx,dyright]
                          \&=frac{2}{a^2}left(az-frac{z^2}{2}right)
                          end{align}



                          Hence the pdf of $Z=|X-Y|$ is



                          $$f_Z(z)=frac{2}{a^2}(a-z)mathbf1_{0<z<a}$$



                          Needless to say, the above algebra for the CDF is not as simple as drawing a picture of the region ${(x,y)in[0,a]^2:|x-y|le z}$ and finding its area.



                          Here is a picture for $z=0.6$ and $a=3$: (Also see the case $a=1$ discussed in this post)



                          enter image description here






                          share|cite|improve this answer














                          Since $X$ and $Y$ are identically distributed, $P(X-Yle z,Xge Y)=P(Y-Xle z,Yge X)$



                          So for $0< z<a$,



                          begin{align}
                          P(|X-Y|le z)&=2times P(X-Yle z,Xge Y)
                          \&=2 int P(X-yle z,Xge ymid Y=y)f_Y(y),dy
                          \&=2int P(yle Xle z+y)frac{mathbf1_{0<y<a}}{a},dy
                          \&=frac{2}{a}int_0^a int_y^{min(z+y,,,a)}frac{1}{a},dx,dy
                          \&=frac{2}{a^2}left[int_0^{a-z}int_y^{z+y},dx,dy+int_{a-z}^aint_y^a,dx,dyright]
                          \&=frac{2}{a^2}left(az-frac{z^2}{2}right)
                          end{align}



                          Hence the pdf of $Z=|X-Y|$ is



                          $$f_Z(z)=frac{2}{a^2}(a-z)mathbf1_{0<z<a}$$



                          Needless to say, the above algebra for the CDF is not as simple as drawing a picture of the region ${(x,y)in[0,a]^2:|x-y|le z}$ and finding its area.



                          Here is a picture for $z=0.6$ and $a=3$: (Also see the case $a=1$ discussed in this post)



                          enter image description here







                          share|cite|improve this answer














                          share|cite|improve this answer



                          share|cite|improve this answer








                          edited Dec 22 '18 at 19:54

























                          answered Dec 22 '18 at 19:19









                          StubbornAtom

                          5,36411138




                          5,36411138






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Mathematics Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              Use MathJax to format equations. MathJax reference.


                              To learn more, see our tips on writing great answers.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3009075%2fpdf-of-x-y-when-x-y-are-independent-uniform-0-a-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

                              How to change which sound is reproduced for terminal bell?

                              Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

                              Can I use Tabulator js library in my java Spring + Thymeleaf project?