What is the probability that exactly 7 of the first 10 coin tosses are heads?

A biased coin is tossed infinitely many times and has probability $p$ of being "heads". What is the probability that exactly $7$ of the first $10$ coin tosses are "heads", in terms of $p$?

It's a homework.

What I thought it was the answer:

$p =$ probability of being heads
$(1-p)$ = probability of being tails

So $p$ must happen seven times so: $p^7$, and $(1-p)$ must happen $3$ times, so: $(1-p)^3$. That way the final answer, in my mind, should be $p^7(1-p)^3$ But it is not.

Could someone help me?

• The "infinitely many times" piece of information is completely irrelevant to the question at hand. – barak manos Mar 5 '15 at 18:37
• You only calculated the probability to have 7 heads and 3 tails in one order. You need to multiply this by the number of different possible sequences you can get – Tryss Mar 5 '15 at 18:39

Choose $7$ out of $10$ results to be heads, and $3$ out of the remaining $3$ results to be tails.
$$\binom{10}{7}\cdot(p^7)\cdot\binom{3}{3}\cdot(1-p)^3=120\cdot(p^7)\cdot(1-p)^3$$
If you would ask: "what is the probability that the first $7$ tosses are heads and the others are tails?" then $p^7(1-p)^3$ would be the correct answer. However there are more possibilities. E.g. you could have that you start with $3$ tails and end with $7$ heads. Also this event has probability $p^7(1-p)^3$. Now the question rises: how many of these possibilities (all ending up in exactly $7$ tails) are there? The answer to that question is: $\binom{10}{7}$ (the number of ways that you can pick $7$ out of $10$). All these events are disjoint and all have probability $p^7(1-p)^3$. So the final answer is $$\binom{10}{7}p^7(1-p)^3$$