I'm doing my hw, there is a question that I am not sure if I'm correct.
Here is the question
A fair coin is thrown repeatedly.
What is the probability that on the $n$ th throw, the numbers of heads and tails to date are equal?
My answer is as follows:
$ \mathrm{The\ required\ situation\ holds\ only\ when} \ n\ \mathrm{is\ even.}\\
\mathrm{Let}\ n=2k,\ \mathrm{then\ the\ required\ probability} = {2k \choose k} \left( \frac{1}{2} \right)^{k} \left( \frac{1}{2} \right)^{k} = {2k \choose k} \left( \frac{1}{2} \right)^{2k}
\\
\mathrm{And\ I \ searched\ this\ question\ online\ and\ found\ that\ someone\ said\ that\ the \ probability\ is} \left( \frac{n}{2} \right)\left( \frac{1}{2} \right)^{n} $
Here is the link: https://www.algebra.com/algebra/homework/Probability-and-statistics/Probability-and-statistics.faq.question.779221.html
I also tried to expand ${2k \choose k}$ but failed to get the expression $\left( \frac{n}{2} \right)$
May I know whether I am correct or where did I do it wrongly, thanks.
The linked answer is wrong even for $n=2$. For $n=2$ we have $HT$ and $TH$ as the only possible winning paths, so the answer is $\frac 12$. But $\frac 22\times \left( \frac 12\right)^2=\frac 14$.
Worth noting that the answer you provide correctly gives $$\binom 21\times \left( \frac 12\right)^2=\frac 12$$
Indeed, your answer is correct for all (even) $n$.