To calculate the probability of getting 4 heads in 6 tosses of a fair coin, we use the binomial distribution formula:
\[
P(X = k) = \binom{n}{k} p^k (1 - p)^{n - k}
\]
Where:
- \( n = 6 \) is the number of tosses,
- \( k = 4 \) is the number of heads,
- \( p = \frac{1}{2} \) is the probability of getting heads in one toss,
- \( \binom{n}{k} \) is the binomial coefficient, which represents the number of ways to choose \( k \) heads from \( n \) tosses.
Now, calculate the binomial coefficient:
\[
\binom{6}{4} = \frac{6!}{4!(6-4)!} = \frac{6 \times 5}{2 \times 1} = 15
\]
So, the probability is:
\[
P(X = 4) = \binom{6}{4} \left( \frac{1}{2} \right)^4 \left( \frac{1}{2} \right)^{6-4}
\]
\[
P(X = 4) = 15 \times \left( \frac{1}{2} \right)^6 = 15 \times \frac{1}{64} = \frac{15}{64}
\]
Conclusion:
The probability of getting 4 heads in 6 tosses of a fair coin is \( \frac{15}{64} \).