cBracelets {Necklaces}R Documentation

Elements in a bracelet

Description

The function generates the elements of a bracelet in equivalence relation with the vector given in input.

Usage

cBracelets(v=c(), bOut=FALSE)

Arguments

v

vector: input vector

bOut

boolean: if TRUE, the function produces a compact result

Details

The function generates the elements of a bracelet which are in equivalence relation with the vector given in input. The first parameter is the input vector. If the second parameter (bOut) is set equal to TRUE, the function produces a compact result.

Example: cBracelets(c(1,0,2,1)) produces the following result:

[1] 0 1 1 2
[1] 0 2 1 1
[1] 1 0 2 1
[1] 1 1 0 2
[1] 1 1 2 0
[1] 1 2 0 1
[1] 2 0 1 1
[1] 2 1 1 0

cBracelets(c(1,0,2,1),TRUE) produces the following result:

[ 0 1 1 2 ] ( 1 )
[ 0 2 1 1 ] ( 2 )
[ 1 0 2 1 ] ( 3 )
[ 1 1 0 2 ] ( 4 )
[ 1 1 2 0 ] ( 5 )
[ 1 2 0 1 ] ( 6 )
[ 2 0 1 1 ] ( 7 )
[ 2 1 1 0 ] ( 8 )

Note that 0 1 1 2 is the representative of the class, that is the minimum in lexicographical order.

Value

list

the list containing all the elements of the bracelet in equivalence relation with the vector given in input

Note

The function is called from the fBracelets function in the Necklaces package.

Author(s)

Elvira Di Nardo elvira.dinardo@unito.it,
Giuseppe Guarino giuseppe.guarino@rete.basilicata.it

References

Di Nardo, E., and Guarino., G. (2022) kStatistics: Unbiased Estimates of Joint Cumulant Products from the Multivariate Faa Di Bruno's Formula. The R journal - In press. (https://arxiv.org/abs/2206.15348)

Di Nardo, E., and Guarino., G. (2022) Necklaces and bracelets in R - (https://arxiv.org/abs/2208.06855)

Flajolet, P., and Sedgewick, R. (2009) Analytic combinatorics. Cambridge University press.

See Also

fBracelets

Examples

# Generate the elements of the bracelet in equivalence relation with 
# the input vector (1,0,2,1) 
cBracelets(c(1,0,2,1)) 

# The previous result in a compact form
cBracelets(c(1,0,2,1),TRUE) 


[Package Necklaces version 1.0 Index]