freealg-package.Rd
The free algebra in R with non-commuting indeterminates. Uses 'disordR' discipline (Hankin, 2022, <doi:10.48550/ARXIV.2210.03856>). To cite the package in publications please use Hankin (2022) <doi:10.48550/ARXIV.2211.04002>.
The DESCRIPTION file:
This package was not yet installed at build time.
Index: This package was not yet installed at build time.
a <- as.freealg("x+xyx")
b <- as.freealg("4x +XyX") # upper-case interpreted as inverse
a+b
#> free algebra element algebraically equal to
#> + XyX + 5x + xyx
stopifnot(a+b==b+a) # should be TRUE
a*b ==b*a # FALSE; noncommutative algebra
#> [1] FALSE
as.freealg("1+X+xy")^3
#> free algebra element algebraically equal to
#> + 1 + 3X + 3XX + XXX + Xy + 3xy + 3xyX + xyXX + 3xyxy + xyxyX + xyxyxy + xyy +
#> 3y + yX + yxy
rfalg()
#> free algebra element algebraically equal to
#> + 7ab + 4abab + 6abb + 2b + ba + 3caab + 5ccca
rfalg()^2
#> free algebra element algebraically equal to
#> + 9aa + 3aac + 15ab + 6abc + 12abcba + 39ac + 3aca + acac + 5acb + 2acbc +
#> 4acbcba + 13acc + 15ba + 5bac + 25bb + 10bbc + 20bbcba + 65bc + 6bca + 2bcac +
#> 10bcb + 12bcbaa + 4bcbaac + 20bcbab + 8bcbabc + 16bcbabcba + 52bcbac + 4bcbc +
#> 8bcbcba + 26bcc + 39ca + 13cac + 65cb + 26cbc + 52cbcba + 169cc