[1] The set of all n × n matrices with entries in R is a matrix ring denoted Mn(R)[2][3][4][5] (alternative notations: Matn(R)[3] and Rn×n[6]).
Over a rng, one can form matrix rngs.
When R is a commutative ring, the matrix ring Mn(R) is an associative algebra over R, and may be called a matrix algebra.
Similarly, if R is a commutative semiring, then Mn(R) is a matrix semialgebra.
For example, if R is the Boolean semiring (the two-element Boolean algebra R = {0, 1} with 1 + 1 = 1),[8] then Mn(R) is the semiring of binary relations on an n-element set with union as addition, composition of relations as multiplication, the empty relation (zero matrix) as the zero, and the identity relation (identity matrix) as the unity.