  In this paper we study algebraic and asymptotic properties of generating sets
of algebras over orders in number fields. Let $A$ be an associative algebra
over an order $R$ in an algebraic number field. We assume that $A$ is a free
$R$-module of finite rank. We develop a technique to compute the smallest
number of generators of $A$. For example, we prove that the ring
$M_3(\mathbb{Z})^{k}$ admits two generators if and only if $k\leq 768$. For a
given positive integer $m$, we define the density of the set of all ordered
$m$-tuples of elements of $A$ which generate it as an $R$-algebra. We express
this density as a certain infinite product over the maximal ideals of $R$, and
we interpret the resulting formula probabilistically. For example, we show that
the probability that 2 random $3\times 3$ matrices generate the ring
$M_3(\mathbb{Z})$ is equal to $(\zeta(2)^2 \zeta(3))^{-1}$, where $\zeta$ is
the Riemann zeta-function.
