The pmf of geometric distribution is given by $p(1-p)^{x-1}$.
I want to generate the samples for a random variable which has geometric distribution.
So, the formula I found is $X=F^{-1}(u)$ where $F$ is the cdf of geometric distribution.
Is it possible to find the mathematical expression for $F^{-1}(u)$ so that by I can easily calculate the sample.
Yes, very simple.
Start from the fact that
$$F_X(x)=1-(1-p)^x$$