model: gambler ruin theorem.
A gambler has $i$ coins initially, in every step, he wins a coin with probability $p$, and loses a coin with probability $1-p$. The expected time that he loses all his coins or wins $n-i$ coins (thus he has $n$ coins totally) is as following: $$E(i)=-\frac{n}{1-2p}\frac{(\frac{1-p}{p})^i-1}{\frac{1-p}{p})^n-1}+\frac{i}{1-2p}$$ this result is from p272 of https://www.emis.de/journals/AMEN/2018/AMEN-171010.pdf
K-SAT problem
https://cstheory.stackexchange.com/questions/1196/what-is-the-k-sat-problem
Assume that there are $n$ variables in K-SAT.
I use $X=(x_i, x_2, \dots x_n)$ to denote the candidate solution of K-SAT.
$X$ is a vector of $n$ dimensions.
$x_i=1$ means the i-th variable is true, $x_i=0$ means the i-th variable is false.
The algorithm:
Apply gambler ruin theorem to analysis
Assuming there is a unique solution $X^*$, and the initial solution $X$ generated by the algorithm has the same $i$ bits with the unique solution $X^*$.
Apparently, when $i$ becomes $0$ or $n$, the algorithm will stopped, and I want to calculate the expected iterations of the algorithm before it stop.
In each iteration, the same bits can be decrease or increase by 1.
and the probability of increase by 1 is at least $p=1/k$. (Because it's k-sat, in each unsatisfied clause, there are at least one variables that doesn't match $X^*$)
The number of same bits between $X^*$ and$X$ incrases by 1, corresponding to the gambler wins a coin. And decreasing by 1 corresponding to the gambler lose a coin.
Thus I think I can use $$E(i)=-\frac{n}{1-2p}\frac{(\frac{1-p}{p})^i-1}{\frac{1-p}{p})^n-1}+\frac{i}{1-2p}$$ to calculate the expected runtime.
but the expected run time is O(n), which is impossible for k-sat problem.
My question is , where am i wrong?