TITLE: Rank versus free-rank of a module
QUESTION [6 upvotes]: Suppose $M$ is a finitely generated left module over a ring $R.$ 
We define the rank of $M$ as the minimal number of generators of $M.$ 
If in addition $M$ is free, then we define the free-rank of $M$ as minimal cardinality of a basis of $M.$ 
It is clear that $\text{rank}(M)\leq\text{free-rank}(M)$. 

I want to know an example when $\text{rank}(M)<\text{free-rank}(M)$. 

If $R$ is commutative, then they are equal; so $R$ must be non-commutative.

REPLY [7 votes]: There are abelian groups $A$ such that $A\cong A\oplus A \oplus A$ but $A\not\cong A\oplus A$.
Let $E=\operatorname{End}(A)$. The functor $F=\operatorname{Hom}(A,-)$ is an equivalence from the category of finite direct sums of copies of $A$ to the category of finitely generated free $E$-modules.
So $E\oplus E$ is a module with free rank $2$ but is a direct summand of $E\cong E\oplus E\oplus E$, and so has rank $1$.
For an example where the ring has the IBN property:
For any $n>2$ there is an abelian group $A_n$ such that $A_n^n\cong A_n$ but $A_n^k\not\cong A_n$ for $1<k<n$. Let $E_n=\operatorname{End}(A_n)$ and $E=\prod_{n>2}E_n$.
Then $E^2$ has free rank $2$ but rank $1$.