For $R$ a ring and $S$ a set, the set of functions$S \to R$ (to the underlying set of $R$) is itself naturally an associative algebra over $R$, where addition and multiplication is given pointwise in $S$ by addition and multiplication in $R$: for $f_1, f_2 \colon S \to R$ their sum is the function

$(f_1 + f_2) \colon s \mapsto f_1(s) + f_2(s) \in R
\,,$

their product is the function

$(f_1 \cdot f_2) \colon s \mapsto f_1(s) f_2(s) \in R$

and the ring inclusion $R \to [S,R]$ is given by sending $r \in R$ to the constant function with value $r$.

If $S$ is a finite set or else if one restricts to functions that are non-vanishing only for finitely many elements in $S$, then the algebra of functions with values in $R$ also forms the free module over $R$ generated by $S$.