How do commercial banks create deposits? Explain

How do commercial banks create deposits? Explain.
Explain the credit creation role of commercial banks with the help of a numerical.

Commercial banks are the important source of money supply in the economy. They contribute to money supply by creating credit.
They create credit out of their total deposits which are many more times greater than their initial level of deposits.
Money creation is determined by:
(i) The amount of the initial fresh deposits.
(ii) The Legal Reserve Ratio (LRR), which is the minimum ratio of deposits legally required to be kept as cash by the banks.
Money Creation = Initial Deposits x 1/LRR
Example, let the LRR be 20%,
Fresh deposits = Rs 10000
As required, the banks keep 20% i.e. Rs 2000 as cash. Suppose the banks lend the remaining amount of Rs 8000. Those persons who borrow, use this money for making payments.
Further, it is also assumed that, persons receiving the payment will deposit the amount in the bank. This will result in banks receiving fresh deposits of Rs 8000. The banks again keep Rs 1600 as cash and lend Rs 6400, which is also 80% of the last deposit, the money again comes back to the banks leading to a fresh deposit of Rs 6400. In this way, the money goes on multiplying and ultimately, total money creation is Rs 50000.
According to the formula,
Money Creation = 10000 x 1/20% = Rs 50000