8.14 Non-Associative Algebras and Modelling Genetic Laws

Many algebraic structures of mathematics and FriCAS have a multiplication operation * that satisfies the associativity law associativity law a*(b*c)=(a*b)*c for all a, b and c. The octonions are a well known exception. There are many other interesting non-associative structures, such as the class of Lie algebra Lie algebras.Two FriCAS implementations of Lie algebras are LieSquareMatrix and FreeNilpotentLie. Lie algebras can be used, for example, to analyse Lie symmetry algebras of symmetry partial differential differential equation:partial equations. partial differential equation In this section we show a different application of non-associative algebras, non-associative algebra the modelling of genetic laws. algebra:non-associative

The FriCAS library contains several constructors for creating non-associative structures, ranging from the categories Monad, NonAssociativeRng, and FramedNonAssociativeAlgebra, to the domains AlgebraGivenByStructuralConstants and GenericNonAssociativeAlgebra. Furthermore, the package AlgebraPackage provides operations for analysing the structure of such algebras. The interested reader can learn more about these aspects of the FriCAS library from the paper Computations in Algebras of Finite Rank, by Johannes Grabmeier and Robert Wisbauer, Technical Report, IBM Heidelberg Scientific Center, 1992.

Mendel’s genetic laws are often written in a form like


The implementation of general algebras in FriCAS allows us to Mendel’s genetic laws use this as the definition for multiplication in an algebra. genetics Hence, it is possible to study questions of genetic inheritance using FriCAS. To demonstrate this more precisely, we discuss one example from a monograph of A. Wörz-Busekros, where you can also find a general setting of this theory. Wörz-Busekros, A., Algebras in Genetics, Springer Lectures Notes in Biomathematics 36, Berlin e.a. (1980). In particular, see example 1.3.

We assume that there is an infinitely large random mating population. Random mating of two gametes ai and aj gives zygotes zygote , which produce new gametes. gamete In classical Mendelian segregation we have aiaj=12ai+12aj. In general, we have


The segregation rates γi,j are the structural constants of an n-dimensional algebra. This is provided in FriCAS by the constructor AlgebraGivenByStructuralConstants (abbreviation ALGSC).

Consider two coupled autosomal loci with alleles A, a, B, and b, building four different gametes a1=AB,a2=Ab,a3=aB, and a4=ab { a1:=AB,a2:=Ab,a3:=aB, and a4:=ab}. The zygotes produce gametes ai and aj with classical Mendelian segregation. Zygote a1a4 undergoes transition to a2a3 and vice versa with probability 0≤θ≤12.

Define a list of four four-by-four matrices giving the segregation rates. We use the value 1/10 for θ.

segregationRates : List SquareMatrix(4,FRAC INT) := [matrix [ [1, 1/2,

1/2, 9/20], [1/2, 0, 1/20, 0], [1/2, 1/20, 0, 0], [9/20, 0, 0, 0] ], matrix [ [0, 1/2, 0, 1/20], [1/2, 1, 9/20, 1/2], [0, 9/20, 0, 0], [1/20, 1/2, 0, 0] ], matrix [ [0, 0, 1/2, 1/20], [0, 0, 9/20, 0], [1/2, 9/20, 1, 1/2], [1/20, 0, 1/2, 0] ], matrix [ [0, 0, 0, 9/20], [0, 0, 1/20, 1/2], [0, 1/20, 0, 1/2], [9/20, 1/2, 1/2, 1] ] ]


Type: List SquareMatrix(4,Fraction Integer)

Choose the appropriate symbols for the basis of gametes,

gametes := ['AB,'Ab,'aB,'ab]

Type: List OrderedVariableList [AB,Ab,aB,ab]

Define the algebra.

A := ALGSC(FRAC INT, 4, gametes, segregationRates)

Type: Domain

What are the probabilities for zygote a1a4 to produce the different gametes?

a := basis()$A

Type: Vector AlgebraGivenByStructuralConstants(Fraction Integer,4,[AB,Ab,aB,ab], [MATRIX,MATRIX,MATRIX,MATRIX])


Type: AlgebraGivenByStructuralConstants(Fraction Integer,4,[AB,Ab,aB,ab], [MATRIX,MATRIX,MATRIX,MATRIX])

Elements in this algebra whose coefficients sum to one play a distinguished role. They represent a population with the distribution of gametes reflected by the coefficients with respect to the basis of gametes.

Random mating of different populations x and y is described by their product x*y.

This product is commutative only if the gametes are not sex-dependent, as in our example.


Type: Boolean

In general, it is not associative.


Type: Boolean

Random mating within a population x is described by x*x. The next generation is (x*x)*(x*x).

Use decimal numbers to compare the distributions more easily.

x : ALGSC(DECIMAL, 4, gametes, segregationRates) := convert [3/10, 1/5,

1/10, 2/5]


Type: AlgebraGivenByStructuralConstants(DecimalExpansion,4,[AB,Ab,aB,ab], [MATRIX,MATRIX,MATRIX,MATRIX])

To compute directly the gametic distribution in the fifth generation, we use plenaryPower.


Type: AlgebraGivenByStructuralConstants(DecimalExpansion,4,[AB,Ab,aB,ab], [MATRIX,MATRIX,MATRIX,MATRIX])

We now ask two questions: Does this distribution converge to an equilibrium state? What are the distributions that are stable?

This is an invariant of the algebra and it is used to answer the first question. The new indeterminates describe a symbolic distribution.

q := leftRankPolynomial()$GCNAALG(FRAC INT, 4, gametes,

segregationRates) :: UP(Y, POLY FRAC INT)


Type: UnivariatePolynomial(Y,Polynomial Fraction Integer)

Because the coefficient 920 has absolute value less than 1, all distributions do converge, by a theorem of this theory.

factor(q :: POLY FRAC INT)

Type: Factored Polynomial Fraction Integer

The second question is answered by searching for idempotents in the algebra.

cI := conditionsForIdempotents()$GCNAALG(FRAC INT, 4, gametes,



Type: List Polynomial Fraction Integer

Solve these equations and look at the first solution.

gbs:= groebnerFactorize cI

Type: List List Polynomial Fraction Integer


Type: List Polynomial Fraction Integer

Further analysis using the package PolynomialIdeals shows that there is a two-dimensional variety of equilibrium states and all other solutions are contained in it.

Choose one equilibrium state by setting two indeterminates to concrete values.

sol := solve concat(gbs.1,[%x1-1/10,%x2-1/10])

Type: List List Equation Fraction Polynomial Integer

e : A := represents reverse (map(rhs, sol.1) :: List FRAC INT)

Type: AlgebraGivenByStructuralConstants(Fraction Integer,4,[AB,Ab,aB,ab], [MATRIX,MATRIX,MATRIX,MATRIX])

Verify the result.


Type: AlgebraGivenByStructuralConstants(Fraction Integer,4,[AB,Ab,aB,ab], [MATRIX,MATRIX,MATRIX,MATRIX])