Write the likelihood function that corresponds to the geometric distribution. You can find this function in most advanced statistics textbook (or, if you are like most statisticians, you have already memorized it). In case you do not have access to the likelihood function for the geometric distribution, it is: L(p) = p^n(1-p)^sigma(xi-n), where "p" is the parameter of the geometric distribution, "xi" is a given value of the function (0 or 1), "n" is the number of trials and "sigma" is the sigma function, which sums whatever is inside it.
Take the natural log of the likelihood function for the geometric distribution. The log function helps you in removing exponents from the likelihood distribution. After taking the natural log, you will yield the equation log(L(p)) = nlog(p) + (sigma(xi) -- n)log(1--p).
Take the derivative of this function with respect to p. Use the normal calculus rules for differentiation. The result is (n/p) -- (sigma(xi) -- n)/(1-p).
Set the derivative to zero, forming an equation. The equation then is (n/p) -- (sigma(xi) -- n)/(1-p) = 0.
Solve for p using normal algebra rules. Getting p on one side shows that p = n/sigma(xi).
Simplify for p. Notice that n/sigma(xi) is the same as the inverse of the mean. That is p = mean(x)^-1.
Estimate the parameter of the geometric distribution using your data. Plug in the mean of your data for "mean(x)" and find the number for the parameter by inverting it. That is, if your mean is 2, then p = 1/2.