Giovanni Peccati and Murad S. Taqqu

advertisement
Mathematica Companion Notebook to :
Giovanni Peccati
and
Murad S. Taqqu
"Wiener Chaos: Moments,
Cumulants and Diagrams"
"A survey with computer implementation"
Bocconi & Springer Series, Vol. 1
Springer Verlag (2010)
ISBN: 978-88-470-1678-1
(November 10, 2010)
Table of Contents
Table of Contents
ç General Introduction
ç When Starting
ç Error Messages
à Integer Partitions
à Basic Set Partitions
à Operations with Set Partitions
à Partition Segments
à Mobius Formula
à Moments and Cumulants
à Gaussian Multiple Integrals
à Poisson Multiple Integrals
à Contraction and Symmetrization
à Solving Partition Equations involving P*
à Product of Two Gaussian Multiple Integrals
à Product of Two Poisson Multiple Integrals
à MSets and MZeroSets
à Hermite Polynomials
à Poisson-Charlier Polynomials
General Introduction
The Mathematica program (version 7.0) must be installed on your computer or remotely through your system.
The filename of a Mathematica notebooks ends with a ".nb". In Windows, double-clicking on the notebook will open the notebook and start Mathematica.
To execute the entire notebook (on Windows), press Control-A (to select all the cells in the notebook), followed by Shift-Enter.
These actions will execute all of the function definitions and examples in this notebook. This may take a little time. You can then,
in this notebook or a new notebook that you have opened, apply the functions created in this notebook to new set partitions or to
create additional examples of your own. You may type, paste, or outline a command and then press Shift-Enter to execute it.
Please note that the execution of any of these functions requires the use of the Combinatorica package in Mathematica (which
can be activated by executing the line Needs["Combinatorica`"]. We automatically execute this package in this notebook.
If possible, include also the notebook "StyleFile978-88-470-1678-1.nb" in the same directory as this notebook, so that this
notebook will be nicely formatted.
Please note that the execution of any of these functions requires the use of the Combinatorica package in Mathematica (which
can be activated by executing the line Needs["Combinatorica`"]. We automatically execute this package in this notebook.
If possible, include also the notebook "StyleFile978-88-470-1678-1.nb" in the same directory as this notebook, so that this
notebook will be nicely formatted.
To type a command, simply type the appropriate function and the desired argument and press Shift-Enter to execute the cell in
which the command is located. Mathematica will label the command as a numbered input and the output will be numbered
correspondingly. One can recall previous outputs with commands like "%5", which would recover the fifth output in the current
Mathematica session. Unexecuted cells have no input label.
A warning: Some of the functions in this notebook use a brute-force methodology. The number of set partitions associated to a
positive integer n grows very rapidly, and so any brute-force methodology may suffer from combinatorial explosion. Unless you
have lots of time and computational resources at your disposal, it may be better to investigate examples for which n is small.
Comments about the time it takes to evaluate a function. To evaluate the time it takes to simulate 1,000,000 realizations of a
standard normal random variable, type
In[1]:=
Out[1]=
[email protected] @0, 1D, 81 000 000<D;  AbsoluteTiming
80.2656250, Null<
The semicolon supresses the display of the output (except for the timing result), which is generated by AbsoluteTiming. The
first part of the output is the number of seconds it took Mathematica to generate 1,000,000 realizations of a standard normal
random variable. The output was surpressed, which is why the symbol Null appears in the second position.
Comments about the function names. We typically give the functions long, informative names. In practical use, one may
sometimes want to use a shorter name. For example, to have the function Chi do the same thing as the function
CumulantVectorToMoments, set
In[2]:=
Chi = CumulantVectorToMoments ;
Comments about Mathematica notation. In Mathematica, a set partition is denoted in a particular way, for example,
881, 2, 4<, 83<, 85<< is a set partition of the set 81, 2, 3, 4, 5<. The trivial, or maximal, partition consisting of the entire set is
denoted 881, 2, 3, 4, 5<< and the set partition consisting entirely of singletons is denoted 881<, 82<, 83<, 84<, 85<<.
Comments about hard returns. Mathematica ignores hard returns. Therefore, if the input line is long, one can press "Enter" in
order to subdivide it.
Comments about stopping the execution of a function. Hold down the "Alt" key and then press the "." key, or go to the menu
at the top, choose "Evaluation" and then choose "Abort Evaluation."
Comments about clearing the kernel. Sometimes it is useful to clear all of the local variable and function definitions from the
Mathematica kernel. To do so, go to menu at the top, choose "Evaluation" and then choose "Quit kernel." Quit either the local
kernel on your computer or, if you run Mathematica remotely, the remote kernel. Then re-execute the notebook.
In[3]:=
When Starting
ì Master Functions
Type first the following two commands:
In[4]:=
[email protected]"Combinatorica` "D
[email protected]::firstD
The first command loads the package Combinatorica. The second command shuts off an error message that does not impact any
of the function outputs. These commands will be executed in sequence.
Integer Partitions
ì IntegerPartitions: find all nonnegative integers that sum up to
an integer n, ignoring order; this is a built-in Mathematica
function
é Example: find all integer partitions of the number 5
In[47]:=
Out[47]=
IntegerPartitions @5D
885<, 84, 1<, 83, 2<, 83, 1, 1<, 82, 2, 1<, 82, 1, 1, 1<, 81, 1, 1, 1, 1<<
For example, the output 83, 1, 1< should be read as the decomposition 5 = 3 + 1 + 1.
é Example: count the number of integer partitions of the number 5
In[48]:=
Out[48]=
[email protected] @5DD
7
ì IntegerPartitionsExponentRepresentation: this function
represents the output of IntegerPartitions in exponent
notation; namely, I1r1 2r2 ... nrn M, where ri is the number of times
that integer i appears in the decomposition, i = 1, ..., n
In[49]:=
IntegerPartitionsExponentRepresentation @n_D :=
[email protected] = IntegerPartitions @nD, FillInZeros<,
[email protected]_, list_D := [email protected] = First ž list, unavailable,
additions, complete<, unavailable = [email protected]@tD, availableD;
additions = 8ð, 0< & ž unavailable; complete = [email protected], additionsD;
[email protected]@8"H"<, [email protected]ð@@1DD, ð@@2DDD & ž complete, 8"L"<DDD;
[email protected], Tally ž ðD & ž integerpartitions D
é Example: find all integer partitions of the number 5, and express them in exponent notation
In[50]:=
Out[50]=
IntegerPartitionsExponentRepresentation @5D
9H10 20 30 40 51 L, H11 20 30 41 50 L, H10 21 31 40 50 L, H12 20 31 40 50 L, H11 22 30 40 50 L, H13 21 30 40 50 L, H15 20 30 40 50 L=
For example, 5 = 3 + 1 + 1 is expressed as I12 20 31 40 50 M since there are 2 ones and 1 three.
Basic Set Partitions
ì SingletonPartition: generates the singleton set partition of
`
order n, namely 0 = 881<, 82<, ... 8n<<
In[51]:=
SingletonPartition @n_D := Transpose ž [email protected]<
é Example: generate the singleton set partition of order 12
In[52]:=
Out[52]=
SingletonPartition @12D
881<, 82<, 83<, 84<, 85<, 86<, 87<, 88<, 89<, 810<, 811<, 812<<
ì MaximalPartition: generates the maximal set partition of order
`
n, namely 1 = 881, 2, ..., n<
In[53]:=
MaximalPartition @n_D := [email protected]<
é Example: generate the maximal set partition of order 12
In[54]:=
Out[54]=
MaximalPartition @12D
881, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12<<
ì SetPartitions: enumerates all of the set partitions associated
with a particular integer n, namely all set partitions of
81, 2, ..., n<; this is a built-in Mathematica function
é Example:
In[55]:=
Out[55]=
SetPartitions @3D
8881, 2, 3<<, 881<, 82, 3<<, 881, 2<, 83<<, 881, 3<, 82<<, 881<, 82<, 83<<<
é Example: same example with grid display
In[56]:=
Out[56]=
[email protected] @3D, Frame ® AllD
81, 2, 3<
81<
82, 3<
81, 2<
83<
81, 3<
82<
81<
82<
83<
é Example: to obtain the number of partitions in the same example
In[57]:=
Out[57]=
[email protected] @3DD
5
é Example: the singleton partition of order n is the last member of SetPartitions[n], which provides an alternative (but slower) way
to generate the singleton partition
In[58]:=
Out[58]=
Last ž SetPartitions @8D
881<, 82<, 83<, 84<, 85<, 86<, 87<, 88<<
It is much faster to generate the singleton partition using SingletonPartition.
In[59]:=
Out[59]=
SingletonPartition @8D
881<, 82<, 83<, 84<, 85<, 86<, 87<, 88<<
ì PiStar: generate a set partition of 81, 2, ..., n1 + ... + nk <, with k
blocks, the first of size n1 and the last of size nk
In[60]:=
[email protected]_D := [email protected] = [email protected], ran,
control = [email protected]@[email protected]@list, - 1D, 1DD, [email protected]<D,
pistar<, ran = [email protected];
pistar = [email protected]@@[email protected]@i, 1DD ;; [email protected]@i, 2DDDD, 8i, 1, Length ž control<DD
é Example: create a set partition P* with blocks of size 1, 2, 4, 7, and 9
In[61]:=
Out[61]=
[email protected], 2, 4, 7, 9<D
881<, 82, 3<, 84, 5, 6, 7<, 88, 9, 10, 11, 12, 13, 14<, 815, 16, 17, 18, 19, 20, 21, 22, 23<<
Operations with Set Partitions
ì Partition Intersection: finds the meet Σ ß Π between two set
partitions Σ and Π; each block of Σ ß Π is a non-empty
intersection between one block of Σ and one block of Π
In[62]:=
PartitionIntersection @A_, B_D ; [email protected] @AD && SetPartitionQ @BDL,
True, HHSetPartitionQ @AD Š FalseL && HSetPartitionQ @BD Š TrueLL,
[email protected] ::badarg, AD; False,
HHSetPartitionQ @AD Š TrueL && HSetPartitionQ @BD Š FalseLL,
[email protected] ::badarg, BD; FalseD :=
[email protected]@[email protected] Š [email protected]@BDD, [email protected] @[email protected]@
HAPiTL Ý HBPjTL, 8i, 1, [email protected]<, 8j, 1, [email protected]<D, 1DD, [email protected]ð1D > 0 &D, "Error"D
é Example: find the meet between the set partitions {{1,4,5},{2},{3}} and {{1,2,5},{3},{4}}
In[63]:=
Out[63]=
PartitionIntersection @881, 4, 5<, 82<, 83<<, 881, 2, 5<, 83<, 84<<D
881, 5<, 82<, 83<, 84<<
é Example: if the partitions Σ and Π are not of the same order, then PartitionIntersection returns a message
In[64]:=
Out[64]=
PartitionIntersection @SingletonPartition @8D, 881, 2, 5, 6, 7<, 83<, 84<<D
Error
ì Partition Union: finds the join Σ Þ Π between two set partitions
Σ and Π; that is, the union of blocks of Σ and Π that have at
least one element in common
In[65]:=
PartitionUnion @x_, y_D ; [email protected] @xD && SetPartitionQ @yDL,
True, HHSetPartitionQ @xD Š FalseL && HSetPartitionQ @yD Š TrueLL,
[email protected] ::badarg, xD; False,
HHSetPartitionQ @xD Š TrueL && HSetPartitionQ @yD Š FalseLL,
[email protected] ::badarg, yD; FalseD :=
[email protected]<, Τ@a_, b_D := [email protected]@[email protected]@[email protected] @[email protected]@iDD, [email protected]@jDDD Š 8<,
8<, [email protected]@@iDD, [email protected]@jDDDD, 8i, 1, [email protected]<, 8j, 1, [email protected]<D, 1DD,
[email protected]ðD > 0 &D; Β = Τ@x, yD; ToCanonicalSetPartition ž [email protected]
[email protected]@[email protected]@Β, [email protected]@Intersection @Β@@iDD, Β@@jDDD Š 8<, False, TrueD,
8i, 1, [email protected]ΒD<, 8j, 1, [email protected]ΒD<[email protected]@kDDDDD, 8k, 1, [email protected]ΒD<DDD
é Example: find the join between the set partitions {{1,4,5},{2},{3}} and {{1,2,5},{3},{4}}
In[66]:=
Out[66]=
PartitionUnion @881, 4, 5<, 82<, 83<<, 881, 2, 5<, 83<, 84<<D
881, 2, 4, 5<, 83<<
é Example: find the join between the set partitions {{1},{2},{3},{4},{5},{6}} and {{1,2,5},{3},{4}}
In[67]:=
Out[67]=
PartitionUnion @SingletonPartition @6D, 881, 2, 5<, 83<, 84<<D
881, 2, 5<, 83<, 84<<
Notice that the union of these two set partitions is well-defined even though the two set partitions are of different order.
é Example: find the join between the set partitions {{1,2,3,4,5,6}} and {{1,2,5},{3},{4}}
In[68]:=
PartitionUnion @881, 2, 3, 4, 5, 6<<, 881, 2, 5<, 83<, 84<<D
Out[68]=
881, 2, 3, 4, 5, 6<<
In[69]:=
881, 2, 3, 4, 5, 6<<
Out[69]=
881, 2, 3, 4, 5, 6<<
Again, the union of these two set partitions is well-defined, even though the two set partitions are of different order.
ì MeetSolve: for a fixed set partition Π, find all set partitions Σ
`
such that the meet of Π and Σ is the singleton partition 0, that
`
is, Σ ß Π = 0
In[70]:=
[email protected]_D ; [email protected] @PD, True, [email protected]::badarg, PD; FalseD :=
[email protected], B<, A = [email protected] @SetPartitions @[email protected]@[email protected]@iDD, PD,
8i, 1, [email protected] @[email protected]@PDDDD<D;
B = [email protected]@[email protected]@@iDDD Š [email protected]@PDD, True, FalseD, 8i, 1, [email protected]<D;
K = [email protected] @[email protected]@PDDD, BD;
[email protected]@"Number of Solutions to Meet Problem = ", [email protected]@KDDDD; KD
é Example: an error message is thrown if the input to MeetSolve is not a set partition
In[71]:=
[email protected], 2, 3, 4<D
MeetSolve::badarg : Set partition expected. Invalid argument 81, 2, 3, 4<.
Out[71]=
[email protected], 2, 3, 4<D
`
é Example: find all set partitions Σ such that the meet of Σ and {{1,4,5},{2},{3}} is the singleton partition 0
In[72]:=
[email protected], 4, 5<, 82<, 83<<D
Number of Solutions to Meet Problem = 17
Out[72]=
In[73]:=
Out[73]=
8881<, 82, 3, 4<, 85<<, 881<, 82, 5<, 83, 4<<, 881<, 82, 3, 5<, 84<<, 881<, 82, 4<, 83, 5<<,
881, 2<, 83, 4<, 85<<, 881, 2<, 83, 5<, 84<<, 881, 2, 3<, 84<, 85<<, 881, 3<, 82, 4<, 85<<,
881, 3<, 82, 5<, 84<<, 881<, 82<, 83, 4<, 85<<, 881<, 82<, 83, 5<, 84<<,
881<, 82, 3<, 84<, 85<<, 881<, 82, 4<, 83<, 85<<, 881<, 82, 5<, 83<, 84<<,
881, 2<, 83<, 84<, 85<<, 881, 3<, 82<, 84<, 85<<, 881<, 82<, 83<, 84<, 85<<<
PartitionIntersection @881, 4, 5<, 82<, 83<<, 881<, 82, 5<, 83<, 84<<D
881<, 82<, 83<, 84<, 85<<
ì JoinSolve: for a fixed set partition Π, find all set partitions Σ
`
such that the join of Π and Σ is the maximal partition 1, that is,
`
ΣÞΠ = 1
In[74]:=
[email protected]_D ; [email protected] @PD, True, [email protected]::badarg, PD; FalseD :=
[email protected], B<, A = [email protected] @SetPartitions @[email protected]@[email protected]@iDD, PD,
8i, 1, [email protected] @[email protected]@PDDDD<D;
B = [email protected]@[email protected]@@iDDD Š 1, True, FalseD, 8i, 1, [email protected]<D;
K = [email protected] @[email protected]@PDDD, BD;
[email protected]@"Number of Solutions to Join Problem = ", [email protected]@KDDDD; KD
`
é Example: find all set partitions Σ such that the join of Σ and {{1,4,5},{2},{3}} is the maximal partition 1
In[75]:=
[email protected], 4, 5<, 82<, 83<<D
Number of Solutions to Join Problem = 22
Out[75]=
8881, 2, 3, 4, 5<<, 881<, 82, 3, 4, 5<<, 881, 2<, 83, 4, 5<<, 881, 2, 3<, 84, 5<<,
881, 3<, 82, 4, 5<<, 881, 2, 3, 4<, 85<<, 881, 5<, 82, 3, 4<<, 881, 2, 5<, 83, 4<<,
881, 3, 4<, 82, 5<<, 881, 2, 3, 5<, 84<<, 881, 4<, 82, 3, 5<<, 881, 2, 4<, 83, 5<<,
881, 3, 5<, 82, 4<<, 881<, 82, 3, 4<, 85<<, 881<, 82, 5<, 83, 4<<, 881<, 82, 3, 5<, 84<<,
881<, 82, 4<, 83, 5<<, 881, 2<, 83, 4<, 85<<, 881, 2<, 83, 5<, 84<<,
881, 2, 3<, 84<, 85<<, 881, 3<, 82, 4<, 85<<, 881, 3<, 82, 5<, 84<<<
ì JoinSolveGrid: display the output of JoinSolve in a grid
In[76]:=
JoinSolveGrid @P_D ; [email protected] @PD, True, [email protected] ::badarg, PD; FalseD :=
[email protected]ð, Frame ® AllD & ž [email protected]
`
é Example: find all set partitions Σ such that the join of Σ and {{1,2},{3,4}} is the maximal partition 1
In[77]:=
JoinSolveGrid @881, 2<, 83, 4<<D
Number of Solutions to Join Problem = 11
Out[77]=
81, 2, 3, 4<
81<
82, 3, 4<
81, 3, 4<
82<
81, 2, 3<
84<
81, 4<
82, 3<
81, 2, 4<
83<
81, 3<
82, 4<
81<
82, 3<
81<
82, 4<
81, 3<
82<
81, 4<
82<
84<
83<
84<
83<
ì MeetAndJoinSolve: for a fixed set partition Π, finds all set
partitions Σ such that the join of Π and Σ is the maximal
`
`
partition 1 AND the meet of Π and Σ is the singleton partition 0,
`
`
that is, Σ ß Π = 0 and Σ Þ Π = 1
In[78]:=
MeetAndJoinSolve @P_D ;
[email protected] @PD, True, [email protected] ::badarg, PD; FalseD :=
[email protected], A, B, K<, z = [email protected];
A = [email protected] @[email protected]@iDD, PD, 8i, 1, [email protected]<D;
B = [email protected]@[email protected]@@iDDD Š 1, True, FalseD, 8i, 1, [email protected]<D; K = [email protected], BD;
[email protected]@"Number of Solutions to Meet and Join Problem = ",
[email protected]@KDDDD; KD
`
é Example: find all set partitions Σ such that the join of Σ and {{1,4,5},{2},{3}} is the maximal partition 1 and such that the meet of Σ
`
and {{1,4,5},{2},{3}} is the singleton partition 0, with timing
`
Example: find all set partitions Σ such that the join of Σ and {{1,4,5},{2},{3}} is the maximal partition 1 and such that the meet of Σ
`
and {{1,4,5},{2},{3}} is the singleton partition 0, with timing
In[79]:=
MeetAndJoinSolve @881, 4, 5<, 82<, 83<<D  AbsoluteTiming
Number of Solutions to Meet Problem = 17
Number of Solutions to Meet and Join Problem = 9
Out[79]=
80.0937500, 8881<, 82, 3, 4<, 85<<, 881<, 82, 5<, 83, 4<<, 881<, 82, 3, 5<, 84<<,
881<, 82, 4<, 83, 5<<, 881, 2<, 83, 4<, 85<<, 881, 2<, 83, 5<, 84<<,
881, 2, 3<, 84<, 85<<, 881, 3<, 82, 4<, 85<<, 881, 3<, 82, 5<, 84<<<<
The output in the first position is the number of seconds it took to generate the rest of the output.
ì CoarserSetPartitionQ: this is a built-in Mathematica function;
CoarserSetPartitionQ[Σ,Π] yields "True" if the set partition Π is
coarser than the set partition Σ; that is, if Σ £ Π, i.e., if every
block in Σ is contained in a block of Π
é Example: is the set partition Π = 881, 2<, 83, 4<, 85<< coarser than the set partition Σ = 881, 2, 3, 4<, 85<<?
In[80]:=
Out[80]=
CoarserSetPartitionQ @881, 2, 3, 4<, 85<<, 881, 2<, 83, 4<, 85<<D
False
é Example: is the set partition Π = 881, 2, 3, 4<, 85<< coarser than the set partition Σ = 881, 2<, 83, 4<, 85<<?
In[81]:=
Out[81]=
CoarserSetPartitionQ @881, 2<, 83, 4<, 85<<, 881, 2, 3, 4<, 85<<D
True
ì CoarserThan: for a fixed set partition Π, find all set partitions Σ
such that Σ ³ Π, i.e., all set partitions such that every block of Π
is fully contained in some block of Σ
In[82]:=
[email protected]_D ;
[email protected] @PD, True, [email protected] ::badarg, PD; FalseD :=
[email protected] = [email protected]@PDD, scan, group<, group = SetPartitions @sizeD;
scan = CoarserSetPartitionQ @P, ðD & ž group; [email protected], scanDD
é Example: find all of the set partitions Σ such that Σ ³ 881, 2<, 83, 4<, 85<<
In[83]:=
Out[83]=
é
[email protected], 2<, 83, 4<, 85<<D
8881, 2, 3, 4, 5<<, 881, 2<, 83, 4, 5<<,
881, 2, 3, 4<, 85<<, 881, 2, 5<, 83, 4<<, 881, 2<, 83, 4<, 85<<<
Partition Segments
Partition Segments
ì PartitionSegment: for set partitions Σ and Π, find all set
partitions Ρ such that Σ £ Ρ £ Π
In[84]:=
PartitionSegment @P_, Q_D ;
[email protected] @PD, True, [email protected] ::badarg, PD; FalseD :=
[email protected] = [email protected]@PDD, scan, group, output<, group = SetPartitions @sizeD;
scan = HCoarserSetPartitionQ @P, ðD && CoarserSetPartitionQ @ð, QDL & ž group;
output = [email protected], scanD;
[email protected]"Number of partitions in the segment = " <> [email protected]@outputDDD; outputD
é Example: find all of the set partitions Ρ such that 881<, 82<, 83<, 84, 5<< = Σ £ Ρ £ Π = 881, 2, 3<, 84, 5<<
In[85]:=
PartitionSegment @881<, 82<, 83<, 84, 5<<, 881, 2, 3<, 84, 5<<D
Number of partitions in the segment = 5
Out[85]=
8881, 2, 3<, 84, 5<<, 881<, 82, 3<, 84, 5<<,
881, 2<, 83<, 84, 5<<, 881, 3<, 82<, 84, 5<<, 881<, 82<, 83<, 84, 5<<<
é Example: find all of the set partitions Ρ such that 881, 2, 3<, 84, 5<< = Σ £ Ρ £ Π = 881<, 82<, 83<, 84, 5<<
In[86]:=
PartitionSegment @881, 2, 3<, 84, 5<<, 881<, 82<, 83<, 84, 5<<D
Number of partitions in the segment = 0
Out[86]=
8<
The output is null because, in this example, we do not have Σ £ Π.
ì ClassSegment: for set partitions Σ and Π, with Σ £ Π, obtain the
"class segment," ΛHΣ, ΠL = I1r1 2r2 ... Σ r Σ M, where ri is the
number of blocks of Π that contain exactly i blocks of Σ (terms
with exponent zero are ignored in the output)
In[87]:=
ClassSegment @S_, P_D := [email protected] @S, PD,
[email protected]@8"H"<, [email protected]ð@@1DD, [email protected]ð@@2DDDD & ž [email protected]@
[email protected]ðD & ž [email protected]ð, [email protected]ððD > 0 &D & ž [email protected] @[email protected]@iDD, [email protected]@jDDD,
8i, 1, Length ž P<, 8j, 1, Length ž S<DLDD, 8"L"<DD, "Π is not coarser than Σ."D
é Example: compute the class segment when Σ = 881, 2<, 83<, 84, 5<< and Π = 881, 2, 3<, 84, 5<<
In[88]:=
Out[88]=
ClassSegment @881, 2<, 83<, 84, 5<<, 881, 2, 3<, 84, 5<<D
H11 21 L
This is because only one block of Π (namely, 84, 5<) contains one block of Σ and one block of Π (namely, 81, 2, 3<) contains two
blocks of Σ. The answer could be more fully written as I11 21 30 M.
This is because only one block of Π (namely, 84, 5<) contains one block of Σ and one block of Π (namely, 81, 2, 3<) contains two
blocks of Σ. The answer could be more fully written as I11 21 30 M.
é Example: if Π is not coarser than Σ, a message is returned
In[89]:=
Out[89]=
ClassSegment @881, 2, 3<, 84, 5<<, 881, 2<, 83<, 84, 5<<D
Π is not coarser than Σ.
é Example: compute the class segment when Σ = 881, 2<, 83<, 84, 5<, 86<, 87<, 88<, 89<, 810<, 811<< and
Π = 881, 2, 3<, 84, 5<, 86, 7, 8<, 89, 10, 11<<
In[90]:=
Out[90]=
ClassSegment @881, 2<, 83<, 84, 5<, 86<, 87<, 88<, 89<, 810<, 811<<,
881, 2, 3<, 84, 5<, 86, 7, 8<, 89, 10, 11<<D
H11 21 32 L
Note that the exponent of 3 is 2 because there are three blocks of Σ are contained in two blocks of Π.
ì ClassSegmentSolve: given a partition Σ, find all coarser
partitions Π with a specific class segment
ΛHΣ, ΠL = I1r1 2r2 ... Σ r Σ M written as 981, r1<, 82, r2<, ..., 9 Σ , r Σ ==
with ri ³ 0 or merely ri > 0. We want ri blocks of Π to contain
exactly i blocks of Σ, for i = 1, ..., n
In[91]:=
ClassSegmentSolve @S_, list_D :=
[email protected] = [email protected], outputs, reducedlist, final<,
outputs = 8ð, [email protected]@[email protected]ðD & ž [email protected]ð, [email protected]ððD > 0 &D & ž
[email protected] @ð@@iDD, [email protected]@jDDD, 8i, 1, Length ž ð<, 8j, 1, Length ž S<DLDD< & ž
totalspace; reducedlist = [email protected], ð@@2DD > 0 &D; final =
First ž [email protected], ð@@2DD === reducedlist &DL;
[email protected]"Number of solutions = " <> [email protected]@finalDDD; finalD
é Input format: ClassSegmentSolve[Σ, Λ(Σ,Π)]
é Example: find the set of all partitions Π such that the class segment of Σ = 881, 2<, 83<, 84, 5<< and Π is equal to ΛHΣ, ΠL = I11 21 M. We
want r1 = 1 block of Π to contain one block of Σ and r2 = 1 block of Π to contain two blocks of Σ.
In[92]:=
ClassSegmentSolve @881, 2<, 83<, 84, 5<<, 881, 1<, 82, 1<<D
Number of solutions = 3
Out[92]=
8881, 2<, 83, 4, 5<<, 881, 2, 3<, 84, 5<<, 881, 2, 4, 5<, 83<<<
If Π = 881, 2<, 83, 4, 5<<, then 81, 2< contains the block 81, 2< in Σ = 881, 2<, 83<, 84, 5<< and 83, 4, 5< contains the blocks 83< and
84, 5< of Σ.
To use ClassSegmentSolve, we could also have added the zero exponent, since I11 21 M = I11 21 30 M, as follows:
In[93]:=
ClassSegmentSolve @881, 2<, 83<, 84, 5<<, 881, 1<, 82, 1<, 83, 0<<D
Number of solutions = 3
Out[93]=
8881, 2<, 83, 4, 5<<, 881, 2, 3<, 84, 5<<, 881, 2, 4, 5<, 83<<<
Let us check that 881, 2<, 83, 4, 5<< gives the specific class segment, namely, I11 21 M:
In[94]:=
Out[94]=
ClassSegment @881, 2<, 83<, 84, 5<<, 881, 2<, 83, 4, 5<<D
H11 21 L
Check that, in fact, all of the solutions to ClassSegmentSolve give the specific class segment I11 21 M:
In[95]:=
ClassSegment @881, 2<, 83<, 84, 5<<, ðD & ž
ClassSegmentSolve @881, 2<, 83<, 84, 5<<, 881, 1<, 82, 1<<D
Number of solutions = 3
Out[95]=
9H11 21 L, H11 21 L, H11 21 L=
é Example: when ri is too large, there is no solution
In[96]:=
ClassSegmentSolve @881, 2<, 83<, 84, 5<<, 881, 1<, 82, 6<, 83, 0<<D
Number of solutions = 0
Out[96]=
8<
Example: This next example involves a singleton partition Σ with Σ = 7. The goal is to find all coarser partitions Π such that
ΛHΣ, ΠL = I11 23 M; that is, such that r1 = 1 block of Π contains one block of Σ and r2 = 3 blocks of Π contain two blocks of Σ.
In[97]:=
ClassSegmentSolve @881<, 82<, 83<, 84<, 85<, 86<, 87<<, 881, 1<, 82, 3<<D
Number of solutions = 105
Out[97]=
8881<, 82, 3<, 84, 5<, 86, 7<<,
881<, 82, 5<, 83, 4<, 86, 7<<,
881<, 82, 4<, 83, 7<, 85, 6<<,
881<, 82, 7<, 83, 6<, 84, 5<<,
881<, 82, 5<, 83, 7<, 84, 6<<,
881, 2<, 83<, 84, 5<, 86, 7<<,
881, 3<, 82<, 84, 7<, 85, 6<<,
881, 2<, 83, 4<, 85<, 86, 7<<,
881, 4<, 82<, 83, 5<, 86, 7<<,
881, 2<, 83, 7<, 84<, 85, 6<<,
881, 6<, 82<, 83, 4<, 85, 7<<,
881, 2<, 83, 6<, 84, 5<, 87<<,
881, 6<, 82<, 83, 7<, 84, 5<<,
881, 2<, 83, 7<, 84, 6<, 85<<,
881, 6<, 82<, 83, 5<, 84, 7<<,
881, 4<, 82, 3<, 85<, 86, 7<<,
881, 5<, 82, 4<, 83<, 86, 7<<,
881, 4<, 82, 3<, 85, 6<, 87<<,
881, 7<, 82, 4<, 83<, 85, 6<<,
881, 4<, 82, 3<, 85, 7<, 86<<,
881, 6<, 82, 4<, 83<, 85, 7<<,
881, 6<, 82, 3<, 84, 5<, 87<<,
881, 7<, 82, 6<, 83<, 84, 5<<,
881, 5<, 82, 3<, 84, 6<, 87<<,
881, 7<, 82, 5<, 83<, 84, 6<<,
881, 5<, 82, 3<, 84, 7<, 86<<,
881, 6<, 82, 5<, 83<, 84, 7<<,
881, 6<, 82, 5<, 83, 4<, 87<<,
881, 7<, 82, 6<, 83, 4<, 85<<,
881, 6<, 82, 4<, 83, 5<, 87<<,
881, 7<, 82, 6<, 83, 5<, 84<<,
881, 5<, 82, 4<, 83, 6<, 87<<,
881, 7<, 82, 5<, 83, 6<, 84<<,
881, 5<, 82, 4<, 83, 7<, 86<<,
881, 6<, 82, 5<, 83, 7<, 84<<,
881<, 82, 3<, 84, 7<, 85, 6<<,
881<, 82, 4<, 83, 5<, 86, 7<<,
881<, 82, 6<, 83, 4<, 85, 7<<,
881<, 82, 6<, 83, 7<, 84, 5<<,
881<, 82, 6<, 83, 5<, 84, 7<<,
881, 3<, 82<, 84, 5<, 86, 7<<,
881, 2<, 83<, 84, 6<, 85, 7<<,
881, 5<, 82<, 83, 4<, 86, 7<<,
881, 2<, 83, 4<, 85, 6<, 87<<,
881, 4<, 82<, 83, 7<, 85, 6<<,
881, 2<, 83, 6<, 84<, 85, 7<<,
881, 7<, 82<, 83, 6<, 84, 5<<,
881, 2<, 83, 5<, 84, 6<, 87<<,
881, 5<, 82<, 83, 7<, 84, 6<<,
881, 2<, 83, 6<, 84, 7<, 85<<,
881, 5<, 82, 3<, 84<, 86, 7<<,
881, 3<, 82, 5<, 84<, 86, 7<<,
881, 7<, 82, 3<, 84<, 85, 6<<,
881, 3<, 82, 7<, 84<, 85, 6<<,
881, 6<, 82, 3<, 84<, 85, 7<<,
881, 3<, 82, 6<, 84<, 85, 7<<,
881, 7<, 82, 3<, 84, 5<, 86<<,
881, 3<, 82, 7<, 84, 5<, 86<<,
881, 7<, 82, 3<, 84, 6<, 85<<,
881, 3<, 82, 7<, 84, 6<, 85<<,
881, 6<, 82, 3<, 84, 7<, 85<<,
881, 3<, 82, 6<, 84, 7<, 85<<,
881, 7<, 82, 5<, 83, 4<, 86<<,
881, 5<, 82, 7<, 83, 4<, 86<<,
881, 7<, 82, 4<, 83, 5<, 86<<,
881, 4<, 82, 7<, 83, 5<, 86<<,
881, 7<, 82, 4<, 83, 6<, 85<<,
881, 4<, 82, 7<, 83, 6<, 85<<,
881, 6<, 82, 4<, 83, 7<, 85<<,
881, 4<, 82, 6<, 83, 7<, 85<<,
881<, 82, 3<, 84, 6<, 85, 7<<,
881<, 82, 7<, 83, 4<, 85, 6<<,
881<, 82, 4<, 83, 6<, 85, 7<<,
881<, 82, 7<, 83, 5<, 84, 6<<,
881<, 82, 5<, 83, 6<, 84, 7<<,
881, 2<, 83<, 84, 7<, 85, 6<<,
881, 3<, 82<, 84, 6<, 85, 7<<,
881, 2<, 83, 5<, 84<, 86, 7<<,
881, 7<, 82<, 83, 4<, 85, 6<<,
881, 2<, 83, 4<, 85, 7<, 86<<,
881, 4<, 82<, 83, 6<, 85, 7<<,
881, 2<, 83, 7<, 84, 5<, 86<<,
881, 7<, 82<, 83, 5<, 84, 6<<,
881, 2<, 83, 5<, 84, 7<, 86<<,
881, 5<, 82<, 83, 6<, 84, 7<<,
881, 3<, 82, 4<, 85<, 86, 7<<,
881, 4<, 82, 5<, 83<, 86, 7<<,
881, 3<, 82, 4<, 85, 6<, 87<<,
881, 4<, 82, 7<, 83<, 85, 6<<,
881, 3<, 82, 4<, 85, 7<, 86<<,
881, 4<, 82, 6<, 83<, 85, 7<<,
881, 3<, 82, 6<, 84, 5<, 87<<,
881, 6<, 82, 7<, 83<, 84, 5<<,
881, 3<, 82, 5<, 84, 6<, 87<<,
881, 5<, 82, 7<, 83<, 84, 6<<,
881, 3<, 82, 5<, 84, 7<, 86<<,
881, 5<, 82, 6<, 83<, 84, 7<<,
881, 5<, 82, 6<, 83, 4<, 87<<,
881, 6<, 82, 7<, 83, 4<, 85<<,
881, 4<, 82, 6<, 83, 5<, 87<<,
881, 6<, 82, 7<, 83, 5<, 84<<,
881, 4<, 82, 5<, 83, 6<, 87<<,
881, 5<, 82, 7<, 83, 6<, 84<<,
881, 4<, 82, 5<, 83, 7<, 86<<,
881, 5<, 82, 6<, 83, 7<, 84<<<
ì SquareChoose: for a list of integers 8r1, ..., rk < with
1 r1 + 2 r2 + ... + k rk = n, compute
n!
In[98]:=
SquareChoose @list_D :=
H1!Lr1 Hr1 L! H2!Lr2 Hr2 L!... Hk!Lrk Hrk L!
BlockA9numerator = [email protected] [email protected]@iDD, 8i, 1, Length ž list<DL !, denominator =
ProductAHi [email protected]@iDD [email protected]@iDDL !, 8i, 1, Length ž list<E=, numerator  denominatorE
é Example: compute
In[99]:=
Out[99]=
7!
H1!L1 H1!L H2!L3 H3!L
SquareChoose @81, 3, 0, 0, 0, 0, 0, 0<D
105
This number is equal to the number of solutions to the function ClassSegmentSolve with Σ = 881<, 82<, 83<, 84<< and
ΛHΣ, ΠL = Λ = I11 23 M. The answer to SquareChoose is denoted
n
B F.
Λ
Mobius Formula
ì MobiusFunction: for a set partition Σ £ Π, compute the Mobius
function
ΜHΣ, ΠL = H-1Ln-r H2!Lr3 H3!Lr4 ... HHn - 1L!Lrn
where n = Σ , r = Π , and ΛHΣ, ΠL = I1r1 2r2 ... Σ
rΣ
M is there corresponding class segment;
that is, there are exactly ri blocks of Π containing exactly i blocks of Σ, i = 1, ..., n.
In[100]:=
MobiusFunction @S_, P_D :=
IfACoarserSetPartitionQ @S, PD, BlockA8classsegmentraw , r = [email protected], n = [email protected]<,
classsegment = [email protected]@[email protected]ðD & ž [email protected]ð, [email protected]ððD > 0 &D & ž
[email protected] @[email protected]@iDD, [email protected]@jDDD, 8i, 1, Length ž P<, 8j, 1, Length ž S<DLDD;
classsegmentone = First ž classsegment ; classsegmenttwo = Last ž classsegment ;
missing = [email protected]@[email protected], classsegmentone D,
[email protected], 8Length ž [email protected]@nD, classsegmentone D<D<D;
complete = [email protected]@classsegment , missingDD;
H- 1Ln-r ProductAHj !LHLastž[email protected]@j+1DD , 8j, 0, n - 1<EE, "Π is not coarser than Σ."E
ì
Input format: MobiusFunction[Σ,Π]
é Example: evaluation of the Mobius function
In[101]:=
Out[101]=
MobiusFunction @881<, 82<, 83, 4<, 85, 6<, 87<, 88, 9<<, 881, 2<, 83, 4, 5, 6, 7, 8, 9<<D
6
Let's check this result with ClassSegment.
In[102]:=
Out[102]=
ClassSegment @881<, 82<, 83, 4<, 85, 6<, 87<, 88, 9<<, 881, 2<, 83, 4, 5, 6, 7, 8, 9<<D
H21 41 L
Thus, r2 = 1, r4 = 1, n = 6, r = 2 which explains why ΜHΣ, ΠL = H-1L6-2 H3 !L1 = 6.
é Example: the Mobius function of any set partition with itself is always equal to 1
Example: the Mobius function of any set partition with itself is always equal to 1
In[103]:=
Out[103]=
MobiusFunction @881, 2<, 83<, 84, 5<<, 881, 2<, 83<, 84, 5<<D
1
`
`
é Example: the Mobius function of the singleton partition 0 = 881<, ..., 8n<< with the maximal partition 1 = 881, 2, ..., n<< is equal to
H-1Ln-1 Hn - 1L !, where n is the order of the set partition
In[104]:=
Out[104]=
MobiusFunction @881<, 82<, 83<, 84<, 85<<, 881, 2, 3, 4, 5<<D
24
é Example: the output can be negative
In[105]:=
Out[105]=
MobiusFunction @881<, 82<, 83<, 84<<, 881, 2, 3, 4<<D
-6
é Example: with Σ > Π
In[106]:=
Out[106]=
MobiusFunction @881, 2, 3, 4<<, 881<, 82<, 83<, 84<<D
Π is not coarser than Σ.
ì MobiusRecursionCheck: verify that the Mobius function
recursion ΜHΣ, ΠL = - ÚΣ£Ρ<Π ΜHΣ, ΡL holds; in the output, the
number in the first coordinate is ΜHΣ, ΠL and the number in the
second coordinate is - ÚΣ£Ρ<Π ΜHΣ, ΡL; they should be equal
In[107]:=
MobiusRecursionCheck @S_, P_D := 8MobiusFunction @S, PD, [email protected]
8initial = [email protected] @S, PD, 1D<, - Total ž HMobiusFunction @S, ðD & ž initialLD<
é Example: check the Mobius function recursion when Σ = 881<, 82<, 83<, 84<< and Π = 881, 2, 3, 4<<
In[108]:=
MobiusRecursionCheck @881<, 82<, 83<, 84<<, 881, 2, 3, 4<<D
Number of partitions in the segment = 15
Out[108]=
8- 6, - 6<
é Example: check the Mobius function recursion when Σ = 881<, 82<, 83<, 84, 5<< and Π = 881, 2, 3<, 84, 5<<
In[109]:=
MobiusRecursionCheck @881<, 82<, 83<, 84, 5<<, 881, 2, 3<, 84, 5<<D
Number of partitions in the segment = 5
Out[109]=
82, 2<
ì
MobiusInversionFormulaZero: compute the Mobius inversion
é
formula, which is given by FHΠL = Ú0` £Σ£Π ΜHΣ, ΠL GHΣL, where F
and G are functions taking set partitions as their arguments
MobiusInversionFormulaZero: compute the Mobius inversion
formula, which is given by FHΠL = Ú0` £Σ£Π ΜHΣ, ΠL GHΣL, where F
and G are functions taking set partitions as their arguments
In[110]:=
MobiusInversionFormulaZero @P_D :=
[email protected] = PartitionSegment @SingletonPartition @[email protected]@PDDD, PD, G<, [email protected]
[email protected]"Σ", "ΜHΣ,ΠL", "GHΣL"<<, 8ð, MobiusFunction @ð, PD, [email protected]ðD< & ž segmentD, Frame ® AllDD
é Input format: MobiusInversionFormulaZero[Π]
`
é Example: for all 0 £ Σ £ Π, obtain the Mobius function coefficient ΜHΣ, ΠL and print GHΣL
In[111]:=
MobiusInversionFormulaZero @881, 2, 3<, 84, 5<<D
Number of partitions in the segment = 10
Out[111]=
Σ
ΜHΣ,ΠL
GHΣL
881, 2, 3<, 84, 5<<
1
[email protected], 2, 3<, 84, 5<<D
881<, 82, 3<, 84, 5<<
-1
[email protected]<, 82, 3<, 84, 5<<D
881, 2<, 83<, 84, 5<<
-1
[email protected], 2<, 83<, 84, 5<<D
881, 3<, 82<, 84, 5<<
-1
[email protected], 3<, 82<, 84, 5<<D
881, 2, 3<, 84<, 85<<
-1
[email protected], 2, 3<, 84<, 85<<D
881<, 82<, 83<, 84, 5<<
2
[email protected]<, 82<, 83<, 84, 5<<D
881<, 82, 3<, 84<, 85<<
1
[email protected]<, 82, 3<, 84<, 85<<D
881, 2<, 83<, 84<, 85<<
1
[email protected], 2<, 83<, 84<, 85<<D
881, 3<, 82<, 84<, 85<<
1
[email protected], 3<, 82<, 84<, 85<<D
881<, 82<, 83<, 84<, 85<<
-2
[email protected]<, 82<, 83<, 84<, 85<<D
For example, if G º 1, then FHΠL = Ú0` £Σ£Π ΜHΣ, ΠL = 0.
The function MobiusInversionFormulaZero is also useful for computing
GHΠL = Ú0` £Σ£Π FHΣL.
`
Merely ignore ΜHΣ, ΠL and replace GHΣL by FHΣL. Observe that the list of partitions Σ satisfying 0 £ Σ < Π can also be obtained
by using the function PartitionSegment[{{1},{2},{3},{4},{5},{{1,2,3},{4,5}}]. For the preceding example,
In[112]:=
PartitionSegment @SingletonPartition @5D, 881, 2, 3<, 84, 5<<D
Number of partitions in the segment = 10
Out[112]=
8881, 2, 3<, 84, 5<<, 881<, 82, 3<, 84, 5<<, 881, 2<, 83<, 84, 5<<, 881, 3<, 82<, 84, 5<<,
881, 2, 3<, 84<, 85<<, 881<, 82<, 83<, 84, 5<<, 881<, 82, 3<, 84<, 85<<,
881, 2<, 83<, 84<, 85<<, 881, 3<, 82<, 84<, 85<<, 881<, 82<, 83<, 84<, 85<<<
ì MobiusInversionFormulaOne: compute the Mobius inversion
formula, which is given by FHΠL = ÚΠ£Σ£1` ΜHΠ, ΣL GHΣL, where F
ì and G are functions taking set partitions as their arguments
MobiusInversionFormulaOne: compute the Mobius inversion
formula, which is given by FHΠL = ÚΠ£Σ£1` ΜHΠ, ΣL GHΣL, where F
and G are functions taking set partitions as their arguments
In[113]:=
MobiusInversionFormulaOne @P_D :=
[email protected] = PartitionSegment @P, MaximalPartition @[email protected]@PDDDD, G<,
Print ž segment; [email protected]
[email protected]"Σ", "ΜHΣ,ΠL", "GHΣL"<<, 8ð, MobiusFunction @P, ðD, [email protected]ðD< & ž segmentD, Frame ® AllDD
é Input format: MobiusInversionFormulaOne[Π]
`
é Example: for all Π £ Σ £ 1, obtain the Mobius function coefficient ΜHΠ, ΣL and print GHΣL
In[114]:=
MobiusInversionFormulaOne @881, 2, 3<, 84, 5<<D
Number of partitions in the segment = 2
8881, 2, 3, 4, 5<<, 881, 2, 3<, 84, 5<<<
Out[114]=
Σ
ΜHΣ,ΠL
GHΣL
881, 2, 3, 4, 5<<
-1
[email protected], 2, 3, 4, 5<<D
881, 2, 3<, 84, 5<<
1
[email protected], 2, 3<, 84, 5<<D
For example, if G º 1, then FHΠL = ÚΠ£Σ£1` ΜHΠ, ΣL = 0.
The function MobiusInversionFormulaZero is also useful for computing
GHΠL = ÚΠ£Σ£1` GHΣL.
`
Merely ignore ΜHΠ, ΣL and replace GHΣL by FHΣL. Observe that the list of partitions Σ satisfying Π £ Σ £ 1 can also be obtained
by using the function PartitionSegment[{{1,2,3},{4,5}},{{1,2,3,4,5}}]. For the preceding example,
In[115]:=
PartitionSegment @881, 2, 3<, 84, 5<<, MaximalPartition @5DD
Number of partitions in the segment = 2
Out[115]=
ì
8881, 2, 3, 4, 5<<, 881, 2, 3<, 84, 5<<<
Moments and Cumulants
ì MomentToCumulants: express the moment of a random
variable in terms of the cumulants
In[116]:=
MomentToCumulants @m_D ;
[email protected]@m ³ 0D && [email protected], True, [email protected] ::badarg, mD; FalseD :=
[email protected] = [email protected], 8m<D<, X, myRules<,
myRules = [email protected]@Χ@X, [email protected], 8i<D<D, Χi @XDD, 8i, 1, m<D;
[email protected] ž A Š 1, [email protected] = [email protected]@ADD, rules, setpartitions , Χ<,
rules = [email protected] ® [email protected]@@iDD, 8i, 1, int<D; setpartitions =
SetPartitions @intD . rules; Total ž [email protected]@Χ@X, 8setpartitions @@i, jDD<D, 8j, 1,
[email protected] @@iDDD<D, 8i, 1, Length ž setpartitions <DD, "Error"D . myRulesD
é Input format: to express [email protected] m D in terms of cumulants, use MomentToCumulants[m]
é Example: express the sixth moment of a random variable X in terms of cumulants
In[117]:=
Out[117]=
MomentToCumulants @6D
Χ1 @XD6 + 15 Χ1 @XD4 Χ2 @XD + 45 Χ1 @XD2 Χ2 @XD2 + 15 Χ2 @XD3 + 20 Χ1 @XD3 Χ3 @XD +
60 Χ1 @XD Χ2 @XD Χ3 @XD + 10 Χ3 @XD2 + 15 Χ1 @XD2 Χ4 @XD + 15 Χ2 @XD Χ4 @XD + 6 Χ1 @XD Χ5 @XD + Χ6 @XD
The input is EAX 6 E. In the output, Χ2 @X D is the second cumulant of X and Χ3 @X D2 is the second power of the third cumulant of X .
ì CumulantToMoments: express the cumulant of a random
variable in terms of moments
In[118]:=
CumulantToMoments @m_D ;
[email protected]@m ³ 0D && [email protected], True, [email protected] ::badarg, mD; FalseD :=
BlockA8A = [email protected], 8m<D<, X, myRules<,
myRules = [email protected], [email protected], 8i<D<D, EAXi EE, 8i, 1, m<E;
IfALength ž A Š 1, BlockA8int = [email protected]@ADD, rules, setpartitions , Χ, E<, rules =
[email protected] ® [email protected]@@iDD, 8i, 1, int<D; setpartitions = SetPartitions @intD . rules;
Total ž TableAH- 1LLengthž[email protected]@iDD-1 HLength ž setpartitions @@iDD - 1L !
[email protected]@X, 8setpartitions @@i, jDD<D, 8j, 1, [email protected] @@iDDD<D,
8i, 1, Length ž setpartitions <EE, "Error"E . myRulesE ; [email protected] ³ 0D && [email protected]
é Input format: to express Χm @XD in terms of moments, use CumulantToMoments[m]
é Example: express the sixth cumulant of a random variable X in terms of moments
In[119]:=
CumulantToMoments @6D
- 120 [email protected] + 360 [email protected] EAX2 E - 270 [email protected] EAX2 E + 30 EAX2 E - 120 [email protected] EAX3 E +
2
Out[119]=
3
120 [email protected] EAX2 E EAX3 E - 10 EAX3 E + 30 [email protected] EAX4 E - 15 EAX2 E EAX4 E - 6 [email protected] EAX5 E + EAX6 E
2
The input is Χ6 @X D. The output starts with -120 [email protected] DL6 and ends with EAX 6 E.
ì MomentProductToCumulants: express the expected value of
the product of random variables X b, where b Í @nD, in terms of
the cumulants
In[120]:=
MomentProductToCumulants @X_, A_D :=
[email protected] ž A Š 1, [email protected] = [email protected]@ADD, rules, setpartitions , Χ, myRules<,
rules = [email protected] ® [email protected]@@iDD, 8i, 1, int<D;
myRules = [email protected] = [email protected], [email protected]@[email protected], 1DD<,
[email protected]@Χ@X, [email protected]@iDDD, Χ@[email protected] žž [email protected], ðD & ž [email protected]@i, 1DDLDDD,
8i, 1, Length ž field<DD; setpartitions = SetPartitions @intD . rules;
Total ž [email protected]@Χ@X, 8setpartitions @@i, jDD<D, 8j, 1, [email protected] @@iDDD<D,
8i, 1, Length ž setpartitions <D . myRulesD, "Error"D
é Example: express the expected value of X 881,2<< = X1 X2 in terms of cumulants
In[121]:=
Out[121]=
MomentProductToCumulants @X, 881, 2<<D
Χ@X1 D Χ@X2 D + Χ@X1 X2 D
The input is [email protected] X2 D.
ì CumulantVectorToMoments: express the cumulant of a
random vector Xb, where b Í @nD, in terms of moments
In[122]:=
CumulantVectorToMoments @X_, A_D :=
IfALength ž A Š 1, BlockA8int = [email protected]@ADD, rules, setpartitions , Χ, E, myRules<,
rules = [email protected] ® [email protected]@@iDD, 8i, 1, int<D;
setpartitions = SetPartitions @intD . rules; myRules =
[email protected] = [email protected], [email protected]@[email protected], 1DD<, [email protected]@[email protected], [email protected]@iDDD,
[email protected]@Sequence žž [email protected], ðD & ž [email protected]@i, 1DDLDDD, 8i, 1, Length ž field<DD;
Total ž TableAH- 1LLengthž[email protected]@iDD-1 HLength ž setpartitions @@iDD - 1L !
[email protected]@X, 8setpartitions @@i, jDD<D, 8j, 1, [email protected] @@iDDD<D,
8i, 1, Length ž setpartitions <E . myRulesE, "Error"E  FullSimplify
é Example: express the cumulant of X881,2<< = HX1 , X2 L, which is the covariance of X1 and X2 , in terms of moments
In[123]:=
Out[123]=
CumulantVectorToMoments @X, 881, 2<<D
- [email protected] D [email protected] D + [email protected] X2 D
The input is ΧHX1 X2 L.
é Example: express the cumulant of X881<,82<,83<< = HX1 , X2 , X3 L in terms of moments
In[124]:=
Out[124]=
CumulantVectorToMoments @X, 881, 2, 3<<D  Expand
2 [email protected] D [email protected] D [email protected] D - [email protected] X2 D [email protected] D - [email protected] D [email protected] X3 D - [email protected] D [email protected] X3 D + [email protected] X2 X3 D
é Example: express the cumulant of X881<,81<,81<< , which is the third cumulant of X1 , in terms of moments
In[125]:=
Out[125]=
CumulantVectorToMoments @X, 881, 1, 1<<D
2 [email protected] D3 - 3 [email protected] D EAX21 E + EAX31 E
The input is Χ@X1 , X1 , X1 D, which is equal to Χ3 @X1 D. The output reads 2 [email protected] DL3 - 3 [email protected] D [email protected] D2 M + EAX13 E. Same result as in
the example above, with X1 = X2 = X3 . This result can also be obtained by:
In[126]:=
Out[126]=
CumulantToMoments @3D
2 [email protected] - 3 [email protected] EAX2 E + EAX3 E
ì CumulantProductVectorToCumulantVectors: express the joint
cumulant of a random vector IX b1 , X b2 , ..., X bk M, where
8b1, b2, ..., bk < Í @nD, in terms of cumulants of random vectors
whose components are not products (Malyshev's formula)
In[127]:=
In[128]:=
NewJoinSolve @P_D ; [email protected] @PD, True, [email protected] ::badarg, PD; FalseD :=
[email protected], B, K<, A = [email protected] @SetPartitions @[email protected]@[email protected]@iDD, PD,
8i, 1, [email protected] @[email protected]@PDDDD<D;
B = [email protected]@[email protected]@@iDDD Š 1, True, FalseD, 8i, 1, [email protected]<D;
K = [email protected] @[email protected]@PDDD, BDD
CumulantProductVectorToCumulantVectors @X_, A_D ; [email protected] @AD,
True, [email protected] ::badarg, AD; FalseD :=
[email protected] = [email protected]@ADD, rules, setpartitions , Χ, myRules<,
rules = [email protected] ® [email protected]@@iDD, 8i, 1, int<D;
myRules = [email protected] = [email protected], [email protected]@[email protected], 1DD<,
[email protected]@Χ@X, [email protected]@iDDD, Χ@Sequence žž [email protected], ðD & ž [email protected]@i, 1DDLDD,
8i, 1, Length ž field<DD; setpartitions = NewJoinSolve @AD . rules;
Total ž [email protected]@Χ@X, 8setpartitions @@i, jDD<D, 8j, 1, [email protected] @@iDDD<D,
8i, 1, Length ž setpartitions <D . myRulesD  FullSimplify
é Example: express the cumulants Χ@X1 X2 , X3 D in terms of cumulants of random vectors whose components are not products
In[129]:=
Out[129]=
CumulantProductVectorToCumulantVectors @X, 881, 2<, 83<<D
Χ@X2 D Χ@X1 , X3 D + Χ@X1 D Χ@X2 , X3 D + Χ@X1 , X2 , X3 D
The input is Χ@X1 X2 , X3 D.
é Example: express the cumulants Χ@X1 , X2 , X3 D in terms of cumulants of random vectors whose components are not products
In[130]:=
Out[130]=
CumulantProductVectorToCumulantVectors @X, 881<, 82<, 83<<D
Χ@X1 , X2 , X3 D
The input is Χ@X1 , X2 , X3 D, and so is the output.
é Example: express the cumulants Χ@X1 X2 X3 D in terms of cumulants of random vectors whose components are not products
In[131]:=
Out[131]=
CumulantProductVectorToCumulantVectors @X, 881, 2, 3<<D  Expand
Χ@X1 D Χ@X2 D Χ@X3 D + Χ@X3 D Χ@X1 , X2 D + Χ@X2 D Χ@X1 , X3 D + Χ@X1 D Χ@X2 , X3 D + Χ@X1 , X2 , X3 D
The input is Χ@X1 X2 X3 D. The qualifier Expand is used to avoid factoring terms. Without it, one gets
In[132]:=
Out[132]=
CumulantProductVectorToCumulantVectors @X, 881, 2, 3<<D
Χ@X3 D Χ@X1 , X2 D + Χ@X2 D Χ@X1 , X3 D + Χ@X1 D HΧ@X2 D Χ@X3 D + Χ@X2 , X3 DL + Χ@X1 , X2 , X3 D
To count the number of terms in a summation in this notebook, code like the following will work:
In[133]:=
Out[133]=
[email protected]@
[email protected] @X, 881, 2, 3<<D  ExpandLD, "+"DD
5
ì GridCumulantProductVectorToCumulantVectors: display the
output of CumulantProductVectorToCumulantVectors in a grid
In[134]:=
In[135]:=
NewJoinSolve @P_D ; [email protected] @PD, True, [email protected] ::badarg, PD; FalseD :=
[email protected], B, K<, A = [email protected] @SetPartitions @[email protected]@[email protected]@iDD, PD,
8i, 1, [email protected] @[email protected]@PDDDD<D;
B = [email protected]@[email protected]@@iDDD Š 1, True, FalseD, 8i, 1, [email protected]<D;
K = [email protected] @[email protected]@PDDD, BDD
GridCumulantProductVectorToCumulantVectors @X_, P_D ; [email protected] @PD, True,
[email protected] ::badarg, PD; FalseD :=
[email protected] = List žž HCumulantProductVectorToCumulantVectors @X, PD  ExpandL<,
[email protected]"Number of terms in summation = " <> [email protected] ž inputDD;
[email protected]ð, Frame ® All, Alignment ® LeftD & ž [email protected], [email protected]" + ", [email protected]<D<DD
é Example: display in a grid CumulantProductVectorToCumulantVectors of 881, 2, 3<, 84<<
In[136]:=
GridCumulantProductVectorToCumulantVectors @X, 881, 2, 3<, 84<<D
Number of terms in summation = 10
Out[136]=
Χ@X2 D Χ@X3 D Χ@X1 , X4 D
Χ@X1 , X4 D Χ@X2 , X3 D
Χ@X1 D Χ@X3 D Χ@X2 , X4 D
Χ@X1 , X3 D Χ@X2 , X4 D
Χ@X1 D Χ@X2 D Χ@X3 , X4 D
Χ@X1 , X2 D Χ@X3 , X4 D
Χ@X3 D Χ@X1 , X2 , X4 D
Χ@X2 D Χ@X1 , X3 , X4 D
Χ@X1 D Χ@X2 , X3 , X4 D
Χ@X1 , X2 , X3 , X4 D
+
+
+
+
+
+
+
+
+
+
The input is Χ@X1 X2 X3 , X4 D.
é Example: compare these results with the JoinSolve of 881, 2, 3<, 84<<
In[137]:=
[email protected]ð, Frame ® 8None, All<D & ž HReverse ž [email protected], 2, 3<, 84<<DL
Number of Solutions to Join Problem = 10
Out[137]=
81, 4<
82<
83<
81<
82, 4<
83<
81<
82<
83, 4<
81, 3<
82, 4<
81, 2, 4<
83<
81, 4<
82, 3<
81, 3, 4<
82<
81, 2<
83, 4<
81<
82, 3, 4<
81, 2, 3, 4<
ì CumulantProductVectorToMoments: express the joint
cumulant of a random vector IX b1 , X b2 , ..., X bk M, where
8b1, b2, ..., bk < Í @nD, in terms of moments
In[138]:=
NewJoinSolve @P_D ; [email protected] @PD, True, [email protected] ::badarg, PD; FalseD :=
[email protected], B<, A = [email protected] @SetPartitions @[email protected]@[email protected]@iDD, PD,
8i, 1, [email protected] @[email protected]@PDDDD<D;
B = [email protected]@[email protected]@@iDDD Š 1, True, FalseD, 8i, 1, [email protected]<D;
K = [email protected] @[email protected]@PDDD, BDD
In[139]:=
CumulantProductVectorToMoments @X_, A_D ;
[email protected] @AD, True, [email protected] ::badarg, AD; FalseD :=
[email protected] = [email protected]@ADD, rules, setpartitions , E, myRules<,
rules = [email protected] ® [email protected]@@iDD, 8i, 1, int<D;
myRules = [email protected] = [email protected], [email protected]@[email protected], 1DD<,
[email protected]@[email protected], [email protected]@iDDD, [email protected]@Sequence žž [email protected], ðD & ž [email protected]@i, 1DDLDDD,
8i, 1, Length ž field<DD; setpartitions = NewJoinSolve @AD . rules;
Total ž [email protected]@CumulantVectorToMoments @X, 8setpartitions @@i, jDD<D, 8j, 1, [email protected]
setpartitions @@iDDD<D, 8i, 1, Length ž setpartitions <D . myRulesD  FullSimplify
é Example: express the cumulants Χ@X1 X2 , X3 D in terms of moments
In[140]:=
Out[140]=
CumulantProductVectorToMoments @X, 881, 2<, 83<<D
- [email protected] X2 D [email protected] D + [email protected] X2 X3 D
The input is Χ@X1 X2 , X3 D.
é Example: express the cumulants Χ@X1 , X2 , X3 D in terms of moments
In[141]:=
Out[141]=
CumulantProductVectorToMoments @X, 881<, 82<, 83<<D  Expand
2 [email protected] D [email protected] D [email protected] D - [email protected] X2 D [email protected] D - [email protected] D [email protected] X3 D - [email protected] D [email protected] X3 D + [email protected] X2 X3 D
The input is Χ@X1 , X2 , X3 D since here 881<, 82<, 83<< signifies the vector HX1 , X2 , X3 L.
é Example: express the cumulants Χ@X1 X2 X3 D in terms of moments
In[142]:=
Out[142]=
CumulantProductVectorToMoments @X, 881, 2, 3<<D
[email protected] X2 X3 D
Thus, Χ@X1 X2 X3 D = [email protected] X2 X3 D. In fact, for any random variable Y , one has Χ@Y D = [email protected] D.
As noted above, the result for CumulantProductVectorToMoments[X,{{1},{2},{3}}] can also be obtained by:
In[143]:=
Out[143]=
CumulantVectorToMoments @X, 881, 2, 3<<D  Expand
2 [email protected] D [email protected] D [email protected] D - [email protected] X2 D [email protected] D - [email protected] D [email protected] X3 D - [email protected] D [email protected] X3 D + [email protected] X2 X3 D
é Example: express the cumulant of ΧHX1 X2 X3 , X4 L in terms of moments
In[144]:=
Out[144]=
CumulantProductVectorToMoments @X, 881, 2, 3<, 84<<D
- [email protected] X2 X3 D [email protected] D + [email protected] X2 X3 X4 D
Gaussian Multiple Integrals
ì GaussianIntegral: This function can be used to compute
multiple Gaussian integrals
ÙΣ f Hx1 , ..., xn L GHâ x1 L ... GHâ xn L
over a set partition Σ and
Ù³Σ f Hx1 , ..., xn L GHâ x1 L ... GHâ xn L
over all partitions at least as coarse as Σ, where f Hx1 , ..., xn L is a symmetric function, for
example, gHx1 L ... gHxn L, and where G is a Gaussian measure with control measure Ν. This
function generates the set partition data necessary to compute multiple Gaussian integrals.
In[145]:=
GaussianIntegral @P_D ;
[email protected] @PD, True, [email protected] ::badarg, PD; FalseD :=
[email protected]@Length ž PD ³ 3, "The integral is zero.",
[email protected] = [email protected], [email protected]ðD Š 1 &D, sizetwo = [email protected], [email protected]ðD Š 2 &D<,
[email protected]@8"control measure Ν", Sequence žž sizetwo<, Frame ® AllD,
[email protected]"Gaussian measure G", Sequence žž sizeone<, Frame ® AllD<<, Alignment ® TopDDD
é Example: when computing the multiple Gaussian integral over a set partition with a block size greater than or equal to three, the
integral is zero
In[146]:=
Out[146]=
GaussianIntegral @881, 2, 3<, 84, 5<, 86, 7<, 88<<D
The integral is zero.
é Example: compute the block data necessary to compute the multiple Gaussian integral over a particular set partition
In[147]:=
Out[147]=
GaussianIntegral @881, 3<, 84, 5<, 86<, 87<, 82<<D
control measure Ν
81, 3<
84, 5<
Gaussian measure G
86<
87<
82<
Interpretation: Let Σ = 881, 3<, 84, 5<, 86<, 87<, 82<<. Integrating gHx1 L ... gHx7 L over Σ gives
IÙ g2 HxL ΝHâ xLM Ùx ¹x ¹x gHx2 L gHx6 L gHx7 L GHâ x2 L GHâ x6 L GHâ x7 L.
2
6
7
2
If one integrates it over "³Σ" instead, one obtains
IÙ g2 HxL ΝHâ xLM IÙ gHxL GHâ xLM .
2
3
Rule 1: To obtain a Gaussian multiple integral over Σ, equate the variables listed under "control measure Ν" and integrate them
with respect to Ν; the variables listed under "Gaussian measure G" are integrated with respect to G over the off-diagonals.
Rule 2: To obtain a Gaussian multiple integral over "³Σ", equate the variables listed under "control measure Ν" and integrate
them with respect to Ν; the variables listed under "Gaussian measure G" are integrated with respect to G.
Rule 2: To obtain a Gaussian multiple integral over "³Σ", equate the variables listed under "control measure Ν" and integrate
them with respect to Ν; the variables listed under "Gaussian measure G" are integrated with respect to G.
é Examples worked out in the text (assume f is a symmetric function):
In[148]:=
GaussianIntegral @881<, 82<, 83<<D
control measure Ν
Out[148]=
Gaussian measure G
81<
82<
83<
Integrating f over the singleton partition Σ = 881<, 82<, 83<< gives the identity. The input and output both correspond to
Ùx1 ¹x2 ¹x3 f Hx1 , x2 , x3 L GHâ x1 L GHâ x2 L GHâ x3 L.
Integrating f over "³Σ", in this case, over the whole space, gives
Ù f Hx1 , x2 , x3 L GHâ x1 L GHâ x2 L GHâ x3 L.
In[149]:=
Out[149]=
GaussianIntegral @881, 2, 3<, 84<<D
The integral is zero.
This integral is zero because Σ = 881, 2, 3<, 84<< has block of size greater than two.
In[150]:=
Out[150]=
GaussianIntegral @881, 2<<D
control measure Ν
81, 2<
Gaussian measure G
Integrating f over the maximal partition Σ = 881, 2<< gives
Ùx1 =x2 f Hx1 , x2 L GHâ x1 L GHâ x2 L = Ù f Hx, xL ΝHâ xL.
Integrating f over "³Σ" gives the same thing in this case, since Σ is the maximal partition.
Ù³Σ f Hx1 , x2 L GHâ x1 L GHâ x2 L º Ùx1 =x2 f Hx1 , x2 L GHâ x1 L GHâ x2 L = Ù f Hx, xL ΝHâ xL.
In[151]:=
GaussianIntegral @881<<D
control measure Ν
Out[151]=
In[152]:=
Out[152]=
Gaussian measure G
81<
GaussianIntegral @881<, 82, 3<<D
control measure Ν
82, 3<
Ù f Hx1 L GHâ x1 L = Ù f Hx1 L GHâ x1 L.
Gaussian measure G
81<
Integrating f over Σ = 881<, 82, 3<< gives
Ùx1 ¹x2 =x3 f Hx1 , x2 , x3 L GHâ x1 L GHâ x2 L GHâ x3 L = Ù f Hx, y, yL GHâ xL ΝHâ yL.
Integrating f over ³ Σ gives
Ù³Σ f Hx1 , x2 , x3 L GHâ x1 L GHâ x2 L GHâ x3 L = Ù f Hx, y, yL GHâ xL ΝHâ yL.
Ù³Σ f Hx1 , x2 , x3 L GHâ x1 L GHâ x2 L GHâ x3 L = Ù f Hx, y, yL GHâ xL ΝHâ yL.
To see that this makes sense, let's list all partitions of "³Σ":
In[153]:=
Out[153]=
[email protected]<, 82, 3<<D
8881, 2, 3<<, 881<, 82, 3<<<
The integral associated with 881, 2, 3<< is equal to zero, and the integral associated with 881<, 82, 3<< is Ù f Hx, y, yL GHâ xL ΝHâ yL.
In[154]:=
Out[154]=
GaussianIntegral @881, 2<, 83<, 84<, 85, 6<<D
control measure Ν
81, 2<
85, 6<
Gaussian measure G
83<
84<
Integrating f over the partition Σ = 881, 2<, 83<, 84<, 85, 6<< gives
Ùx1 =x2 ¹x3 ¹x4 ¹x5 =x6 f Hx1 , x2 , x3 , x4 , x5 , x6 L GHâ x1 L ... GHâ x6 L
= Ùx¹y f Hw, w, x, y, z, zL ΝHâ wL GHâ xL GHâ yL ΝHâ zL.
Integrating f over ³ Σ gives
Ù³Σ f Hx1 , x2 , x3 , x4 , x5 , x6 L GHâ x1 L ... GHâ x6 L
= Ù f Hw, w, x, y, z, zL ΝHâ wL GHâ xL GHâ yL ΝHâ zL.
In[155]:=
GaussianIntegral @881, 2<, 83<, 84<, 85<, 86<<D
control measure Ν
81, 2<
Out[155]=
Gaussian measure G
83<
84<
85<
86<
Integrating f over the partition Σ = 881, 2<, 83<, 84<, 85<, 86<< gives
Ùx1 =x2 ¹...¹x6 f Hx1 , x2 , x3 , x4 , x5 , x6 L GHâ x1 L ... GHâ x6 L
= Ùx ¹...¹x f Hx2 , x2 , x3 , x4 , x5 , x6 L ΝHâ x2 L GHâ x3 L ... GHâ x6 L.
3
6
Integrating f over ³ Σ gives
Ù³Σ f Hx1 , x2 , x3 , x4 , x5 , x6 L GHâ x1 L ... GHâ x6 L
= Ù f Hx2 , x2 , x3 , x4 , x5 , x6 L ΝHâ x2 L GHâ x3 L ... GHâ x6 L.
In[156]:=
Out[156]=
GaussianIntegral @881, 3<, 84, 5<, 86<, 87<, 82<<D
control measure Ν
81, 3<
84, 5<
Gaussian measure G
86<
87<
82<
With Σ = 881, 3<, 84, 5<, 86<, 87<, 82<<, integrating f over Σ gives
ÙΣ f Hx1 , x2 , x3 , x4 , x5 , x6 , x7 L GHâ x1 L ... GHâ x7 L
ÙΣ f Hx1 , x2 , x3 , x4 , x5 , x6 , x7 L GHâ x1 L ... GHâ x7 L
= Ùx ¹x ¹x f Hx3 , x2 , x3 , x5 , x5 , x6 , x7 L ΝHâ x3 L GHâ x2 L ΝHâ x5 L GHâ x6 L GHâ x7 L.
2
6
7
Integrating f over ³ Σ gives
Ù³Σ f Hx1 , x2 , x3 , x4 , x5 , x6 , x7 L GHâ x1 L ... GHâ x7 L
= Ù f Hx2 , x2 , x3 , x5 , x5 , x6 , x7 L ΝHâ x2 L GHâ x3 L ΝHâ x5 L GHâ x6 L GHâ x7 L.
Poisson Multiple Integrals
We first define some functions which are useful for the evaluation of Poisson multiple
integrals.
ì BOne: for a given set partition Σ, find B1HΣL, that is, isolate the
blocks of Σ that are singletons
In[157]:=
[email protected]_D ; [email protected] @PD, True, [email protected]::badarg, PD; FalseD :=
[email protected], [email protected]ðD Š 1 &D
é Example: find all of the singleton blocks of 881, 2<, 83, 4<, 85<<
In[158]:=
Out[158]=
[email protected], 2<, 83, 4<, 85<<D
885<<
é Example: the set partition 881, 2, 3<, 84, 5<< has no singleton blocks
In[159]:=
Out[159]=
[email protected], 2, 3<, 84, 5<<D
8<
ì BTwo: for a given set partition Σ, find B2HΣL, that is, isolate the
blocks of Σ that are not singletons
In[160]:=
[email protected]_D ; [email protected] @PD, True, [email protected]::badarg, PD; FalseD :=
[email protected], [email protected]ðD ³ 2 &D
é Example: find all of the blocks of 881, 2<, 83, 4<, 85<< that are not singletons
In[161]:=
Out[161]=
[email protected], 2<, 83, 4<, 85<<D
881, 2<, 83, 4<<
é Example: the set partition 881<, 82<, 83<, 84<, 85<< has no blocks that are not singletons
In[162]:=
Out[162]=
[email protected]<, 82<, 83<, 84<, 85<<D
8<
ì PBTwo: for a fixed set partition Σ, find B2HΣL; regarding B2HΣL
as a set, find all ordered partitions of B2HΣL with exactly two
blocks, called R1 and R2
In[163]:=
[email protected]_D ; [email protected] @PD, True, [email protected]::badarg, PD; FalseD :=
[email protected] = [email protected], size, candidates, rules, group, display<,
size = [email protected]; rules = [email protected]ð@@1DD, ð@@2DDD & ž [email protected]@sizeD, input<D;
candidates = [email protected] @sizeD, [email protected]ðD Š 2 &D;
group = [email protected], Reverse ž candidatesD . rules; [email protected] ž
[email protected]"R1"<, [email protected]ð@@1DD &, groupDD, [email protected]"R2"<, [email protected]ð@@2DD &, groupDD<, Frame ® AllDD
é Example: for the set partition 881, 2<, 83, 4<, 85, 6<, 87<<, find PB2 H881, 2<, 83, 4<, 85, 6<, 87<<L
In[164]:=
Out[164]=
[email protected], 2<, 83, 4<, 85, 6<, 87<<D
R1
R2
881, 2<<
883, 4<, 85, 6<<
883, 4<<
881, 2<, 85, 6<<
885, 6<<
881, 2<, 83, 4<<
881, 2<, 83, 4<<
885, 6<<
881, 2<, 85, 6<<
883, 4<<
883, 4<, 85, 6<<
881, 2<<
é Example: for the set partition 881, 2, 3<, 84, 5, 6<, 87<, 88<, 89, 10<<, find PB2 H881, 2, 3<, 84, 5, 6<, 87<, 88<, 89, 10<<L
In[165]:=
Out[165]=
[email protected], 2, 3<, 84, 5, 6<, 87<, 88<, 89, 10<<D
R1
R2
881, 2, 3<<
884, 5, 6<, 89, 10<<
884, 5, 6<<
881, 2, 3<, 89, 10<<
889, 10<<
881, 2, 3<, 84, 5, 6<<
881, 2, 3<, 84, 5, 6<<
889, 10<<
881, 2, 3<, 89, 10<<
884, 5, 6<<
884, 5, 6<, 89, 10<<
881, 2, 3<<
é Example: for the set partition 881, 2<, 83<<, PB2 H881, 2<, 83<<L is empty
In[166]:=
Out[166]=
[email protected], 2<, 83<<D
R1 R2
ì PoissonIntegral: This function can be used to compute
multiple Poisson integrals
PoissonIntegral: This function can be used to compute
multiple Poisson integrals
`
`
ÙΣ f Hx1 , ..., xn L NHâ x1 L ... NHâ xn L
over a set partition Σ, where f Hx1 , ..., xn L is a symmetric function, for example, gHx1 L ... gHxn L,
`
and where N is a compensated Poisson measure with control measure Ν. This function generates the set partition data necessary to compute multiple Poisson integrals.
In[167]:=
PoissonIntegral @P_D ;
[email protected] @PD, True, [email protected] ::badarg, PD; FalseD :=
[email protected]@Length ž PD Š 1, [email protected]@[email protected] ž 88"R1"<, 8"R2"<<, Frame ® AllD,
[email protected]@88"B1"<<D, Frame ® AllD<D, [email protected],
[email protected]@88"B2"<, [email protected]<<, Frame ® All, Alignment ® CenterD,
[email protected]"B1"<, [email protected]<<, Frame ® All, Alignment ® CenterD<D<D,
[email protected] = [email protected], inputtwo = [email protected], size, candidates, rules, group, display<,
size = [email protected];
rules = [email protected]ð@@1DD, ð@@2DDD & ž [email protected]@sizeD, inputone<D;
candidates = [email protected] @sizeD, [email protected]ðD Š 2 &D;
group = [email protected], Reverse ž candidatesD . rules;
[email protected]@[email protected] ž [email protected]"R1"<, [email protected]ð@@1DD &, groupDD,
[email protected]"R2"<, [email protected]ð@@2DD &, groupDD<, Frame ® AllD,
[email protected]@[email protected]"B1"<, [email protected], 8Length ž group<DD<D, Frame ® AllD<D,
[email protected], [email protected]@Transpose ž [email protected]"B2"<, 8inputone<D<, Frame ® AllD,
[email protected] ž [email protected]"B1"<, 8inputtwo<D<, Frame ® AllD<D<DDD
é Example: for the set partition Σ = 881, 2, 3<, 84, 5<, 86<, 87<<, compute R1 , R2 , B1 and B2 , which are involved in the computation of
the multiple Poisson integral over Σ
In[168]:=
PoissonIntegral @881, 2, 3<, 84, 5<, 86<, 87<<D
R1
R2
881, 2, 3<<
884, 5<<
884, 5<<
881, 2, 3<<
B1
886<, 87<<
886<, 87<<
Out[168]=
B2
881, 2, 3<, 84, 5<<
B1
886<, 87<<
`
`
Interpretation: Let Σ = 881, 2, 3<, 84, 5<, 86<, 87<<. Integrating gHx1 L ... gHx7 L over Σ with respect to the product N Hâ x1 L ... N Hâ x7 L
of compensated Poisson measures gives:
`
`
ÙΣ gHx1 L ... gHx7 L N Hâ x1 L ... N Hâ x7 L
`
`
`
= Ù g3 Hx3 L ΝHâ x3 L Ùx ¹x ¹x g2 Hx5 L gHx6 L gHx7 L N Hâ x5 L N Hâ x6 L N Hâ x7 L
5
6
7
`
`
`
+Ù g2 Hx5 L ΝHâ x5 L Ùx ¹x ¹x g3 Hx3 L gHx6 L gHx7 L N Hâ x3 L N Hâ x6 L N Hâ x7 L
3
ì
6
7
`
`
`
`
+Ùx ¹x ¹x ¹x g3 Hx3 L g2 Hx5 L gHx6 L gHx7 L N Hâ x3 L N Hâ x5 L N Hâ x6 L N Hâ x7 L
3
5
6
7
`
`
+Ù g3 Hx3 L ΝHâ x3 L Ù g2 Hx5 L ΝHâ x5 L Ùx ¹x gHx6 L gHx7 L N Hâ x6 L N Hâ x7 L
6
7
`
`
+Ù g3 Hx3 L ΝHâ x3 L Ù g2 Hx5 L ΝHâ x5 L Ùx ¹x gHx6 L gHx7 L N Hâ x6 L N Hâ x7 L
6
7
To get the first term, one uses HR1, R2, B1L from the first line of the first group of outputs, to get the second term, one uses
HR1, R2, B1L from the second line of the first group of outputs, and to get the last two terms, one uses HB2, B1L from the second
group of outputs.
`
Rule: The integral of a symmetric function over Σ with respect to a product of compensated Poisson measures N is a sum of
K + 2 terms, where K is the number of rows in the display (R1, R2, B1). They are obtained as follows:
(1) The variables with indices in R1 are identified and integrated over Ν; the variables with indices in a block of R2 are identified.
`
These identified variables, together with the variables with indices in B1, are integrated over N on the off-diagonals. This is done
for each row of the display (R1, R2, B1).
There are two other terms:
(2) The variables with indices in blocks of B2 are identified. These identified variables, together with the variables in B1, are
`
integrated over N on the off-diagonals.
(3) The variables with indices in each block of B2 are identified and integrated over Ν; the variables with indices in B1 are
`
integrated over N on the off-diagonals.
é Other examples:
In[169]:=
PoissonIntegral @881, 2<, 83, 4<, 85<, 86<<D
R1
R2
881, 2<< 883, 4<<
883, 4<< 881, 2<<
B1
885<, 86<<
885<, 86<<
Out[169]=
B2
881, 2<, 83, 4<<
B1
885<, 86<<
The integral
`
`
ÙΣ gHx1 L ... gHx6 L N Hâ x1 L ... N Hâ x6 L
`
`
`
= 2 IÙ g2 Hx2 L ΝHâ x2 LM Ùx ¹x ¹x g2 Hx4 L gHx5 L gHx6 L N Hâ x4 L N Hâ x5 L N Hâ x6 L
4
5
6
`
`
`
`
+Ùx ¹x ¹x ¹x g2 Hx2 L g2 Hx4 L gHx5 L gHx6 L N Hâ x2 L N Hâ x4 L N Hâ x5 L N Hâ x6 L
2
4
5
6
`
`
2
+IÙ g2 Hx2 L ΝHâ x2 LM Ùx ¹x gHx5 L gHx6 L N Hâ x5 L N Hâ x6 L
5
6
To get the first term, one uses HR1, R2, B1L from the first group of outputs and to get the last two terms one uses HB2, B1L from
the second group of outputs.
In[170]:=
Out[170]=
PoissonIntegral @881, 2, 3<, 84, 5, 6<, 87<, 88<, 89, 10<<D
R1
R2
881, 2, 3<<
884, 5, 6<, 89, 10<<
884, 5, 6<<
881, 2, 3<, 89, 10<<
889, 10<<
881, 2, 3<, 84, 5, 6<<
881, 2, 3<, 84, 5, 6<<
889, 10<<
881, 2, 3<, 89, 10<<
884, 5, 6<<
884, 5, 6<, 89, 10<<
881, 2, 3<<
B2
881, 2, 3<, 84, 5, 6<, 89, 10<<
B1
887<, 88<<
887<, 88<<
887<, 88<<
887<, 88<<
887<, 88<<
887<, 88<<
B1
887<, 88<<
é Examples worked out in the text:
In[171]:=
PoissonIntegral @881<, 82<, 83<<D
R1 R2
Out[171]=
B2
8<
B1
B1
881<, 82<, 83<<
In this case, the left- and right-hand sides are identical:
`
`
`
`
ÙΣ gHx1 L ... gHx3 L N Hâ x1 L ... N Hâ x3 L = Ùx1 ¹x2 ¹x3 gHx1 L ... gHx3 L N Hâ x1 L ... N Hâ x3 L.
In[172]:=
PoissonIntegral @881, 2, 3<<D
R1 R2
Out[172]=
B1
B2
881, 2, 3<<
B1
8<
The integral is
`
`
`
ÙΣ gHx1 L ... gHx3 L N Hâ x1 L ... N Hâ x3 L = Ù g3 Hx3 L N Hâ x3 L + Ù g3 Hx3 L ΝHâ x3 L,
which simplifies to
In[173]:=
PoissonIntegral @881<, 82, 3<<D
R1 R2
Out[173]=
B2
882, 3<<
Ù g3 Hx3 L NHâ x3 L.
B1
B1
881<<
The integral is
`
`
ÙΣ gHx1 L ... gHx3 L N Hâ x1 L ... N Hâ x3 L
`
`
`
= Ùx ¹x g2 Hx3 L gHx1 L N Hâ x3 L N Hâ x1 L + Ù g2 Hx3 L ΝHâ x3 L Ù gHx1 L N Hâ x1 L.
3
1
In[174]:=
PoissonIntegral @881, 2<, 83<, 84<, 85, 6<<D
R1
R2
881, 2<< 885, 6<<
885, 6<< 881, 2<<
B1
883<, 84<<
883<, 84<<
Out[174]=
B2
881, 2<, 85, 6<<
B1
883<, 84<<
The integral is
`
`
ÙΣ gHx1 L ... gHx6 L N Hâ x1 L ... N Hâ x6 L
`
`
`
2 Ù g2 Hx2 L Ν Hâ x2 L Ùx ¹x ¹x g2 Hx6 L gHx3 L g Hx4 L N Hâ x6 L N Hâ x3 L N Hâ x4 L.
6
3
4
`
`
`
`
+Ùx ¹x ¹x ¹x g2 Hx6 L g2 Hx2 L gHx3 L gHx4 L N Hâ x6 L N Hâ x2 L N Hâ x3 L N Hâ x4 L
6
2
3
4
`
`
2
+IÙ g2 Hx2 L ΝHâ x2 LM Ùx ¹x gHx3 L gHx4 L N Hâ x3 L N Hâ x4 L.
3
4
In[175]:=
PoissonIntegral @881, 2<, 83<, 84<, 85<, 86<<D
R1 R2
Out[175]=
B2
881, 2<<
B1
B1
883<, 84<, 85<, 86<<
The integral is
`
`
ÙΣ gHx1 L ... gHx6 L N Hâ x1 L ... N Hâ x6 L
`
`
= Ùx ¹...¹x g2 Hx2 L gHx3 L gHx4 L gHx5 L gHx6 L N Hâ x2 L ... N Hâ x6 L
2
6
`
`
+Ù g2 Hx2 L ΝHâ x2 L Ùx ¹x ¹x ¹x gHx3 L gHx4 L gHx5 L gHx6 L N Hâ x2 L ... N Hâ x6 L.
3
4
5
6
ì PoissonIntegralExceed: This function can be used to compute
multiple Poisson integrals
`
`
Ù³Σ f Hx1 , ..., xn L NHâ x1 L ... NHâ xn L,
`
where f Hx1 , ..., xn L is a symmetric function, for example, gHx1 L ... gHxn L, and where N is a compensated Poisson measure with control measure Ν. This function generates the set partition
data necessary to compute multiple Poisson integrals over set partitions greater than or
equal to Σ.
In[176]:=
PoissonIntegralExceed @P_D ;
[email protected] @PD, True, [email protected] ::badarg, PD; FalseD :=
[email protected]@Length ž PD Š 1, [email protected]"B1"<, [email protected]<<, Frame ® All, Alignment ® CenterD,
[email protected] = [email protected], inputtwo = [email protected], size, candidates, rules, group, display<,
size = [email protected];
rules = [email protected]ð@@1DD, ð@@2DDD & ž [email protected]@sizeD, inputone<D;
candidates = [email protected] @sizeD, [email protected]ðD Š 2 &D;
group = [email protected], Reverse ž candidatesD . rules;
[email protected]@Transpose ž [email protected]"B2"<, 8inputone<D<, Frame ® AllD,
[email protected] ž [email protected]"B1"<, 8inputtwo<D<, Frame ® AllD<DDD
é Example: compute a Poisson integral over ³ Σ where Σ = 881, 2, 3<, 84, 5<, 86<, 87<<
In[177]:=
Out[177]=
PoissonIntegralExceed @881, 2, 3<, 84, 5<, 86<, 87<<D
B2
881, 2, 3<, 84, 5<<
B1
886<, 87<<
Interpretation: Let Σ = 881, 2, 3<, 84, 5<, 86<, 87<<. Integrating gHx1 L ... gHx7 L over all those set partitions greater than or equal to Σ
`
`
with respect to the product N Hâ x1 L ... N Hâ x7 L of compensated Poisson measures gives:
`
2
3
2
à g Hx3 L NHâ x3 L à g Hx5 L NHâ x5 L JÙ gHx7 L N Hâ x7 LN
Rule: Equate the variables in each block of B2 and integrate them with respect to the uncompensated Poisson measure N; the
`
variables listed in B1 are integrated wiht respect to the compensated Poisson measure N .
é Example: compute a Poisson integral over ³ Σ where Σ = 881<, 82<, 83<<, the singleton partition of order 3
In[178]:=
Out[178]=
PoissonIntegralExceed @881<, 82<, 83<<D
B1
881<, 82<, 83<<
The integral is
`
`
`
`
Ù³Σ gHx1 L ... gHx3 L N Hâ x1 L ... N Hâ x3 L = Ù gHx1 L ... gHx3 L N Hâ x1 L ... N Hâ x3 L
because Σ is a singleton and, therefore, integrating over "³Σ" is equivalent to integrating over the whole space.
é Example: compute a Poisson integral over ³ Σ where Σ = 881, 2, 3<<, the maximal partition of order 3
In[179]:=
Out[179]=
PoissonIntegralExceed @881, 2, 3<<D
B2
881, 2, 3<<
B1
8<
Thus,
`
`
`
Ù³1` gHx1 L gHx2 L gHx3 L N Hâ x1 L N Hâ x2 L N Hâ x3 L = Ù gHxL3 NHâ xL.
`
Observe that integrating over "³1", namely, the collection of set partitions that is greater than or equal to the maximal set parti`
tion is the same as integrating over the maximal partition 1.
é Example: compute a Poisson integral over ³ Σ where Σ = 881, 2, 3<, 84, 5, 6<, 87<, 88<, 89, 10<<
Example: compute a Poisson integral over ³ Σ where Σ = 881, 2, 3<, 84, 5, 6<, 87<, 88<, 89, 10<<
In[180]:=
Out[180]=
PoissonIntegralExceed @881, 2, 3<, 84, 5, 6<, 87<, 88<, 89, 10<<D
B2
881, 2, 3<, 84, 5, 6<, 89, 10<<
B1
887<, 88<<
Thus,
`
`
`
2
Ù³Σ gHx1 L ... gHx10 L N Hâ x1 L ... N Hâ x10 L = IÙ g8 Hx1 L NHâ x1 LM JÙ gHx2 L N Hâ x2 LN .
If f is symmetric, then
`
`
`
`
Ù³Σ f Hx1 , ..., x10 L N Hâ x1 L ... N Hâ x10 L = Ù f Hx, ..., x, y, zL NHâ xL N Hâ yL N Hâ zL.
Contraction and Symmetrization
ì ContractionWithSymmetrization: in the product of two
symmetric functions of p and q variables, respectively, identify
r variables in each function and symmetrize the result
In[181]:=
é
ContractionWithSymmetrization @p_, q_, r_D ; [email protected]@r £ [email protected], qDDL,
True, [email protected] ::badarg, rD; FalseD :=
[email protected] = [email protected] + qD, splitfirst = [email protected], splitsecond = [email protected] + p,
workinglist, identificationrules , transformedlist , condensedlist , purgedlist,
secondpurgedlist , finallist<, workinglist = [email protected] = [email protected], pD<,
8ð, [email protected], ðD< & ž initdataD; identificationrules =
[email protected]@r Š 0, 8<, [email protected] @@iDD ® [email protected]@iDD, 8i, 1, r<DD,
[email protected] Š 0L ÈÈ r > [email protected] D - 1L, 8<,
[email protected] @@i + 1DD ® splitsecond @@iDD, 8i, r, [email protected] D - 1<DDD;
transformedlist = workinglist . identificationrules ;
purgedlist = [email protected]@transformedlist , [email protected]@ð@@1DDDD Š Length ž splitfirstL &&
[email protected]@ð@@2DDDD Š Length ž splitsecond L ⅅ secondpurgedlist =
[email protected]@[email protected] ž [email protected]@i, jDD, 8j, 1, 2<D, 8i, 1, Length ž purgedlist<DD;
finallist = [email protected] , [email protected]ð@@1DDD Š pL && [email protected]ð@@2DDD Š qLL &D;
Print ž H"Number of terms after symmetrization = " <> [email protected]@p + q - 2 r, p - rDDL;
[email protected]@[email protected] žž [email protected]@iDD<, 8i, 1, Length ž finallist<DD, Frame ® AllDD
ì
Input format: ContractionWithSymmetrization[p,q,r], where r £ min 8p, q<
é Example: compute the contraction with symmetrization of a pair of two-dimensional symmetric functions f and g, identifying one
of the variables
In[182]:=
ContractionWithSymmetrization @2, 2, 1D
Number of terms after symmetrization = 2
Out[182]=
881, 2<, 81, 3<<
881, 3<, 81, 2<<
The input function is f Hx1 , x2 L gHx3 , x4 L. The output is
1
2
H f Hx1 , x2 L gHx1 , x3 L + f Hx1 , x3 L gHx1 , x2 LL.
é Example: compute the symmetrization of a pair of two-dimensional symmetric functions f and g, identifying none of the variables
In[183]:=
ContractionWithSymmetrization @2, 2, 0D
Number of terms after symmetrization = 6
Out[183]=
881,
881,
881,
882,
882,
883,
2<,
3<,
4<,
3<,
4<,
4<,
83,
82,
82,
81,
81,
81,
4<<
4<<
3<<
4<<
3<<
2<<
é Example: compute the contraction with symmetrization of a pair of two-dimensional symmetric functions f and g, identifying all
of the variables
In[184]:=
ContractionWithSymmetrization @2, 2, 2D
Number of terms after symmetrization = 1
Out[184]=
881, 2<, 81, 2<<
The input function is f Hx1 , x2 L gHx3 , x4 L. Two variables are equated in each of the arguments. The output function is
f Hx1 , x2 L gHx1 , x2 L.
é Example: compute the contraction with symmetrization of a pair of two-dimensional symmetric function f and a threedimensional symmetric function g, identifying one of the variables
In[185]:=
ContractionWithSymmetrization @2, 3, 1D
Number of terms after symmetrization = 3
Out[185]=
881, 2<, 81, 3, 4<<
881, 3<, 81, 2, 4<<
881, 4<, 81, 2, 3<<
The input function is f Hx1 , x2 L gHx3 , x4 , x5 L. One variable is equated in each of the arguments. The output function is
1
6
H f Hx1 , x2 L gHx1 , x3 , x4 L + f Hx1 , x3 L gHx1 , x2 , x4 L + f Hx1 , x4 L gHx1 , x2 , x3 LL.
1
6
H f Hx1 , x2 L gHx1 , x3 , x4 L + f Hx1 , x3 L gHx1 , x2 , x4 L + f Hx1 , x4 L gHx1 , x2 , x3 LL.
é Example: attempt to compute the contraction with symmetrization when r > min 8 p, q<
In[186]:=
ContractionWithSymmetrization @2, 3, 4D
ContractionWithSymmetrization::badarg : r must be less than p and q. Invalid argument 4
Out[186]=
ContractionWithSymmetrization @2, 3, 4D
ì ContractionIntegration: in the product of two symmetric
functions of p and q variables, respectively, identify r variables
in each function, and integrate l of these r variables. The
Ž
integrated variables are designated by an overtilde, e.g. 1.
In[187]:=
ì
ContractionIntegration @p_, q_, r_, l_D ; [email protected]@l £ rD && [email protected] £ [email protected], qDDL,
True, [email protected] £ rD Š FalseL && [email protected] £ [email protected], qDD Š TrueLL,
[email protected] ::badargforl, lD,
[email protected] £ rD Š TrueL && [email protected] £ [email protected], qDD Š FalseLL,
[email protected] ::badargforr, rD; FalseD :=
[email protected] = [email protected], secondlist<,
secondlist = [email protected]@[email protected]@@iDD, 8i, 1, r<D, [email protected] + p, 8i, 1, q - r<DDD;
integrationrules = [email protected] ® [email protected], 8i, 1, l<D;
8firstlist, secondlist< . integrationrules D
Input format: ContractionIntegration[p,q,r,l], where l £ r £ min 8p, q<
é Example:
In[188]:=
Out[188]=
ContractionIntegration @3, 2, 1, 1D
Ž
Ž
991, 2, 3=, 91, 4==
The input function is f Hx1 , x2 , x3 L gHx4 , x5 L. One variable is equated in each of the arguments, and then an integral is taken with
respect to that variable. The output function is Ù f Hx1 , x2 , x3 L gHx1 , x4 L ΝHâ x1 L.
In[189]:=
Out[189]=
ContractionIntegration @2, 4, 1, 1D
Ž
Ž
991, 2=, 91, 3, 4, 5==
The input function is f Hx1 , x2 L gHx3 , x4 , x5 , x6 L. One variable is equated in each of the arguments, and then an integral is taken
with respect to that variable. The output function is Ù f Hx1 , x2 L gHx1 , x3 , x4 , x5 L ΝHâ x1 L.
In[190]:=
Out[190]=
ContractionIntegration @2, 4, 2, 1D
Ž
Ž
991, 2=, 91, 2, 3, 4==
The input function is f Hx1 , x2 L gHx3 , x4 , x5 , x6 L. Two variables are equated in each of the arguments, and then an integral is
respect to one of these two variables. The output function is Ù f Hx1 , x2 L gHx1 , x2 , x5 , x6 L ΝHâ x1 L.
In[191]:=
ContractionIntegration @2, 4, 2, 3D
ContractionIntegration::badargforl : l must be less than or equal to r. Invalid argument 3
Out[191]=
ContractionIntegration @2, 4, 2, 3D
We get an error message because 3 = l > r = 2.
In[192]:=
ContractionIntegration @2, 4, 5, 1D
ContractionIntegration::badargforr : r must be less than both p and q. Invalid argument 5
Out[192]=
ContractionIntegration @2, 4, 5, 1D
We get an error message because 5 = r > min 8 p, q< = 2.
In[193]:=
Out[193]=
In[194]:=
Out[194]=
In[195]:=
Out[195]=
In[196]:=
Out[196]=
In[197]:=
Out[197]=
In[198]:=
Out[198]=
In[199]:=
Out[199]=
ContractionIntegration @2, 2, 1, 0D
881, 2<, 81, 3<<
ContractionIntegration @2, 2, 1, 1D
Ž
Ž
991, 2=, 91, 3==
ContractionIntegration @2, 2, 2, 2D
Ž Ž
Ž Ž
991, 2=, 91, 2==
ContractionIntegration @3, 2, 2, 2D
Ž Ž
Ž Ž
991, 2, 3=, 91, 2==
ContractionIntegration @3, 2, 2, 1D
Ž
Ž
991, 2, 3=, 91, 2==
ContractionIntegration @4, 3, 2, 1D
Ž
Ž
991, 2, 3, 4=, 91, 2, 5==
ContractionIntegration @3, 4, 2, 1D
Ž
Ž
991, 2, 3=, 91, 2, 4, 5==
ì ContractionIntegrationWithSymmetrization: in the product of
two symmetric functions of p and q variables, respectively,
identify r variables in each function, integrate l of these r
variables, and then symmetrize the result
In[200]:=
ContractionIntegrationWithSymmetrization @p_, q_, r_, l_D ;
[email protected]@l £ rD && [email protected] £ [email protected], qDDL, True,
[email protected] £ rD Š FalseL && [email protected] £ [email protected], qDD Š TrueLL,
[email protected] ::badargforl, lD,
[email protected] £ [email protected], qDD Š FalseL,
[email protected] ::badargforr, rD; FalseD :=
[email protected] > [email protected], qD, "r must be less than both p and q",
[email protected] = [email protected] + qD, splitfirst = [email protected], splitsecond = [email protected] + p,
workinglist, identificationrules , transformedlist , condensedlist ,
purgedlist, secondpurgedlist , finallist, integrationrules , integratedlist <,
workinglist = [email protected] = [email protected], pD<,
8ð, [email protected], ðD< & ž initdataD; identificationrules =
[email protected]@r Š 0, 8<, [email protected] @@iDD ® [email protected]@iDD, 8i, 1, r<DD,
[email protected] Š 0L ÈÈ r > [email protected] D - 1L, 8<,
[email protected] @@i + 1DD ® splitsecond @@iDD, 8i, r, [email protected] D - 1<DDD;
transformedlist = workinglist . identificationrules ;
purgedlist = [email protected]@transformedlist , [email protected]@ð@@1DDDD Š Length ž splitfirstL &&
[email protected]@ð@@2DDDD Š Length ž splitsecond L ⅅ secondpurgedlist =
[email protected]@[email protected] ž [email protected]@i, jDD, 8j, 1, 2<D, 8i, 1, Length ž purgedlist<DD;
finallist = [email protected] , [email protected]ð@@1DDD Š pL && [email protected]ð@@2DDD Š qLL &D;
integrationrules = [email protected] ® [email protected], 8i, 1, l<D;
integratedlist = finallist . integrationrules ;
Print ž H"Number of terms after symmetrization = " <> [email protected]@p + q - 2 r, p - rDDL;
[email protected]@[email protected] žž 8integratedlist @@iDD<, 8i, 1, Length ž integratedlist <DD,
Frame ® AllDDD
é Examples:
In[201]:=
ContractionIntegrationWithSymmetrization @3, 2, 1, 1D
Number of terms after symmetrization = 3
Out[201]=
Ž
Ž
991, 2, 3=, 91, 4==
Ž
Ž
991, 2, 4=, 91, 3==
Ž
Ž
991, 3, 4=, 91, 2==
The input function is f Hx1 , x2 , x3 L gHx4 , x5 L. The output is
1
3
Ù 8 f Hx1 , x2 , x3 L gHx1 , x4 L + f Hx1 , x2 , x4 L gHx1 , x3 L + f Hx1 , x3 , x4 L gHx1 , x2 L< ΝHâ x1 L.
In[202]:=
ContractionIntegrationWithSymmetrization @2, 2, 1, 0D
Number of terms after symmetrization = 2
Out[202]=
In[203]:=
881, 2<, 81, 3<<
881, 3<, 81, 2<<
ContractionIntegrationWithSymmetrization @2, 2, 2, 1D
Number of terms after symmetrization = 1
Out[203]=
In[204]:=
Ž
Ž
991, 2=, 91, 2==
ContractionIntegrationWithSymmetrization @2, 2, 2, 2D
Number of terms after symmetrization = 1
Out[204]=
In[205]:=
Ž Ž
Ž Ž
991, 2=, 91, 2==
ContractionIntegrationWithSymmetrization @2, 2, 3, 4D
ContractionIntegrationWithSymmetrization::badargforr : r must be less than both p and q. Invalid argument 3
Out[205]=
ContractionIntegrationWithSymmetrization @2, 2, 3, 4D
We get an error message because 3 = r > min 8 p, q< = 2.
Solving Partition Equations Involving P*
ì PiStarMeetSolve: for a finite sequence of positive integers,
generate a unique set partition P* whose block sizes are equal
to these integers, and then find all set partitions Σ such that
`
the meet of Σ and P* is the singleton partition 0. The result is
used in Rota and Wallstrom's Theorem.
In[206]:=
PiStarMeetSolve @list_D ;
[email protected]@listD && [email protected]@listD > 0D && [email protected]@HIntegerQ ž listL, FalseDDL,
True, [email protected] Š False && [email protected]@listD > 0D Š True &&
[email protected]@HIntegerQ ž listL, FalseDD Š TrueL,
[email protected] ::notalist, listD, [email protected] Š True &&
[email protected]@listD > 0D Š True && [email protected]@HIntegerQ ž listL, FalseDD Š FalseL,
[email protected] ::notintegersinlist , listD, [email protected] Š True &&
[email protected]@listD > 0D Š False && N[email protected]@HIntegerQ ž listL, FalseDD Š TrueL,
[email protected] ::integernotpositive , listD; FalseD :=
[email protected] = [email protected], ran, control = [email protected]
[email protected]@[email protected], - 1D, 1DD, [email protected]<D, pistar<, ran = [email protected];
pistar = [email protected]@@[email protected]@i, 1DD ;; [email protected]@i, 2DDDD, 8i, 1, Length ž control<D;
[email protected]"pistar = " <> [email protected]; [email protected]
é Input format: PiStarMeetSolve[list], where "list" is a list of positive integers that define the set partition P* . Each argument, for
example k, in the exist, defines a block of size k.
Input format: PiStarMeetSolve[list], where "list" is a list of positive integers that define the set partition P* . Each argument, for
example k, in the exist, defines a block of size k.
`
`
é Example: for the sequence 82, 2<, generate P* and find the meets of P* that give 0, that is, all partitions Σ such that Σ ß Π = 0
In[207]:=
PiStarMeetSolve @82, 2<D
pistar = 881, 2<, 83, 4<<
Number of Solutions to Meet Problem = 7
Out[207]=
8881, 4<, 82, 3<<, 881, 3<, 82, 4<<, 881<, 82, 3<, 84<<,
881<, 82, 4<, 83<<, 881, 3<, 82<, 84<<, 881, 4<, 82<, 83<<, 881<, 82<, 83<, 84<<<
`
é Example: for the sequence 81, 1, 2<, generate P* and find the meets of P* that give 0
In[208]:=
PiStarMeetSolve @81, 1, 2<D
pistar = 881<, 82<, 83, 4<<
Number of Solutions to Meet Problem = 10
Out[208]=
8881, 2, 3<, 84<<, 881, 4<, 82, 3<<, 881, 2, 4<, 83<<,
881, 3<, 82, 4<<, 881<, 82, 3<, 84<<, 881<, 82, 4<, 83<<, 881, 2<, 83<, 84<<,
881, 3<, 82<, 84<<, 881, 4<, 82<, 83<<, 881<, 82<, 83<, 84<<<
`
é Example: for the sequence 82, 2, 1<, generate P* and find the meets of P* that give 0
In[209]:=
PiStarMeetSolve @82, 2, 1<D
pistar = 881, 2<, 83, 4<, 85<<
Number of Solutions to Meet Problem = 27
Out[209]=
é
8881, 4, 5<, 82, 3<<, 881, 3<, 82, 4, 5<<, 881, 4<, 82, 3, 5<<, 881, 3, 5<, 82, 4<<,
881<, 82, 3<, 84, 5<<, 881<, 82, 4, 5<, 83<<, 881<, 82, 3, 5<, 84<<,
881<, 82, 4<, 83, 5<<, 881, 3<, 82<, 84, 5<<, 881, 4, 5<, 82<, 83<<,
881, 3, 5<, 82<, 84<<, 881, 4<, 82<, 83, 5<<, 881, 4<, 82, 3<, 85<<, 881, 5<, 82, 3<, 84<<,
881, 3<, 82, 4<, 85<<, 881, 5<, 82, 4<, 83<<, 881, 3<, 82, 5<, 84<<, 881, 4<, 82, 5<, 83<<,
881<, 82<, 83<, 84, 5<<, 881<, 82<, 83, 5<, 84<<, 881<, 82, 3<, 84<, 85<<,
881<, 82, 4<, 83<, 85<<, 881<, 82, 5<, 83<, 84<<, 881, 3<, 82<, 84<, 85<<,
881, 4<, 82<, 83<, 85<<, 881, 5<, 82<, 83<, 84<<, 881<, 82<, 83<, 84<, 85<<<
ì PiStarJoinSolve: for a finite sequence of positive integers,
generate a unique set partition P* whose block sizes are equal
to these integers, and then find all set partitions Σ such that
`
*
the join of Σ and P is the singleton partition 1
In[210]:=
PiStarJoinSolve @list_D ;
[email protected]@listD && [email protected]@listD > 0D && [email protected]@HIntegerQ ž listL, FalseDDL,
True, [email protected] Š False && [email protected]@listD > 0D Š True &&
[email protected]@HIntegerQ ž listL, FalseDD Š TrueL,
[email protected] ::notalist, listD, [email protected] Š True &&
[email protected]@listD > 0D Š True && [email protected]@HIntegerQ ž listL, FalseDD Š FalseL,
[email protected] ::notintegersinlist , listD, [email protected] Š True &&
[email protected]@listD > 0D Š False && [email protected]@HIntegerQ ž listL, FalseDD Š TrueL,
[email protected] ::integernotpositive , listD; FalseD :=
[email protected] = [email protected], ran, control = [email protected]
[email protected]@[email protected], - 1D, 1DD, [email protected]<D, pistar<, ran = [email protected];
pistar = [email protected]@@[email protected]@i, 1DD ;; [email protected]@i, 2DDDD, 8i, 1, Length ž control<D;
[email protected]"pistar = " <> [email protected]; [email protected]
é Input format: PiStarJoinSolve[list], where "list" is a list of positive integers that define the set partition P* . Each argument, for
example k, in the exist, defines a block of size k.
`
é Example: for the sequence 82, 2<, generate P* and find the joins of P* that give 1
In[211]:=
PiStarJoinSolve @82, 2<D
pistar = 881, 2<, 83, 4<<
Number of Solutions to Join Problem = 11
Out[211]=
8881, 2, 3, 4<<, 881<, 82, 3, 4<<, 881, 3, 4<, 82<<,
881, 2, 3<, 84<<, 881, 4<, 82, 3<<, 881, 2, 4<, 83<<, 881, 3<, 82, 4<<,
881<, 82, 3<, 84<<, 881<, 82, 4<, 83<<, 881, 3<, 82<, 84<<, 881, 4<, 82<, 83<<<
`
é Example: for the sequence 81, 1, 2<, generate P* and find the joins of P* that give 1
In[212]:=
PiStarJoinSolve @81, 1, 2<D
pistar = 881<, 82<, 83, 4<<
Number of Solutions to Join Problem = 5
Out[212]=
8881, 2, 3, 4<<, 881, 2, 3<, 84<<, 881, 4<, 82, 3<<, 881, 2, 4<, 83<<, 881, 3<, 82, 4<<<
`
é Example: for the sequence 82, 2, 1<, generate P* and find the joins of P* that give 1
In[213]:=
PiStarJoinSolve @82, 2, 1<D
pistar = 881, 2<, 83, 4<, 85<<
Number of Solutions to Join Problem = 25
Out[213]=
8881, 2, 3, 4, 5<<, 881<, 82, 3, 4, 5<<, 881, 3, 4, 5<, 82<<, 881, 2, 3<, 84, 5<<,
881, 4, 5<, 82, 3<<, 881, 2, 4, 5<, 83<<, 881, 3<, 82, 4, 5<<, 881, 5<, 82, 3, 4<<,
881, 3, 4<, 82, 5<<, 881, 2, 3, 5<, 84<<, 881, 4<, 82, 3, 5<<, 881, 2, 4<, 83, 5<<,
881, 3, 5<, 82, 4<<, 881<, 82, 3<, 84, 5<<, 881<, 82, 4, 5<, 83<<, 881<, 82, 3, 5<, 84<<,
881<, 82, 4<, 83, 5<<, 881, 3<, 82<, 84, 5<<, 881, 4, 5<, 82<, 83<<,
881, 3, 5<, 82<, 84<<, 881, 4<, 82<, 83, 5<<, 881, 5<, 82, 3<, 84<<,
881, 5<, 82, 4<, 83<<, 881, 3<, 82, 5<, 84<<, 881, 4<, 82, 5<, 83<<<
ì PiStarMeetAndJoinSolve: for a finite sequence of positive
integers, generate a unique set partition P* whose block sizes
are equal to these integers, and then find all set partitions Σ
`
such that the meet of Σ and P* is the singleton partition 0 and
`
*
the join of Σ and P is the singleton partition 1. This function is
used in diagram formulae.
In[214]:=
PiStarMeetAndJoinSolve @list_D ;
[email protected]@listD && [email protected]@listD > 0D && [email protected]@HIntegerQ ž listL, FalseDDL,
True, [email protected] Š False && [email protected]@listD > 0D Š True &&
[email protected]@HIntegerQ ž listL, FalseDD Š TrueL,
[email protected] ::notalist, listD, [email protected] Š True &&
[email protected]@listD > 0D Š True && [email protected]@HIntegerQ ž listL, FalseDD Š FalseL,
[email protected] ::notintegersinlist , listD, [email protected] Š True &&
[email protected]@listD > 0D Š False && [email protected]@HIntegerQ ž listL, FalseDD Š TrueL,
[email protected] ::integernotpositive , listD; FalseD :=
[email protected] = [email protected], ran, control = [email protected]
[email protected]@[email protected], - 1D, 1DD, [email protected]<D, pistar<, ran = [email protected];
pistar = [email protected]@@[email protected]@i, 1DD ;; [email protected]@i, 2DDDD, 8i, 1, Length ž control<D;
[email protected]"pistar = " <> [email protected]; MeetAndJoinSolve @pistarDD
é Input format: PiStarMeetAndJoinSolve[list], where "list" is a list of positive integers that define the set partition P* . Each
argument, for example k, in the exist, defines a block of size k.
`
`
é Example: for the sequence 82, 2<, generate P* and find the intersection of the joins of P* that give 1 and the meets of P* that give 0
In[215]:=
PiStarMeetAndJoinSolve @82, 2<D
pistar = 881, 2<, 83, 4<<
Number of Solutions to Meet Problem = 7
Number of Solutions to Meet and Join Problem = 6
Out[215]=
8881, 4<, 82, 3<<, 881, 3<, 82, 4<<, 881<, 82, 3<, 84<<,
881<, 82, 4<, 83<<, 881, 3<, 82<, 84<<, 881, 4<, 82<, 83<<<
`
é Example: for the sequence 81, 1, 2<, generate P* and find the intersection of the joins of P* that give 1 and the meets of P* that give
`
0
In[216]:=
PiStarMeetAndJoinSolve @81, 1, 2<D
pistar = 881<, 82<, 83, 4<<
Number of Solutions to Meet Problem = 10
Number of Solutions to Meet and Join Problem = 4
Out[216]=
8881, 2, 3<, 84<<, 881, 4<, 82, 3<<, 881, 2, 4<, 83<<, 881, 3<, 82, 4<<<
`
é Example: for the sequence 82, 2, 1<, generate P* and find the intersection of the joins of P* that give 1 and the meets of P* that give
`
0
In[217]:=
PiStarMeetAndJoinSolve @82, 2, 1<D
pistar = 881, 2<, 83, 4<, 85<<
Number of Solutions to Meet Problem = 27
Number of Solutions to Meet and Join Problem = 16
Out[217]=
8881, 4, 5<, 82, 3<<, 881, 3<, 82, 4, 5<<, 881, 4<, 82, 3, 5<<, 881, 3, 5<, 82, 4<<,
881<, 82, 3<, 84, 5<<, 881<, 82, 4, 5<, 83<<, 881<, 82, 3, 5<, 84<<, 881<, 82, 4<, 83, 5<<,
881, 3<, 82<, 84, 5<<, 881, 4, 5<, 82<, 83<<, 881, 3, 5<, 82<, 84<<, 881, 4<, 82<, 83, 5<<,
881, 5<, 82, 3<, 84<<, 881, 5<, 82, 4<, 83<<, 881, 3<, 82, 5<, 84<<, 881, 4<, 82, 5<, 83<<<
Product of Two Gaussian Multiple Integrals
ì ProductTwoGaussianIntegrals: computes the product
IpG Hf L IqG HgL of two Gaussian multiple integrals, one of order p ³ 1
and one of order q ³ 1; the function f has p variables and the
function g has q variables; both f and g are symmetric
functions
Namely, it computes
G
IG
p H f L Iq HgL = Úr=0 r !
pìq
p
r
q G
I
H f Är gL,
r p+q-2 r
In the displayed output of the function,
coefficient = r !
p
r
q
.
r
G
Observe that I G
p+q-2 r H f Är gL is equal to I p+q-2 r H f Är gL , where ~ denotes symmetrization.
~
In[218]:=
ProductTwoGaussianIntegrals @p_, q_D ;
[email protected]@0 £ [email protected], qDD && [email protected] && [email protected], True, [email protected],
[email protected] ::nonintegerparg , pD, [email protected],
[email protected] ::nonintegerqarg , qD, [email protected] < 0D,
[email protected] ::negintegerp, pD, [email protected] < 0D,
[email protected] ::negintegerq , qD; FalseD :=
GridAJoinA88"r", "coefficient", "integral"<<, TableA9r, r ! [email protected], rD [email protected], rD,
RowA9IGp+q-2 r , [email protected]"Hf", [email protected], [email protected] @8855D, rD, ,
[email protected], "gL"<DL=E=, 8r, 0, [email protected], qD<EE, Frame ® AllE
é Input format: ProductTwoGaussianIntegrals[p,q]
é Examples:
In[219]:=
ProductTwoGaussianIntegrals @1, 1D
r coefficient
Out[219]=
0
1
1
1
integral
IG2 Hf Ä0 gL
IG0 Hf Ä1 gL
G
The input functions are f Hx1 L and gHx2 L. We are computing IG
1 H f L I1 HgL. The output is
G
IG
2 H f Ä0 gL + I0 H f Ä1 gL = Ùx ¹x f Hx1 L gHx2 L GHâ x1 L GHâ x2 L + Ù f HxL gHxL ΝHâ xL.
1
2
ProductTwoGaussianIntegrals @2, 2D
In[220]:=
r coefficient
Out[220]=
0
1
1
4
2
2
integral
IG4 Hf Ä0 gL
IG2 Hf Ä1 gL
IG0 Hf Ä2 gL
G
The input functions are f Hx1 , x2 L and gHx3 , x4 L. We are computing IG
2 H f L I2 HgL. The output is
G
G
IG
4 H f Ä0 gL + 4 I2 H f Ä1 gL + 2 I0 H f Ä2 gL
= Ùx ¹...¹x f Ix1, x2 M gHx3 , x4 L GHâ x1 L ... GHâ x4 L
1
4
+4 Ùx ¹x IÙ f Ix1, x2 M gHx1 , x4 L ΝHâ x1 LM GHâ x2 L GHâ x4 L
2
4
+2 Ù f Hx1 , x2 L gHx1 , x2 L ΝHâ x1 L ΝHâ x2 L.
ProductTwoGaussianIntegrals @3, 2D
In[221]:=
r coefficient
Out[221]=
0
1
1
6
2
6
integral
IG5 Hf Ä0 gL
IG3 Hf Ä1 gL
IG1 Hf Ä2 gL
ProductTwoGaussianIntegrals @4, 2D
In[222]:=
r coefficient
Out[222]=
0
1
1
8
2
12
integral
IG6 Hf Ä0 gL
IG4 Hf Ä1 gL
IG2 Hf Ä2 gL
Product of Two Poisson Multiple Integrals
ì ProductTwoPoissonIntegrals: computes the product
`
`
N
N
Ip Hf L Iq HgL
of two Poisson multiple integrals, one of order p ³ 1 and one of
order q ³ 1; both f and g are symmetric
Namely, it computes
I pN H f L IqN HgL = Úr=0 r !
`
`
pìq
p
r
Úrl=0
q
r
r N`
I
I f *lr gM ,
l p+q-r-l
In the displayed output of the function,
coefficient = r !
p
r
q
r
r
.
l
N
N
Observe that I p+q-r-l
I f *lr gM = I p+q-r-l
I f *lr gM , where ~ denotes symmetrization.
`
`
~
N
N
Observe that I p+q-r-l
I f *lr gM = I p+q-r-l
I f *lr gM , where ~ denotes symmetrization.
`
In[223]:=
`
~
ProductTwoPoissonIntegrals @p_, q_D ;
[email protected]@0 £ [email protected], qDD && [email protected] && [email protected], True,
[email protected], [email protected] ::nonintegerparg , pD,
[email protected], [email protected] ::nonintegerqarg , qD,
[email protected] < 0D, [email protected] ::negintegerp, pD,
[email protected] < 0D, [email protected] ::negintegerq , qD; FalseD :=
GridBJoinB88"r", "l", "coefficient", "integral"<<,
PartitionBFlattenBTableB:r, l, r ! [email protected], rD [email protected], rD [email protected], lD,
RowB:INp+q-r-l , [email protected]"Hf", [email protected], Subsuperscript @FromCharacterCode @42D, r, lD,
`
[email protected], "gL"<DL>F>, 8r, 0, [email protected], qD<, 8l, 0, r<FF, 4FF, Frame ® AllF
ì
Input format: ProductTwoPoissonIntegrals[p,q]
In[224]:=
ProductTwoPoissonIntegrals @1, 1D
r l coefficient integral
IN2 Hf *00 gL
`
0 0
1
1 0
1
1 1
1
IN1 Hf *01 gL
`
Out[224]=
IN0 Hf *11 gL
`
Thus,
I1N H f L I1N HgL = I2N I f *00 gM + I1N I f *01 gM + I0N I f *11 gM
`
`
`
`
`
`
`
= Ùx¹y f HxL gHyL N Hâ xL N Hâ yL
`
+Ù f HxL gHxL N Hâ xL
+Ù f HxL gHxL ΝHâ xL
`
`
= Ùx¹y f HxL gHyL N Hâ xL N Hâ yL + Ù f HxL gHxL NHâ xL.
In[225]:=
ProductTwoPoissonIntegrals @2, 1D
r l coefficient integral
IN3 Hf *00 gL
`
0 0
1
1 0
2
1 1
2
IN2 Hf *01 gL
`
Out[225]=
IN1 Hf *11 gL
`
Thus,
I2N H f L I1N HgL = I3N I f *00 gM + 2 I2N I f *01 gM + 2 I0N I f *11 gM
`
`
`
`
`
`
`
`
= Ùx ¹x ¹y f Hx1 , x2 L gHyL N Hâ x1 L N Hâ x2 L N Hâ yL
1
2
`
`
+2 Ùx¹y f Hx, yL gHyL N Hâ xL N Hâ yL
`
`
+2 Ùx¹y f Hx, yL gHyL N Hâ xL N Hâ yL
`
+2 Ù f Hx, yL gHyL ΝHâ yL N Hâ xL.
In[226]:=
ProductTwoPoissonIntegrals @4, 2D
r l coefficient integral
IN6 Hf *00 gL
`
0 0
1
1 0
8
1 1
8
2 0
12
2 1
24
2 2
12
IN5 Hf *01 gL
`
IN4 Hf *11 gL
`
Out[226]=
IN4 Hf *02 gL
`
IN3 Hf *12 gL
`
IN2 Hf *22 gL
`
Thus, I4N H f L I2N HgL = I6N I f *00 gM + 8 I5N I f *01 gM + 8 I4N I f *11 gM + 12 I4N I f *02 gM + 24 I3N I f *12 gM + 12 I2N I f *22 gM. For instance,
`
`
`
`
I3N I f *12 gM = Ùx ¹x ¹y f Hx1 , x2 , y1 , y2 L gHy1 , y2 L ΝHâ y2 L N Hâ x1 L N Hâ x2 L N Hâ y1 L.
`
`
1
`
2
`
`
`
`
`
1
MSets and MZeroSets
ì MSets: this function produces the same output as
PiStarMeetAndJoinSolve
ì MSetsEqualTwo: this function produces all solutions to
PiStarMeetAndJoinSolve containing partitions only of size two
ì MSetsGreaterEqualTwo: this function produces all solutions to
PiStarMeetAndJoinSolve containing no singletons
In[227]:=
In[228]:=
In[229]:=
[email protected]_D := PiStarMeetAndJoinSolve @listD
MSetsEqualTwo @list_D := [email protected] = PiStarMeetAndJoinSolve @listD, output<,
output = [email protected], [email protected] ž ðD Š 82< &D;
[email protected]"Number of Solutions to this Problem = " <> [email protected]@outputDDD; outputD
MSetsGreaterEqualTwo @list_D := [email protected] = PiStarMeetAndJoinSolve @listD, output<,
output = [email protected], [email protected] ž ðD > 1 &D;
[email protected]"Number of Solutions to this Problem = " <> [email protected]@outputDDD; outputD
é Input format: MSets[list], MSetsEqualTwo[list], and MSetsGreaterEqualTwo[list], where "list" is a list of positive integers that
define the set partition P* . Each argument, for example k, in the list, defines a block of size k
é Example: Consider P* = 881, 2<, 83, 4<< and compute the three MSets functions.
In[230]:=
[email protected], 2<D
pistar = 881, 2<, 83, 4<<
Number of Solutions to Meet Problem = 7
Number of Solutions to Meet and Join Problem = 6
Out[230]=
In[231]:=
8881, 4<, 82, 3<<, 881, 3<, 82, 4<<, 881<, 82, 3<, 84<<,
881<, 82, 4<, 83<<, 881, 3<, 82<, 84<<, 881, 4<, 82<, 83<<<
MSetsEqualTwo @82, 2<D
pistar = 881, 2<, 83, 4<<
Number of Solutions to Meet Problem = 7
Number of Solutions to Meet and Join Problem = 6
Number of Solutions to this Problem = 2
Out[231]=
In[232]:=
8881, 4<, 82, 3<<, 881, 3<, 82, 4<<<
MSetsGreaterEqualTwo @82, 2<D
pistar = 881, 2<, 83, 4<<
Number of Solutions to Meet Problem = 7
Number of Solutions to Meet and Join Problem = 6
Number of Solutions to this Problem = 2
Out[232]=
8881, 4<, 82, 3<<, 881, 3<, 82, 4<<<
é Example: Consider P* = 881, 2<, 83<, 84<< and compute the three Gaussian set functions.
In[233]:=
MSetsEqualTwo @82, 1, 1<D
pistar = 881, 2<, 83<, 84<<
Number of Solutions to Meet Problem = 10
Number of Solutions to Meet and Join Problem = 4
Number of Solutions to this Problem = 2
Out[233]=
8881, 4<, 82, 3<<, 881, 3<, 82, 4<<<
é Example: A case for where the cardinality of P* is odd and, therefore, one gets an empty output when executing MSetsEqualTwo.
In[234]:=
MSetsEqualTwo @82, 2, 1<D
pistar = 881, 2<, 83, 4<, 85<<
Number of Solutions to Meet Problem = 27
Number of Solutions to Meet and Join Problem = 16
Number of Solutions to this Problem = 0
Out[234]=
8<
ì MZeroSets: this function produces the same output as
PiStarMeetSolve
ì MZeroSetsEqualTwo: this function produces all solutions to
PiStarMeetSolve containing partitions only of size two
ì MZeroSetsGreaterEqualTwo: this function produces all
solutions to PiStarMeetSolve containing no singletons
In[235]:=
In[236]:=
In[237]:=
[email protected]_D := PiStarMeetSolve @listD
MZeroSetsEqualTwo @list_D := [email protected] = PiStarMeetSolve @listD, output<,
output = [email protected], [email protected] ž ðD Š 82< &D;
[email protected]"Number of Solutions to this Problem = " <> [email protected]@outputDDD; outputD
MZeroSetsGreaterEqualTwo @list_D :=
[email protected] = PiStarMeetSolve @listD, output<, output = [email protected], [email protected] ž ðD > 1 &D;
[email protected]"Number of Solutions to this Problem = " <> [email protected]@outputDDD; outputD
é Input format: MZeroSets[list], MZeroSetsEqualTwo[list], and MZeroSetsGreaterEqualTwo[list], where "list" is a list of positive
integers that define the set partition P* . Each argument, for example k, in the exist, defines a block of size k.
é Example: Consider P* = 881, 2<, 83, 4<< and compute the three MZeroSets functions.
In[238]:=
[email protected], 2<D
pistar = 881, 2<, 83, 4<<
Number of Solutions to Meet Problem = 7
Out[238]=
8881, 4<, 82, 3<<, 881, 3<, 82, 4<<, 881<, 82, 3<, 84<<,
881<, 82, 4<, 83<<, 881, 3<, 82<, 84<<, 881, 4<, 82<, 83<<, 881<, 82<, 83<, 84<<<
In[239]:=
MZeroSetsEqualTwo @82, 2<D
pistar = 881, 2<, 83, 4<<
Number of Solutions to Meet Problem = 7
Number of Solutions to this Problem = 2
Out[239]=
In[240]:=
8881, 4<, 82, 3<<, 881, 3<, 82, 4<<<
MZeroSetsGreaterEqualTwo @82, 2<D
pistar = 881, 2<, 83, 4<<
Number of Solutions to Meet Problem = 7
Number of Solutions to this Problem = 2
Out[240]=
8881, 4<, 82, 3<<, 881, 3<, 82, 4<<<
é Example: Consider P* = 881, 2<, 83<, 84<< and compute MZeroSetsEqualTwo.
In[241]:=
MZeroSetsEqualTwo @82, 1, 1<D
pistar = 881, 2<, 83<, 84<<
Number of Solutions to Meet Problem = 10
Number of Solutions to this Problem = 2
Out[241]=
8881, 4<, 82, 3<<, 881, 3<, 82, 4<<<
é Example: A case where the cardinality of P* is odd and, therefore, the output is empty when executing MZeroSetsEqualTwo.
In[242]:=
MZeroSetsEqualTwo @82, 2, 1<D
pistar = 881, 2<, 83, 4<, 85<<
Number of Solutions to Meet Problem = 27
Number of Solutions to this Problem = 0
Out[242]=
8<
Hermite Polynomials
ì Hermite-Rho: computes Hermite polynomials with a leading
coefficient of 1 and parameter Ρ ³ 0. They are orthogonal with
respect to the Gaussian distribution with mean zero and
1
2
variance Ρ. The generating function is ãt x- 2 Ρ t .
These polynomials are defined by
Hn Hx, ΡL = H- ΡLn ãx
and satisfy
2
n
‘2 Ρ â
âx n
ã-x
2
‘2 Ρ
, n ³ 0,
and satisfy
Hn Hx, ΡL = Úk=0
Pn2T
In[243]:=
n
H2 k - 1L!! H- ΡLk x n-2 k , n ³ 0, Ρ > 0.
2k
[email protected]_, x_, Ρ_ D :=
[email protected], 2 kD H2 k - 1L !! * H- ΡLk * xn-2 k , 8k, 0, [email protected]  2D<E
é Example: compute the Hermite-Rho polynomial of order 5 with a leading coefficient of 1
In[244]:=
[email protected], x, ΡD
Out[244]=
x5 - 10 x3 Ρ + 15 x Ρ2
ì HermiteRhoGrid: display the Hermite-Rho polynomials up to
order n, using a leading coefficient of 1 for each polynomial
In[245]:=
HermiteRhoGrid @n_D :=
[email protected]ð, [email protected]ð, x, ΡD<  ExpandL & ž [email protected], n, 1D, Frame ® AllD
é Example: Make a grid of the first 11 Hermite-Rho polynomials
In[246]:=
HermiteRhoGrid @10D
0
1
1
x
x2 - Ρ
2
x3
3
Out[246]=
x5 - 10 x3 Ρ + 15 x Ρ2
5
x6
6
x7
7
8
9
-3xΡ
x4 - 6 x2 Ρ + 3 Ρ2
4
x8
x9
- 15 x4 Ρ + 45 x2 Ρ2 - 15 Ρ3
- 21 x5 Ρ + 105 x3 Ρ2 - 105 x Ρ3
- 28 x6 Ρ + 210 x4 Ρ2 - 420 x2 Ρ3 + 105 Ρ4
- 36 x7 Ρ + 378 x5 Ρ2 - 1260 x3 Ρ3 + 945 x Ρ4
10 x10 - 45 x8 Ρ + 630 x6 Ρ2 - 3150 x4 Ρ3 + 4725 x2 Ρ4 - 945 Ρ5
ì Hermite: computes Hermite polynomials with a leading
coefficient of 1. These polynomials are obtained by setting
Ρ = 1 and are defined as
Hn HxL = H-1Ln ãx
In[247]:=
[email protected]_, x_D := 2-n2 HermiteHBn, x ’
2
n
‘2 â
âx n
ã-x
2 F  Expand
2
‘2
, n ³ 0.
é Example: compute the Hermite polynomial of order 5 with a leading coefficient of 1
In[248]:=
[email protected], xD  TraditionalForm
Out[248]//TraditionalForm=
x5 - 10 x3 + 15 x
ì HermiteGrid: display the Hermite polynomials up to order n,
using a leading coefficient of 1 for each polynomial
In[249]:=
HermiteGrid @n_D := [email protected]ð, [email protected]ð, xD<  ExpandL & ž [email protected], n, 1D, Frame ® AllD
é Example: Make a grid of the first 11 Hermite polynomials
In[250]:=
HermiteGrid @10D  TraditionalForm
Out[250]//TraditionalForm=
0
1
1
x
2
x2 - 1
x3 - 3 x
3
4
x - 6 x2 + 3
4
5
x - 10 x3 + 15 x
5
6
x - 15 x4 + 45 x2 - 15
6
7
x - 21 x5 + 105 x3 - 105 x
7
8
x8 - 28 x6 + 210 x4 - 420 x2 + 105
9
9
x - 36 x7 + 378 x5 - 1260 x3 + 945 x
10
10 x - 45 x8 + 630 x6 - 3150 x4 + 4725 x2 - 945
é Example: Plot H5 HxL for -5 £ x £ 5
In[251]:=
[email protected]@5, xD, 8x, - 5, 5<D
200
100
Out[251]=
-4
-2
2
-100
-200
4
é Example: Plot Hk HxL for k = 0, ..., 6 and -5 £ x £ 5
In[252]:=
[email protected]@[email protected]ð, xD & ž [email protected], 6, 1DD, 8x, - 5, 5<, PlotStyle ® 8<D
60
40
20
Out[252]=
-4
-2
2
4
-20
-40
Note: The built-in Mathematica function HermiteH[n,x] is defined as
[email protected], xD = H-1Ln ãx
2
ân
âx n
2
ã-x , n ³ 0.
One has
Hn HxL = 2-n2 HermiteHBn,
x
2
F, n ³ 0.
Poisson-Charlier Polynomials
ì Charlier: computes the Poisson-Charlier Polynomials. There
are orthogonal with respect to the Poisson distribution with
mean a.
These polynomials satisfy the orthogonality relation
-a k
a ‘ k ! = a-n n! ∆nm
Ú¥
k=0 cn Hk, aL cm Hk, aL ã
and the recursion relation
cn Hx, aL = a-1 x cn-1 Hx - 1, aL - cn-1 Hx, aL, n ³ 1, with c0 Hx, aL = 1.
In[253]:=
[email protected], x_, a_D = 1;
In[254]:=
[email protected]_, x_, a_D := ExpandAIx a-1 [email protected] - 1, x - 1, aD - [email protected] - 1, x, aDME
é Example: compute the Poisson-Charlier polynomial with n = 8
In[255]:=
[email protected]@8, x, aD, 8x, a<D  TraditionalForm
Out[255]//TraditionalForm=
x8
a
8
28
+ a
6769
a
8
-
8
a
a
13 068
a8
a
5880
+
8
a
a
a
a
70
+
5
a
4
1960
a
a4
a
a
28
+
a3
420
-
7
a
12 992
-
8
168
+
1400
-
8
13 132
a
770
+
a5
x6 + -
6
x4 + -
2800
+
a6
28
+
7
560
+
7672
+
a7
6
168
+
8
2380
+
7
14 112
+
322
x7 +
7
a
1960
-
6
a
5040
420
-
5
a
5760
-
a8
x5 +
a5
6300
-
7
x2 + -
a2
56
-
6
a7
56
-
4
3360
-
a6
a3
x3 +
1344
-
a5
420
-
a4
112
-
a3
28
-
a2
8
-
x+1
a
é Example: compute the Poisson-Charlier polynomial with n = 8 and a = 1
In[256]:=
[email protected]@8, x, 1D, xD  TraditionalForm
Out[256]//TraditionalForm=
x8 - 36 x7 + 518 x6 - 3836 x5 + 15 659 x4 - 34 860 x3 + 38 618 x2 - 16 072 x + 1
ì CharlierGrid: display the Poisson-Charlier polynomials up to
order n with Poisson mean a
é Example: make a grid of the Poisson-Charlier polynomials for 0 £ n £ 5
In[257]:=
In[258]:=
ChalierGrid @n_, a_D :=
[email protected]@8j, [email protected]@j, x, aD, 8x, a<D<, 8j, 0, n<D, Frame ® AllD
ChalierGrid @5, aD  TraditionalForm
Out[258]//TraditionalForm=
0
1
x
1
2
x3
3
x4
4
5
+ I-
x2
x5
a5
+ I-
a4
10
a5
-
+ I-
M x4 + I
4
a3
6
a4
5
35
a
a5
+
4
a3
30
a4
+ I-
a2
3
a3
Mx +I
3
+
-
11
a4
3
1
a2
-1
- Mx+1
2
Mx +I
2
a2
+
a
12
a3
M x3 + I3
10
50
a
a5
+
-
6
a2
a
2
+
a3
3
a2
+ Mx-1
M x + I-
55
a4
2
-
30
a3
-
3
a
6
a4
-
8
a3
-
M x2 + I
2
6
a2
10
24
a
a5
- Mx+1
4
a
+
30
a4
+
20
a3
+
10
a2
+ Mx-1
5
a
é Example: Plot the Poisson-Charlier polynomial with n = 5 and a = 1  2 over the interval -1 £ x £ 3
In[259]:=
[email protected]@5, x, 0.5D, 8x, - 1, 3<, PlotRange ® AllD
-1
1
2
3
-1000
-2000
-3000
Out[259]=
-4000
-5000
-6000
é Example: Plot the Poisson-Charlier polynomial with n = 5 and a = 1 over the interval -1 £ x £ 3
In[260]:=
[email protected]@5, x, 1D, 8x, - 1, 3<, PlotRange ® AllD
-1
1
2
3
-50
-100
-150
Out[260]=
-200
-250
-300
é Example: Plot the Poisson-Charlier polynomial with n = 5 and a = 2 over the interval -1 £ x £ 3
In[261]:=
[email protected]@5, x, 2D, 8x, - 1, 3<, PlotRange ® AllD
-1
1
-5
-10
Out[261]=
-15
-20
-25
2
3
é Example: Plot the Poisson-Charlier polynomials with a = 1 and 1 £ n £ 6 over the interval -1 £ x £ 1
In[262]:=
[email protected]@[email protected]ð, x, 1D & ž [email protected], 6DD, 8x, - 1, 1<, PlotStyle ® 8<D
40
20
Out[262]=
-1.0
-0.5
0.5
1.0
-20
-40
ì Charlier-Centered: computes the centered Poisson-Charlier
polynomials.
These polynomials are defined by
Cn Hx, aL = an cn Hx + a, aL, n ³ 0.
In[263]:=
CharlierCentered @0, x_, a_D = 1;
In[264]:=
CharlierCentered @n_, x_, a_D := [email protected] [email protected], x + a, aDLD
é Example: compute the centered Poisson-Charlier polynomial with n = 8
In[265]:=
CharlierCentered @8, x, aD  TraditionalForm
Out[265]//TraditionalForm=
105 a4 - 420 a3 x2 + 2100 a3 x - 2380 a3 + 210 a2 x4 - 2380 a2 x3 + 9310 a2 x2 14 532 a2 x + 7308 a2 - 28 a x6 + 532 a x5 - 3920 a x4 + 14 084 a x3 - 25 284 a x2 +
20 376 a x - 5040 a + x8 - 28 x7 + 322 x6 - 1960 x5 + 6769 x4 - 13 132 x3 + 13 068 x2 - 5040 x
é Example: compute the centered Poisson-Charlier polynomial with n = 8 and a = 1
In[266]:=
CharlierCentered @8, x, 1D  TraditionalForm
Out[266]//TraditionalForm=
x8 - 28 x7 + 294 x6 - 1428 x5 + 3059 x4 - 1428 x3 - 3326 x2 + 2904 x - 7
é Example: Plot the centered Poisson-Charlier polynomials witha = 1 and 1 £ n £ 6 over the interval -1 £ x £ 1
In[267]:=
[email protected]@CharlierCentered @ð, x, 1D & ž [email protected], 6DD, 8x, - 1, 1<, PlotRange ® AllD
20
-1.0
Out[267]=
-0.5
0.5
1.0
-20
-40
-60
ì CharlierCenteredGrid: display the centered Poisson-Charlier
polynomials up to order n
é Example: make a grid of the centered Poisson-Charlier polynomials for 0 £ n £ 5
In[268]:=
In[269]:=
ChalierCenteredGrid @n_, a_D := TraditionalForm @ð, ParameterVariables ¦ aD & ž
[email protected]@8j, [email protected] @j, x, aD, 8x, a<D<, 8j, 0, n<D, Frame ® AllD
ChalierCenteredGrid @5, aD
Out[269]//TraditionalForm=
0
1
1
x
2
x - 3 x + H2 - 3 aL x + 2 a
3
4
x2 - x - a
3
2
x4 - 6 x3 + H11 - 6 aL x2 + H14 a - 6L x + 3 a2 - 6 a
5 x5 - 10 x4 + H35 - 10 aL x3 + H50 a - 50L x2 + H15 a2 - 70 a + 24L x - 20 a2 + 24 a
Download