rfalg.RdGenerate random elements of the free algebra, intended as quick
“get you going” examples of freealg objects
rfalg(n=7, distinct=3, maxsize=4, include.negative=FALSE)
rfalgg(n=30, distinct=8, maxsize=7, include.negative=FALSE)
rfalggg(n=100, distinct=26, maxsize=30, include.negative=FALSE)Number of terms to generate
Number of distinct symbols to use
Maximum number of symbols in any word
Boolean, with default FALSE meaning to
use only positive symbols (lower-case letters) and TRUE
meaning to use upper-case letters as well, corresponding to the
inverse of the lower-case symbols
Terms are automatically simplified; for example,
aaBaAbaC will be simplified to aaaC.
Functions rfalgg() and rfalggg() return successively
more complicated freealg objects.
rfalg()
#> free algebra element algebraically equal to
#> + 5acab + 6bb + bbaa + 2bca + 4bcab + 3cbcb + 7ccb
rfalg(include.negative = TRUE)^2
#> free algebra element algebraically equal to
#> + 9 + 24CbA + 16CbACbA + 20CbABAbC + 4CbAA + 28CbAbc + 24CbAc + 8CbcAA + 30BAb
#> + 30BAbC + 20BAbCCbA + 25BAbCBAbC + 5BAbCA + 10BAbCacAA + 35BAbCbc + 6A + 4ACbA
#> + 5ABAbC + AA + 7Abc + 6Ac + 12acAA + 8acAACbA + 10acAABAbC + 2acAAA + 14acAAbc
#> + 12acAAc + 4acAcAA + 24bA + 28bbA + 42bc + 35bcBAbC + 7bcA + 14bcacAA + 49bcbc
#> + 42bcc + 36c + 30cBAbC + 6cA + 2cAA + 12cacAA + 42cbc + 36cc
constant(rfalg())
#> [1] 0