Here's an example of single, double and triple integrals using d. 1 0 1 0 1&p. d. _1 0 1 0 0.333333333333333315 0 0.200000000000000011&p. 1 0 1 0 1&p. d. _2 0 0 0.5 0 0.0833333333333333287 0 0.0333333333333333329&p. 1 0 1 0 1&p. d. _3 0 0 0 0.166666666666666657 0 0.0166666666666666664 0 0.00476190476190476147&p.
D. works similarly. Notice, in particular, that the constant of integration is assumed to be zero. (But this won't matter for a definite integral over the range 0..1). Thanks, -- Raul On Wed, Jul 6, 2016 at 8:59 AM, 'Jon Hough' via Programming <[email protected]> wrote: > 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. > > Regards > -------------------------------------------- > On Tue, 7/5/16, Raul Miller <[email protected]> wrote: > > Subject: [Jprogramming] Average distance between two points in a square > To: "Programming forum" <[email protected]> > Date: Tuesday, July 5, 2016, 5:28 AM > > I was looking at > > http://math.stackexchange.com/questions/1294800/average-distance-between-two-randomly-chosen-points-in-unit-square-without-calc > and I was wondering how one might perform this calculation > in J. > > It is, of course, fairly straightforward to approximate: > > (+/ %#)+/&.:*:@:(-/)?2 2 1e7$0 > 0.521401 > > And, you can just plug in the result given there: > > (1%15)*(2+]+5*[:^.1+])%:2 > 0.521405 > > But is it possible to perform this calculation in a > reasonable fashion > using d. (or D.)? > > More specifically, though, I would like to derive a version > of this > which works for arbitrary dimension (line, square, cube, > tesseract, > etc.) > > But so far my attempts in that direction have just gotten me > domain errors. > > Perhaps what I should do is just sit down and derive the > first four > values of that sequence and then see if a pattern stands > out. But > before I did this, I thought I should check if this sort of > thing > strikes someone else as being either familiar or > interesting. > > Thanks, > > -- > Raul > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
