CDF for distance between two points on line segment

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I am trying to solve a paper and have a basic question which I am unable to understand.



Given a line segment $[0,a]$, two points $x,y$ are randomly selected such that $mathcalD = |x-y| leq l$.
So the CDF would be



$$P(L leq l) = iint_mathcal DmathcalDf_XY(x,y)dxdy,$$



where $f_XY(x,y) = frac1a^2$ when $0 leq x,y leq a$, else $f_XY(x,y) = 0$



Now I dont understand how the author says, taking into account the bounds of both $mathcalD$ and $f_XY(x,y)$, the CDF for distance distribution is as follows:



$$P(Lleq l) = frac1a^2Big(int_0^lint_0^x+ldydx + int_l^a-lint_x-l^x+ldydx + int_a-l^aint_x-l^adydxBig)$$



Can someone explain 'geometrically' how this expression appears?



The actual problem is attached as the figure below.



enter image description here







share|cite|improve this question

















  • 1




    You can get proper spacing in $$ iint_mathcal D $$ by using iint_mathcal D instead of intint_mathcal D.
    – joriki
    Jul 27 at 4:52














up vote
0
down vote

favorite












I am trying to solve a paper and have a basic question which I am unable to understand.



Given a line segment $[0,a]$, two points $x,y$ are randomly selected such that $mathcalD = |x-y| leq l$.
So the CDF would be



$$P(L leq l) = iint_mathcal DmathcalDf_XY(x,y)dxdy,$$



where $f_XY(x,y) = frac1a^2$ when $0 leq x,y leq a$, else $f_XY(x,y) = 0$



Now I dont understand how the author says, taking into account the bounds of both $mathcalD$ and $f_XY(x,y)$, the CDF for distance distribution is as follows:



$$P(Lleq l) = frac1a^2Big(int_0^lint_0^x+ldydx + int_l^a-lint_x-l^x+ldydx + int_a-l^aint_x-l^adydxBig)$$



Can someone explain 'geometrically' how this expression appears?



The actual problem is attached as the figure below.



enter image description here







share|cite|improve this question

















  • 1




    You can get proper spacing in $$ iint_mathcal D $$ by using iint_mathcal D instead of intint_mathcal D.
    – joriki
    Jul 27 at 4:52












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am trying to solve a paper and have a basic question which I am unable to understand.



Given a line segment $[0,a]$, two points $x,y$ are randomly selected such that $mathcalD = |x-y| leq l$.
So the CDF would be



$$P(L leq l) = iint_mathcal DmathcalDf_XY(x,y)dxdy,$$



where $f_XY(x,y) = frac1a^2$ when $0 leq x,y leq a$, else $f_XY(x,y) = 0$



Now I dont understand how the author says, taking into account the bounds of both $mathcalD$ and $f_XY(x,y)$, the CDF for distance distribution is as follows:



$$P(Lleq l) = frac1a^2Big(int_0^lint_0^x+ldydx + int_l^a-lint_x-l^x+ldydx + int_a-l^aint_x-l^adydxBig)$$



Can someone explain 'geometrically' how this expression appears?



The actual problem is attached as the figure below.



enter image description here







share|cite|improve this question













I am trying to solve a paper and have a basic question which I am unable to understand.



Given a line segment $[0,a]$, two points $x,y$ are randomly selected such that $mathcalD = |x-y| leq l$.
So the CDF would be



$$P(L leq l) = iint_mathcal DmathcalDf_XY(x,y)dxdy,$$



where $f_XY(x,y) = frac1a^2$ when $0 leq x,y leq a$, else $f_XY(x,y) = 0$



Now I dont understand how the author says, taking into account the bounds of both $mathcalD$ and $f_XY(x,y)$, the CDF for distance distribution is as follows:



$$P(Lleq l) = frac1a^2Big(int_0^lint_0^x+ldydx + int_l^a-lint_x-l^x+ldydx + int_a-l^aint_x-l^adydxBig)$$



Can someone explain 'geometrically' how this expression appears?



The actual problem is attached as the figure below.



enter image description here









share|cite|improve this question












share|cite|improve this question




share|cite|improve this question








edited Jul 27 at 5:44
























asked Jul 27 at 0:41









Kashan

341110




341110







  • 1




    You can get proper spacing in $$ iint_mathcal D $$ by using iint_mathcal D instead of intint_mathcal D.
    – joriki
    Jul 27 at 4:52












  • 1




    You can get proper spacing in $$ iint_mathcal D $$ by using iint_mathcal D instead of intint_mathcal D.
    – joriki
    Jul 27 at 4:52







1




1




You can get proper spacing in $$ iint_mathcal D $$ by using iint_mathcal D instead of intint_mathcal D.
– joriki
Jul 27 at 4:52




You can get proper spacing in $$ iint_mathcal D $$ by using iint_mathcal D instead of intint_mathcal D.
– joriki
Jul 27 at 4:52










1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










The text is cutting a corner here by not saying why this works for $lgtfrac a2$. I'll first explain it for $llefrac a2$.



The outer integration is over $x$, the inner integration is over $y$. We need to distinguish three cases for the outer integration because the bounds for $y$ are different in each case.



  • If $xle l$, then the lower limit for $y$ is $0$, because any $y$ below $x$ is within $l$ of $x$. The upper limit is $x+l$. This is the first double integral.

  • If $llt xlt a-l$, then any $y$ within $l$ of $x$ lies in $[0,a]$, so the lower and upper limit for $y$ are $x-l$ and $x+l$, respectively. This is the second double integral.

  • If $xge a-l$, then the upper limit for $y$ is $a$, because any $y$ above $x$ is within $l$ of $x$. The lower limit is $x-l$. This is the third double integral.

Now comes the tricky part: If $lgtfrac a2$, the second double integral has the limit for $x$ reversed, so it's negative. This is exactly what we need to cancel the overcounting due to the fact that for $xin[a-l,l]$, in the first and third double integrals the limits $x+l$ and $x-l$, respectively, went beyond $[0,a]$.






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: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    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%2f2863950%2fcdf-for-distance-between-two-points-on-line-segment%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    The text is cutting a corner here by not saying why this works for $lgtfrac a2$. I'll first explain it for $llefrac a2$.



    The outer integration is over $x$, the inner integration is over $y$. We need to distinguish three cases for the outer integration because the bounds for $y$ are different in each case.



    • If $xle l$, then the lower limit for $y$ is $0$, because any $y$ below $x$ is within $l$ of $x$. The upper limit is $x+l$. This is the first double integral.

    • If $llt xlt a-l$, then any $y$ within $l$ of $x$ lies in $[0,a]$, so the lower and upper limit for $y$ are $x-l$ and $x+l$, respectively. This is the second double integral.

    • If $xge a-l$, then the upper limit for $y$ is $a$, because any $y$ above $x$ is within $l$ of $x$. The lower limit is $x-l$. This is the third double integral.

    Now comes the tricky part: If $lgtfrac a2$, the second double integral has the limit for $x$ reversed, so it's negative. This is exactly what we need to cancel the overcounting due to the fact that for $xin[a-l,l]$, in the first and third double integrals the limits $x+l$ and $x-l$, respectively, went beyond $[0,a]$.






    share|cite|improve this answer

























      up vote
      1
      down vote



      accepted










      The text is cutting a corner here by not saying why this works for $lgtfrac a2$. I'll first explain it for $llefrac a2$.



      The outer integration is over $x$, the inner integration is over $y$. We need to distinguish three cases for the outer integration because the bounds for $y$ are different in each case.



      • If $xle l$, then the lower limit for $y$ is $0$, because any $y$ below $x$ is within $l$ of $x$. The upper limit is $x+l$. This is the first double integral.

      • If $llt xlt a-l$, then any $y$ within $l$ of $x$ lies in $[0,a]$, so the lower and upper limit for $y$ are $x-l$ and $x+l$, respectively. This is the second double integral.

      • If $xge a-l$, then the upper limit for $y$ is $a$, because any $y$ above $x$ is within $l$ of $x$. The lower limit is $x-l$. This is the third double integral.

      Now comes the tricky part: If $lgtfrac a2$, the second double integral has the limit for $x$ reversed, so it's negative. This is exactly what we need to cancel the overcounting due to the fact that for $xin[a-l,l]$, in the first and third double integrals the limits $x+l$ and $x-l$, respectively, went beyond $[0,a]$.






      share|cite|improve this answer























        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        The text is cutting a corner here by not saying why this works for $lgtfrac a2$. I'll first explain it for $llefrac a2$.



        The outer integration is over $x$, the inner integration is over $y$. We need to distinguish three cases for the outer integration because the bounds for $y$ are different in each case.



        • If $xle l$, then the lower limit for $y$ is $0$, because any $y$ below $x$ is within $l$ of $x$. The upper limit is $x+l$. This is the first double integral.

        • If $llt xlt a-l$, then any $y$ within $l$ of $x$ lies in $[0,a]$, so the lower and upper limit for $y$ are $x-l$ and $x+l$, respectively. This is the second double integral.

        • If $xge a-l$, then the upper limit for $y$ is $a$, because any $y$ above $x$ is within $l$ of $x$. The lower limit is $x-l$. This is the third double integral.

        Now comes the tricky part: If $lgtfrac a2$, the second double integral has the limit for $x$ reversed, so it's negative. This is exactly what we need to cancel the overcounting due to the fact that for $xin[a-l,l]$, in the first and third double integrals the limits $x+l$ and $x-l$, respectively, went beyond $[0,a]$.






        share|cite|improve this answer













        The text is cutting a corner here by not saying why this works for $lgtfrac a2$. I'll first explain it for $llefrac a2$.



        The outer integration is over $x$, the inner integration is over $y$. We need to distinguish three cases for the outer integration because the bounds for $y$ are different in each case.



        • If $xle l$, then the lower limit for $y$ is $0$, because any $y$ below $x$ is within $l$ of $x$. The upper limit is $x+l$. This is the first double integral.

        • If $llt xlt a-l$, then any $y$ within $l$ of $x$ lies in $[0,a]$, so the lower and upper limit for $y$ are $x-l$ and $x+l$, respectively. This is the second double integral.

        • If $xge a-l$, then the upper limit for $y$ is $a$, because any $y$ above $x$ is within $l$ of $x$. The lower limit is $x-l$. This is the third double integral.

        Now comes the tricky part: If $lgtfrac a2$, the second double integral has the limit for $x$ reversed, so it's negative. This is exactly what we need to cancel the overcounting due to the fact that for $xin[a-l,l]$, in the first and third double integrals the limits $x+l$ and $x-l$, respectively, went beyond $[0,a]$.







        share|cite|improve this answer













        share|cite|improve this answer



        share|cite|improve this answer











        answered Jul 27 at 5:08









        joriki

        164k10179328




        164k10179328






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2863950%2fcdf-for-distance-between-two-points-on-line-segment%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            What is the equation of a 3D cone with generalised tilt?

            Color the edges and diagonals of a regular polygon

            Relationship between determinant of matrix and determinant of adjoint?