Coin betting problem. A coin bet is placed between two friends such that the person who wins four tosses first is the winner. What is total number of possible ways in which the bet can play out?
 A: Avoiding elegance, there will end up being $k$ tosses, where $k \in \{4,5,6,7\}.$  Therefore, you want $\sum_{k=4}^7 f(k)$, where $f(k)$ is the number of different coin toss sequences that result in the game ending after exactly $k$ coin tosses.
Clearly, $f(4) = \binom{4}{0} + \binom{4}{4} = 2$. 
That is, there are $\binom{4}{0}$ ways of getting zero heads and 
$\binom{4}{4}$ ways of getting 4 heads.
For a game to end after exactly 5 coin tosses, two things must happen:

*

*One of the two people must be ahead 3 to 1, after 4 coin tosses.

*That person must also win the 5th coin toss.

There are $\binom{4}{3}$ ways that exactly 3 of the 1st 4 coin tosses come up heads.  If this happens, for the game to end after exactly 5 coin tosses, with heads the winner, the 5th coin toss must also be heads.  Therefore, there are $4$ coin toss sequences that allow the game to end after exactly 5 coin tosses, with heads the winner.
By symmetry, there are exactly 4 coin toss sequences that allow the game to end after exactly 5 coin tosses, with tails the winner.
Therefore $f(5) = 2 \times \binom{4}{1} = 8.$
For a game to end after exactly 6 coin tosses, two things must happen.

*

*After 5 coin tosses, someone is ahead 3 to 2.

*On the 6th coin tosses, the person who was ahead also wins the 6th toss.

By arithmetic very similar to the computation of $f(5)$, you have that 
$f(6) = 2 \times \binom{5}{3} = 20.$
For the game to end on exactly 7 tosses, the game must be tied after 6 tosses, 3 to 3.  This can happen in $\binom{6}{3}$ ways.  In that event, the 7th toss might be either heads or tails.
Therefore, $f(7) = 2 \times \binom{6}{3} = 40.$
Final answer:
$$\sum_{k=4}^7 f(k) = 2 + 8 + 20 + 40 = 70.$$

Addendum 
The answer may be re-expressed as 
$$2 \times \left[\binom{3}{3} + \binom{4}{3} + \binom{5}{3} + \binom{6}{3}\right].$$
Examining Pascal's triangle, and its rule, re 
$\binom{n}{k} + \binom{n}{k+1} = \binom{n+1}{k+1},$ 
$\binom{3}{3} + \binom{4}{3} = \binom {4}{4} + \binom{4}{3} = \binom{5}{4}.$
Then, 
$\binom{5}{4} + \binom{5}{3} = \binom{6}{4}.$
Then, 
$\binom{6}{4} + \binom{6}{3} = \binom{7}{4}.$

Addendum-1
As the other responses indicate, it is not a coincidence that the computation yields $2 \times \binom{7}{4}.$
Originally, I wasn't able to grasp the analysis.  Then it hit me.
It is true that you can't simply assume that the contest will go 7 coin flips, since for example, you will never have one person getting 5 heads out of 7.  That is, the contest ends before the person can get the 5th head.
However: assume that the person flipping heads wins.  There is a bijection between each of the winning sequences (which will be of length 4,5,6, or 7) and all the possible ways that exactly 4 of the 7 coin tosses come up heads [i.e. $\binom{7}{4}$].
To see this, pretend that if the game finishes after $k$ coin tosses, with Heads the winner and $k < 7$, then the coin toss sequence is continued with exactly $(7 - k)$ trailing tails.  Assuming that the total number of Heads remains constant at 4, there is only 1 such continuation possible, since the remaining $(7 - k)$ pretended coin tosses must all be tails.
Because of this bijection, the number of sequences with Heads the winner must equal $\binom{7}{4}.$
A: I believe this is just 7 choose 4, or $\frac{7!}{4!3!}=35$. As Greg said, depending on exactly what you mean by "different ways the bet can play out", you might want to double that.
