knitr::opts_chunk$set(echo = TRUE)

Noncommutative multivariate polynomials

We consider multivariate polynomials with non-commuting indeterminates, as in the freealg package. For example:

library("freealg")
p <- as.freealg("1+x+y")
p^2

See how terms xy and yx are retained: variables are not assumed to commute. We can follow Haiman (1993) and consider the expression [ E(p)=\left(x+y+x^{-1}+y^{-1}\right)^p,\qquad{p\geqslant 0} ]

On the understanding that the variables do not commute, Haiman asks what the constant term of $E(p)$ is. The package answers that easily (package idiom for $x^{-1}$ is uppercase X):

f <- function(p){constant(as.freealg("x+y+X+Y")^p)}
sapply(0:9,f)

It's clear in hindsight that only even $p$ will have nonzero constant:

sapply(2*(0:5),f)

This is Sloane's sequence A035610, http://oeis.org/A035610. We can ask the same question but for different expressions.

g <- function(p,string){constant(as.freealg(string)^p)}
sapply(0:7,g,"1+x+y+X+Y")

This sequence is not recorded on OEIS. We might also wonder about other expressions:

sapply(0:7,g,"x+y+XY")

this is only nonzero when $p=0\mod 3$, duh:

sapply(3*(0:4),g,"x+y+XY")

again not in OEIS. Or even:

sapply(3*(0:4),g,"x+y+XY+YX")

another new sequence.



RobinHankin/freealg documentation built on Dec. 24, 2024, 3:16 a.m.