countP {kStatistics} | R Documentation |
Multiplicity of a multi-index partition.
Description
The function computes the multiplicity of a multi-index partition. Note that a multi-index partition corresponds to a subdivision of a multiset having the input multi-index as multiplicities.
Usage
countP( v=c(1) )
Arguments
v |
vector or list |
Details
Consider the partitions of an integer, let's say 3, that are [1,1,1],[1,2],[3]
such that
1+1+1=1+2=3
. Consider the partitions of a set with cardinality 3, let's say [a1, a2, a3]
(I) | [[a1], [a2], [a3]], [[a1],[a2,a3]], [[a2],[a1,a3]], [[a3],[a1,a2]], [[a1,a2,a3]] . |
The multiplicity of a partition of 3 is the number of partitions of [a1, a2, a3]
in blocks having that
partition as cardinalities. In the example, we have
a) | 1 partition in 3 blocks of cardinalities 1, that is
[[a1], [a2], [a3]] corresponding to [1,1,1] |
b) | 1 partition in 1 block of cardinalities 3, that is
[[a1,a2,a3]] corresponding to [3] |
c) | 3 partitions in 2 blocks of cardinalities 1 and 2 respectively, that is |
[[a1],[a2,a3]], [[a2],[a1,a3]], [[a3],[a1,a2]] . |
So running countP(c(1,2))
we get 3, running countP(c(1,1,1))
or countP(c(3))
we get 1.
The same device can be used to find the multiplicity of a subdivision. The subdivisions of a multiset are
obtained as follows: assume all distinct the elements of the multiset, determine all the corresponding set partitions
and then replace each element in each block with the original one. For example, consider the multiset [a, a, a]
having the integer 3 as multiplicity. Assuming all distinct the elements of the multiset, the partitions of [a1, a2, a3]
are given in (I)
. Now replace a1<-a, a2<-a, a3<-a
and get
[[a], [a], [a]], [[a], [a,a]], [[a], [a,a]], [[a], [a,a]], [[a,a,a]] |
. Note that the partitions
[[a1,a2], [a3]], [[a1,a3], [a2]], [[a2,a3], [a1]] |
give rise to the same subdivision [[a,a], [a]]
. Then the multiplicity of [[a,a], [a]]
is 3. Therefore
the subdivisions of [a, a, a,]
are
[[a], [a], [a]], [[a], [a,a]], [[a,a,a]] . |
The multiplicity of the subdivision [[a], [a,a]]
is 3, as for the partition [1,2]
of the integer 3.
The multiplicity of the subdivisions [[a], [a], [a]]
and [[a,a,a]]
is 1, as for the partitions
[1,1,1]
and [3]
of the integer 3 respectively. Thus running countP(c(1,2))
we get 3, that is
a) | the multiplicity of the subdivision [[a,a], [a]] |
b) | the number of partitions of the set [a1, a2, a3] in two blocks, one of cardinality 1 and the other |
of cardinality 2 | |
c) | the number of partitions of the set [a1, a2, a3] corresponding to the partition [1,2] of |
the integer 3. |
Now consider the partition of a multi-index, let's say (4,2). One of the partitions of (4,2) is the matrix
(see the output of the mkmSet
function)
0 1 1 2
(II) 1 0 0 1
as 1+1+2=4
and 1+1=2
. The partition (II)
corresponds to the subdivision [[b], [a], [a], [a,a,b]]
of the multiset [a,a,a,a,b,b]
having the multi-index (4,2) as multiplicities. Indeed each column (i,j)
gives
the instances i
and j
of a
and b
in a block of the subdivision. Running countP
(list(c(0,1), c(1,0), c(1,0), c(2,1)))
we get 12. This multiplicity gives the number of partitions of the set [a1,a2,a3,
a4,b1,b2]
corresponding to the subdivision [[b], [a], [a], [a,a,b]]
after the
replacement
a1<-a, a2<-a,
a3<-a, a4<-a, b1<-b, b2<-b.
Note that the input of the countP
function does not necessarily be in lexicographic order. To find all the partitions
of a multi-index see the mkmSet
function.
Value
integer |
the multiplicity of the given item |
Note
Called by the mkmSet
and nPS
functions in the kStatistics
package.
Author(s)
Elvira Di Nardo elvira.dinardo@unito.it,
Giuseppe Guarino giuseppe.guarino@rete.basilicata.it
References
E. Di Nardo, G. Guarino, D. Senato (2008) An unifying framework for k-statistics, polykays and their generalizations. Bernoulli. 14(2), 440-468. (download from https://arxiv.org/pdf/math/0607623.pdf)
See Also
mkmSet
,
mCoeff
,
nStirling2
,
intPart
,
ff
Examples
# Return 3 which is the multiplicity of [1,2], partition of the integer 3, or
# of [[a],[a,a]], subdivision of the multiset [a,a,a]
countP(c(1,2))
# Return 15 which is the multiplicity of [4,2], partition of the integer 6, or
# of [[a,a,a,a],[a,a]], subdivision of the multiset [a,a,a,a,a,a]
countP(c(4,2))
# Return 18 which is the multiplicity of
# 0 0 1 1 2
# 1 2 0 0 0
# partition of the multi-index (4,3), or of [[b],[b,b],[a],[a],[a,a]], subdivision of
# the multiset [a,a,a,a,b,b,b]
countP( list(c(2,0), c(1,0), c(1,0), c(0,1),c(0,2)) )