I vote for quadruple integration.
In mathematica notation (as I recall it),
and ignoring the 1/(1-0) unit square averaging factors
The average distance between 2 points
is the quadruple integral
Int[
Int[
Int[
Int[
Sqrt[(x[1]-x[0])^2 + (y[1]-y[0])^2],
{x[0],0,1}]
{x[1],0,1}]
{y[0],0,1}]
{y[1],0,1}]
On 07/06/2016 10:56 PM, [email protected] wrote:
Date: Wed, 6 Jul 2016 12:59:25 +0000 (UTC)
From: "'Jon Hough' via Programming"<[email protected]>
To:<[email protected]>
Subject: Re: [Jprogramming] Average distance between two points in a
square
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=UTF-8
Hi Raul,
"But is it possible to perform this calculation in a reasonable fashion
using d. (or D.)?"
I'm no expert, but I doubt it. In the first answer to the question in your
link, the user gave a comprehensive answer for calculating the case of a unit
square. I think it can be extended to the case for any dimension (just more
integrals). I'm not entirely sure how he evaluated the integral. But anyway
it's a double integral, and I'm not sure how d. or D. can work with double
integrals. I doubt it's possible. And it only gets worse for a cube etc, cus
you'll have a triple integral etc.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm