Average ratio of Manhattan distance to Euclidean distance

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











up vote
3
down vote

favorite












Suppose we've picked two points randomly from a uniform distribution over the Euclidean plane and we know that the Euclidean distance between them is $d$. What is the expected value of the Manhattan distance, $m$, between the two points, $E[m|d]$?



For context: I originally thought it was just a simple application of the Pythagorean theorem. But knowing that $a^2+b^2=c^2$ doesn't allow me to recover $a+b$ as a function of $c$, right? That function depends on factors other than the side lengths, and it's not immediately obvious to me as to how to proceed. For further context, I have haversine distances between pairs of points. I'd love a quick and dirty way to convert these to driving distances, for which Manhattan would work fine assuming a grid-like transportation network.







share|cite|improve this question






















  • If the question is not well-formulated, I'd appreciate guidance on how to correct it. Thanks!
    – Shane
    Aug 9 at 17:24










  • could you include some details of your thoughts so far?
    – Connor Harris
    Aug 9 at 17:24







  • 2




    Regardless, here's a hint: write the two points as $(x, y)$ and $(x + d cos theta, y + d sin theta)$ where $theta$ is uniform in $[0, 2pi)$.
    – Connor Harris
    Aug 9 at 17:28











  • Could you include some of those details in the question? They're relevant.
    – Connor Harris
    Aug 9 at 17:31










  • I think the assumption is that the angle between them is supposed to be of normal expected value (is it? how does one select a two points?) so manhatten distance will be the expected value of $d(|sin theta + cos theta|)$
    – fleablood
    Aug 9 at 17:38














up vote
3
down vote

favorite












Suppose we've picked two points randomly from a uniform distribution over the Euclidean plane and we know that the Euclidean distance between them is $d$. What is the expected value of the Manhattan distance, $m$, between the two points, $E[m|d]$?



For context: I originally thought it was just a simple application of the Pythagorean theorem. But knowing that $a^2+b^2=c^2$ doesn't allow me to recover $a+b$ as a function of $c$, right? That function depends on factors other than the side lengths, and it's not immediately obvious to me as to how to proceed. For further context, I have haversine distances between pairs of points. I'd love a quick and dirty way to convert these to driving distances, for which Manhattan would work fine assuming a grid-like transportation network.







share|cite|improve this question






















  • If the question is not well-formulated, I'd appreciate guidance on how to correct it. Thanks!
    – Shane
    Aug 9 at 17:24










  • could you include some details of your thoughts so far?
    – Connor Harris
    Aug 9 at 17:24







  • 2




    Regardless, here's a hint: write the two points as $(x, y)$ and $(x + d cos theta, y + d sin theta)$ where $theta$ is uniform in $[0, 2pi)$.
    – Connor Harris
    Aug 9 at 17:28











  • Could you include some of those details in the question? They're relevant.
    – Connor Harris
    Aug 9 at 17:31










  • I think the assumption is that the angle between them is supposed to be of normal expected value (is it? how does one select a two points?) so manhatten distance will be the expected value of $d(|sin theta + cos theta|)$
    – fleablood
    Aug 9 at 17:38












up vote
3
down vote

favorite









up vote
3
down vote

favorite











Suppose we've picked two points randomly from a uniform distribution over the Euclidean plane and we know that the Euclidean distance between them is $d$. What is the expected value of the Manhattan distance, $m$, between the two points, $E[m|d]$?



For context: I originally thought it was just a simple application of the Pythagorean theorem. But knowing that $a^2+b^2=c^2$ doesn't allow me to recover $a+b$ as a function of $c$, right? That function depends on factors other than the side lengths, and it's not immediately obvious to me as to how to proceed. For further context, I have haversine distances between pairs of points. I'd love a quick and dirty way to convert these to driving distances, for which Manhattan would work fine assuming a grid-like transportation network.







share|cite|improve this question














Suppose we've picked two points randomly from a uniform distribution over the Euclidean plane and we know that the Euclidean distance between them is $d$. What is the expected value of the Manhattan distance, $m$, between the two points, $E[m|d]$?



For context: I originally thought it was just a simple application of the Pythagorean theorem. But knowing that $a^2+b^2=c^2$ doesn't allow me to recover $a+b$ as a function of $c$, right? That function depends on factors other than the side lengths, and it's not immediately obvious to me as to how to proceed. For further context, I have haversine distances between pairs of points. I'd love a quick and dirty way to convert these to driving distances, for which Manhattan would work fine assuming a grid-like transportation network.









share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Aug 9 at 17:31

























asked Aug 9 at 17:20









Shane

918718




918718











  • If the question is not well-formulated, I'd appreciate guidance on how to correct it. Thanks!
    – Shane
    Aug 9 at 17:24










  • could you include some details of your thoughts so far?
    – Connor Harris
    Aug 9 at 17:24







  • 2




    Regardless, here's a hint: write the two points as $(x, y)$ and $(x + d cos theta, y + d sin theta)$ where $theta$ is uniform in $[0, 2pi)$.
    – Connor Harris
    Aug 9 at 17:28











  • Could you include some of those details in the question? They're relevant.
    – Connor Harris
    Aug 9 at 17:31










  • I think the assumption is that the angle between them is supposed to be of normal expected value (is it? how does one select a two points?) so manhatten distance will be the expected value of $d(|sin theta + cos theta|)$
    – fleablood
    Aug 9 at 17:38
















  • If the question is not well-formulated, I'd appreciate guidance on how to correct it. Thanks!
    – Shane
    Aug 9 at 17:24










  • could you include some details of your thoughts so far?
    – Connor Harris
    Aug 9 at 17:24







  • 2




    Regardless, here's a hint: write the two points as $(x, y)$ and $(x + d cos theta, y + d sin theta)$ where $theta$ is uniform in $[0, 2pi)$.
    – Connor Harris
    Aug 9 at 17:28











  • Could you include some of those details in the question? They're relevant.
    – Connor Harris
    Aug 9 at 17:31










  • I think the assumption is that the angle between them is supposed to be of normal expected value (is it? how does one select a two points?) so manhatten distance will be the expected value of $d(|sin theta + cos theta|)$
    – fleablood
    Aug 9 at 17:38















If the question is not well-formulated, I'd appreciate guidance on how to correct it. Thanks!
– Shane
Aug 9 at 17:24




If the question is not well-formulated, I'd appreciate guidance on how to correct it. Thanks!
– Shane
Aug 9 at 17:24












could you include some details of your thoughts so far?
– Connor Harris
Aug 9 at 17:24





could you include some details of your thoughts so far?
– Connor Harris
Aug 9 at 17:24





2




2




Regardless, here's a hint: write the two points as $(x, y)$ and $(x + d cos theta, y + d sin theta)$ where $theta$ is uniform in $[0, 2pi)$.
– Connor Harris
Aug 9 at 17:28





Regardless, here's a hint: write the two points as $(x, y)$ and $(x + d cos theta, y + d sin theta)$ where $theta$ is uniform in $[0, 2pi)$.
– Connor Harris
Aug 9 at 17:28













Could you include some of those details in the question? They're relevant.
– Connor Harris
Aug 9 at 17:31




Could you include some of those details in the question? They're relevant.
– Connor Harris
Aug 9 at 17:31












I think the assumption is that the angle between them is supposed to be of normal expected value (is it? how does one select a two points?) so manhatten distance will be the expected value of $d(|sin theta + cos theta|)$
– fleablood
Aug 9 at 17:38




I think the assumption is that the angle between them is supposed to be of normal expected value (is it? how does one select a two points?) so manhatten distance will be the expected value of $d(|sin theta + cos theta|)$
– fleablood
Aug 9 at 17:38










2 Answers
2






active

oldest

votes

















up vote
5
down vote



accepted










Basic approach. Make the assumption that one point is at the origin, and the other point is uniformly distributed on the circle centered at the origin with radius $d$. Equivalently, the argument $theta$ of that point is uniformly distributed on the interval $[0, 2pi]$. Note that the Manhattan distance $m$ is $|dsintheta| + |dcostheta|$, so



$$
E(m mid d) = E(|dsintheta|)+E(|dcostheta|)
$$



Simple integration should take you the rest of the way there—does that suffice, or could you use more direction?






share|cite|improve this answer






















  • Neat. Just to be sure, your $E(m)$ is actually $E(m|d=1)$ right? And it takes me to $4/pi$ as the average ratio.
    – Shane
    Aug 9 at 17:35







  • 1




    @Shane: Yeah. I'll edit my post.
    – Brian Tung
    Aug 9 at 18:13

















up vote
2
down vote













What you are asking is simply the average Manhattan distance of the points on a circle of radius $d$ to the center. By symmetry you can perform the computation in a single quadrant and evaluate the average abscissa and average ordinate, which are equal.



In polar coordinates and for a unit circle,



$$fracpi2 E(x)=int_0^pi/2 x,dtheta=int_0^pi/2 costheta,dtheta=1.$$



Finally,



$$E(m)=frac 4pi d$$ where the factor is larger than one and smaller than the square root of two, as could be expected.






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%2f2877479%2faverage-ratio-of-manhattan-distance-to-euclidean-distance%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    5
    down vote



    accepted










    Basic approach. Make the assumption that one point is at the origin, and the other point is uniformly distributed on the circle centered at the origin with radius $d$. Equivalently, the argument $theta$ of that point is uniformly distributed on the interval $[0, 2pi]$. Note that the Manhattan distance $m$ is $|dsintheta| + |dcostheta|$, so



    $$
    E(m mid d) = E(|dsintheta|)+E(|dcostheta|)
    $$



    Simple integration should take you the rest of the way there—does that suffice, or could you use more direction?






    share|cite|improve this answer






















    • Neat. Just to be sure, your $E(m)$ is actually $E(m|d=1)$ right? And it takes me to $4/pi$ as the average ratio.
      – Shane
      Aug 9 at 17:35







    • 1




      @Shane: Yeah. I'll edit my post.
      – Brian Tung
      Aug 9 at 18:13














    up vote
    5
    down vote



    accepted










    Basic approach. Make the assumption that one point is at the origin, and the other point is uniformly distributed on the circle centered at the origin with radius $d$. Equivalently, the argument $theta$ of that point is uniformly distributed on the interval $[0, 2pi]$. Note that the Manhattan distance $m$ is $|dsintheta| + |dcostheta|$, so



    $$
    E(m mid d) = E(|dsintheta|)+E(|dcostheta|)
    $$



    Simple integration should take you the rest of the way there—does that suffice, or could you use more direction?






    share|cite|improve this answer






















    • Neat. Just to be sure, your $E(m)$ is actually $E(m|d=1)$ right? And it takes me to $4/pi$ as the average ratio.
      – Shane
      Aug 9 at 17:35







    • 1




      @Shane: Yeah. I'll edit my post.
      – Brian Tung
      Aug 9 at 18:13












    up vote
    5
    down vote



    accepted







    up vote
    5
    down vote



    accepted






    Basic approach. Make the assumption that one point is at the origin, and the other point is uniformly distributed on the circle centered at the origin with radius $d$. Equivalently, the argument $theta$ of that point is uniformly distributed on the interval $[0, 2pi]$. Note that the Manhattan distance $m$ is $|dsintheta| + |dcostheta|$, so



    $$
    E(m mid d) = E(|dsintheta|)+E(|dcostheta|)
    $$



    Simple integration should take you the rest of the way there—does that suffice, or could you use more direction?






    share|cite|improve this answer














    Basic approach. Make the assumption that one point is at the origin, and the other point is uniformly distributed on the circle centered at the origin with radius $d$. Equivalently, the argument $theta$ of that point is uniformly distributed on the interval $[0, 2pi]$. Note that the Manhattan distance $m$ is $|dsintheta| + |dcostheta|$, so



    $$
    E(m mid d) = E(|dsintheta|)+E(|dcostheta|)
    $$



    Simple integration should take you the rest of the way there—does that suffice, or could you use more direction?







    share|cite|improve this answer














    share|cite|improve this answer



    share|cite|improve this answer








    edited Aug 9 at 18:14

























    answered Aug 9 at 17:29









    Brian Tung

    25.3k32453




    25.3k32453











    • Neat. Just to be sure, your $E(m)$ is actually $E(m|d=1)$ right? And it takes me to $4/pi$ as the average ratio.
      – Shane
      Aug 9 at 17:35







    • 1




      @Shane: Yeah. I'll edit my post.
      – Brian Tung
      Aug 9 at 18:13
















    • Neat. Just to be sure, your $E(m)$ is actually $E(m|d=1)$ right? And it takes me to $4/pi$ as the average ratio.
      – Shane
      Aug 9 at 17:35







    • 1




      @Shane: Yeah. I'll edit my post.
      – Brian Tung
      Aug 9 at 18:13















    Neat. Just to be sure, your $E(m)$ is actually $E(m|d=1)$ right? And it takes me to $4/pi$ as the average ratio.
    – Shane
    Aug 9 at 17:35





    Neat. Just to be sure, your $E(m)$ is actually $E(m|d=1)$ right? And it takes me to $4/pi$ as the average ratio.
    – Shane
    Aug 9 at 17:35





    1




    1




    @Shane: Yeah. I'll edit my post.
    – Brian Tung
    Aug 9 at 18:13




    @Shane: Yeah. I'll edit my post.
    – Brian Tung
    Aug 9 at 18:13










    up vote
    2
    down vote













    What you are asking is simply the average Manhattan distance of the points on a circle of radius $d$ to the center. By symmetry you can perform the computation in a single quadrant and evaluate the average abscissa and average ordinate, which are equal.



    In polar coordinates and for a unit circle,



    $$fracpi2 E(x)=int_0^pi/2 x,dtheta=int_0^pi/2 costheta,dtheta=1.$$



    Finally,



    $$E(m)=frac 4pi d$$ where the factor is larger than one and smaller than the square root of two, as could be expected.






    share|cite|improve this answer


























      up vote
      2
      down vote













      What you are asking is simply the average Manhattan distance of the points on a circle of radius $d$ to the center. By symmetry you can perform the computation in a single quadrant and evaluate the average abscissa and average ordinate, which are equal.



      In polar coordinates and for a unit circle,



      $$fracpi2 E(x)=int_0^pi/2 x,dtheta=int_0^pi/2 costheta,dtheta=1.$$



      Finally,



      $$E(m)=frac 4pi d$$ where the factor is larger than one and smaller than the square root of two, as could be expected.






      share|cite|improve this answer
























        up vote
        2
        down vote










        up vote
        2
        down vote









        What you are asking is simply the average Manhattan distance of the points on a circle of radius $d$ to the center. By symmetry you can perform the computation in a single quadrant and evaluate the average abscissa and average ordinate, which are equal.



        In polar coordinates and for a unit circle,



        $$fracpi2 E(x)=int_0^pi/2 x,dtheta=int_0^pi/2 costheta,dtheta=1.$$



        Finally,



        $$E(m)=frac 4pi d$$ where the factor is larger than one and smaller than the square root of two, as could be expected.






        share|cite|improve this answer














        What you are asking is simply the average Manhattan distance of the points on a circle of radius $d$ to the center. By symmetry you can perform the computation in a single quadrant and evaluate the average abscissa and average ordinate, which are equal.



        In polar coordinates and for a unit circle,



        $$fracpi2 E(x)=int_0^pi/2 x,dtheta=int_0^pi/2 costheta,dtheta=1.$$



        Finally,



        $$E(m)=frac 4pi d$$ where the factor is larger than one and smaller than the square root of two, as could be expected.







        share|cite|improve this answer














        share|cite|improve this answer



        share|cite|improve this answer








        edited Aug 9 at 19:05

























        answered Aug 9 at 18:26









        Yves Daoust

        112k665205




        112k665205






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2877479%2faverage-ratio-of-manhattan-distance-to-euclidean-distance%23new-answer', 'question_page');

            );

            Post as a guest













































































            這個網誌中的熱門文章

            tkz-euclide: tkzDrawCircle[R] not working

            How to combine Bézier curves to a surface?

            1st Magritte Awards