Suppose we keep tossing a coin until we see $4$ heads, and suppose that the probability of seeing a head on each toss is an unknown value $p$. If we actually perform this experiment and get the fourth head on the $10$th toss, what is the value of $p$ that maximizes the chance of what we obtained? (that is, find $p$ that maximizes $P[X = 10]$ where $X$ is the total number of attempts.)
My attempt:
We can write $P[X=10] = \sum \binom{X}{k} p^k (1-p)^{10-k}$
Buy how to continue from here to find $p$?
If you get the fourth head on the $10$th toss this means that there were exactly $3$ heads in the first $9$ tosses. So $$ P(X=10)=\binom{9}{3}p^4(1-p)^6 \quad 0\leq p\le1 $$ The goal is to maximize this probability (note that is a function of $p$ and can be maximized using calculus for example).