Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #5901 > unrolled thread

Multiple integration: bug?

Started by"Dr. Wolfgang Hintze" <weh@snafu.de>
First post2011-10-26 21:51 +0000
Last post2011-10-29 11:29 +0000
Articles 3 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Multiple integration: bug? "Dr. Wolfgang Hintze" <weh@snafu.de> - 2011-10-26 21:51 +0000
    Re: Multiple integration: bug? Ray Koopman <koopman@sfu.ca> - 2011-10-27 10:41 +0000
    Re: Multiple integration: bug? "Dr. Wolfgang Hintze" <weh@snafu.de> - 2011-10-29 11:29 +0000

#5901 — Multiple integration: bug?

From"Dr. Wolfgang Hintze" <weh@snafu.de>
Date2011-10-26 21:51 +0000
SubjectMultiple integration: bug?
Message-ID<j89vct$224$1@smc.vnet.net>
In calculating Integrals of the type Integrate[0<x1<x2<...<xn<1] which 
should give 1/n! I observed a strange behaviour

Using UnitStep[] it works fine for n=2 to n=5:

In[48]:=
Integrate[UnitStep[x[2] - x[1]]*UnitStep[x[3] - x[2]]*UnitStep[x[4] - 
x[3]]*UnitStep[x[5] - x[4]], {x[1], 0, 1}, {x[2], 0, 1}, {x[3], 0, 1}, 
{x[4], 0, 1}, {x[5], 0, 1}]
Out[48]=
1/120


It gives nonsense for n=6 (and higher):

In[47]:=
Integrate[UnitStep[x[2] - x[1]]*UnitStep[x[3] - x[2]]*UnitStep[x[4] - 
x[3]]*UnitStep[x[5] - x[4]]*UnitStep[x[6] - x[5]], {x[1], 0, 1}, {x[2], 
0, 1}, {x[3], 0, 1}, {x[4], 0, 1}, {x[5], 0, 1},
{x[6], 0, 1}]
Out[47]=
-(1/4)

Is this a bug or did I make a mistake somewhere (did not consider 
bounds or depth level etc.)?

Any comment is appreciated.

BTW: using Boolean instead of UnitStep seems to have no restriction.

--- Wolfgang

[toc] | [next] | [standalone]


#5932

FromRay Koopman <koopman@sfu.ca>
Date2011-10-27 10:41 +0000
Message-ID<j8bch0$8sf$1@smc.vnet.net>
In reply to#5901
On Oct 26, 2:51 pm, "Dr. Wolfgang Hintze" <w...@snafu.de> wrote:
> In calculating Integrals of the type Integrate[0<x1<x2<...<xn<1] which
> should give 1/n! I observed a strange behaviour
>
> Using UnitStep[] it works fine for n=2 to n=5:
>
> In[48]:=
> Integrate[UnitStep[x[2] - x[1]]*UnitStep[x[3] - x[2]]*UnitStep[x[4] -
> x[3]]*UnitStep[x[5] - x[4]], {x[1], 0, 1}, {x[2], 0, 1}, {x[3], 0, 1},
> {x[4], 0, 1}, {x[5], 0, 1}]
> Out[48]=
> 1/120
>
> It gives nonsense for n=6 (and higher):
>
> In[47]:=
> Integrate[UnitStep[x[2] - x[1]]*UnitStep[x[3] - x[2]]*UnitStep[x[4] -
> x[3]]*UnitStep[x[5] - x[4]]*UnitStep[x[6] - x[5]], {x[1], 0, 1}, {x[2],
> 0, 1}, {x[3], 0, 1}, {x[4], 0, 1}, {x[5], 0, 1},
> {x[6], 0, 1}]
> Out[47]=
> -(1/4)
>
> Is this a bug or did I make a mistake somewhere (did not consider
> bounds or depth level etc.)?
>
> Any comment is appreciated.
>
> BTW: using Boolean instead of UnitStep seems to have no restriction.
>
> --- Wolfgang

Why not just integrate over 0 < x1 < x2 < ... < xn < 1 ?

In[1]:=
f[n_Integer?Positive] := Block[{x}, Integrate[1, Sequence @@
({#2,#1,1}& @@@ Partition[Prepend[Array[x,n],0],2,1]) ] ]

In[2]:= f[6]

Out[2]= 1/720

[toc] | [prev] | [next] | [standalone]


#6016

From"Dr. Wolfgang Hintze" <weh@snafu.de>
Date2011-10-29 11:29 +0000
Message-ID<j8go2d$5j3$1@smc.vnet.net>
In reply to#5901
Thank you all for the valuable hints.
--- Wolfgang

"Dr. Wolfgang Hintze" <weh@snafu.de> schrieb im Newsbeitrag 
news:j89vct$224$1@smc.vnet.net...
> In calculating Integrals of the type Integrate[0<x1<x2<...<xn<1] 
> which
> should give 1/n! I observed a strange behaviour
>
> Using UnitStep[] it works fine for n=2 to n=5:
>
> In[48]:=
> Integrate[UnitStep[x[2] - x[1]]*UnitStep[x[3] - x[2]]*UnitStep[x[4] -
> x[3]]*UnitStep[x[5] - x[4]], {x[1], 0, 1}, {x[2], 0, 1}, {x[3], 0, 
> 1},
> {x[4], 0, 1}, {x[5], 0, 1}]
> Out[48]=
> 1/120
>
>
> It gives nonsense for n=6 (and higher):
>
> In[47]:=
> Integrate[UnitStep[x[2] - x[1]]*UnitStep[x[3] - x[2]]*UnitStep[x[4] -
> x[3]]*UnitStep[x[5] - x[4]]*UnitStep[x[6] - x[5]], {x[1], 0, 1}, 
> {x[2],
> 0, 1}, {x[3], 0, 1}, {x[4], 0, 1}, {x[5], 0, 1},
> {x[6], 0, 1}]
> Out[47]=
> -(1/4)
>
> Is this a bug or did I make a mistake somewhere (did not consider
> bounds or depth level etc.)?
>
> Any comment is appreciated.
>
> BTW: using Boolean instead of UnitStep seems to have no restriction.
>
> --- Wolfgang
>
> 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web