This is a binomial distribution
$$X\sim B(n,p);\ P(X=k){=}\binom{n}{k}p^k(1-p)^{n-k}$$
Where n is the number of attempts of independents events and p is the probability for success (and 1-p is the probability of fail). And k is the number of success on n attempts, P(X=k) is the probability for k success on this variable.
In this case n=9, k=4 and p=1/8. So
$$P(X=4)=\binom{9}{4}\left(\frac{1}{8}\right)^4\left(\frac{7}{8}\right)^5\approx1.6\%$$
*$\binom{n}{k}=\frac{n!}{k!(n-k)!}=\frac{n_{(k)}}{k!}=\frac{n(n-1)(n-2)\cdot\cdot\cdot(n-k+1)}{2\cdot3\cdot4\cdot\cdot\cdot k}$