the first player to win three games in a row or a total of four games wins. In  a   competition between players X and   Y,  the first   player  to  win three   games   in  a   row or  a   total
of  four    games   wins.
a. How  many    ways    can the competition be  played  in  total?
b. How  many    ways    can the competition be  played  if  X wins  the first   game    and Y wins  the 
second  and third   games?
 A: I don't see a really elegant way to do this.
One simplification is to calculate the ways in which X wins and multiply by 2 because when you interchange all the Xs and Ys in all the "X wins" scenarios you get all the possible "Y wins" scenarios.
X wins in 3 - XXX - 1 way 
X wins in 4 - YXXX - 1 way 
X wins in 5 - YYXXX -  XYXXX - XXYXX - 3 ways
for 6 and 7 organize yourself by considering the six possible results for the first 3 games (it must have been 2-1 after 3 games if no one wins in 3)
e.g. for X to win in 6 there are 2 scenarios starting with "XXY" but no scenarios starting with "YYX" .
For X  to win in 7 all six 3 game starts are possible leading to either 2 or 3 scenarios.
I count 7 ways for X to win in 6 and 14 ways for X to win in 7
total ways for X to win $= 14 + 7 + 3+ 1+ 1 = 26$
So there must be 52 possible ways to play out the series, of which 7 start with XYY ( using the "X wins" list count sequences starting with either XYY or YXX )
An interesting result is that given you win in exactly 7 games the conditional probability that you were 2-1 down after 3 games is exactly 50% !  
A: We shall count $A's$ wins, and multiply by $2$.
Firstly, let us list the "special" cases :
Wins due to $3$ games in a row: $WWW, LWWW,\;$ and $\;LLWWW$
Losses due to $3$ games in a row:$LLLWWWW, WLLLWWW, WWLLLWW
Now we will count the general cases, winning $4$ games, and subtract the special cases:
To win $4$ games in $5$, $A$ must win the $5th$ game, and $3$ of the previous $4$ in $\binom43 = 4$
minus $2$ special wins in $4$ games or less $=2$ ways.
To win $4$ games in $6, A$ must win the $6th$ game, and $3$ of the previous $5$
minus $3$ special wins in $5$ games or less  $= 7$ ways,
Only when $7$ games are played is there also chance of losing due to special cases.
To win $4$ games in $7, A$ must win the $7th$ game, and $3$ of the previous $6$,
thus $\binom63 - 3$ special wins - $3$ special losses $= 14$
Thus total # of ways = $2(3+2+7+14) = 52$ ways
ps:
You should now try the easier second part. 
A: Suppose four games are played and one player wins them all.  WWWW.  There are 2 ways that can happen.  (Either one player wins all four or the other player does.
Suppose five games are played and one player winning 4 and losing one.  LWWW or WLWW or WWLW.  The winner can't lose the last game (because then the winner would have already won four games and they'd never play the fifth game).  So there are three choices for the winner to lose.  That's ${3 \choose 1}$.  And then there are 2 possible winners so $2{3 \choose 1}$ 
Suppose six games are played, one player wins 4 and loses two.  There are ${4 \choose 2}$ to do this and two players. $2{4 \choose 2}$.
Suppose seven games... winner wins 4 loses 3.  $2{5 \choose 3}$.
Total; $2 + 2{3 \choose 1}+ 2{4 \choose 2} + 2{5 \choose 3}$.
