# Finding the probability function for the given experiment

• Let $X$ be the number of heads minus the number of tails obtained in $n$ independent tosses of a fair coin.
• Find a formula for its probability function and one for its distribution function.

I have problem with building the experiment and the outcomes. Can you please help me ?.

If you have $k$ heads where $k=0,\ldots,n$ (which occurs with probability $\binom{n}{k} p^k (1-p)^{n-k}$ where $p=1/2$ is the probability of each coin being heads, $p^k$ being the probability of $k$ heads, $(1-p)^{n-k}$ being the tails and $\binom{n}{k}$ being due to the positioning of the heads; see binomial distribution) then you have $n-k$ tails. So, the number of heads minus tails is always $2k-n$. Thus, $P(X=2k-n) = \binom{n}{k} p^k (1-p)^{n-k}$ for $k=0,\ldots,n$.