Conditional probablity with tree diagram Could someone tell me if I got this right?

So I drew a tree diagram

Sorry if it is too messy, but i had to do this on PaintBrush.
(a) I just added all the branches $\mathbb{P}(S_4 = 17) = 0.6 \times 0.4+0.4\times0.4=0.4$ 
(b)This one is a bit tricky, so basically I have $\mathbb{P}(S_4=17 | S_5=18)$ and forget about the equal sign and the numbers for now. So $\mathbb{P}(S_4 | S_5)= \dfrac{\mathbb{P}(S_4 \cap S_5)}{\mathbb{P}(S_5)} = \dfrac{\mathbb{P}(S_5|S_4)\mathbb{P}(S_4)}{\mathbb{P}(S_5)} = \dfrac{(0.6 + 0.4)\times 0.4}{0.336} = 1.19$
Which makes no sense for (b) because it is over 1...
Thank you
 A: each day you two things can happen. either the price goes up or down. There are two ways that the probability $S_4=17$ when $S_2=17$ Either the price goes up the first day and down the second. or it goes down the first and up the second. Since it went up the first day, the probability of the stock going up the third day is .6 and the probability of going down the fourth is .4 . The probability for the second method is.4 the third day and .4 the fourth.
Therefore the probability that $S_4=17$ on the fourth day is $.6*.4 + .4*.4$ = .10*.4=40%$
What you did is correct. 
The answer you where looking for is correct. However as Andrè Nicolas pointed out, Your drawing doesn't add up. However, the result is still right.
Now, for part b, If the stock price on day 5 was 18. What is the probability the price on day 4 was 17? You need to take into account only the paths that take to $S_5=18$. How many ways are there for this to happen. The following: (-1,1,1),(1,-1,1),(1,1,-1). Lets take a look at the probability of each one. the first one is:$.4*.4*.6$ the second one is:$.6*.4*.4$ and the thirs one is:$.6*.6*.4$ both the first and the second satisfy the condition. Therefore, the probability is $$\frac{2/5*2/5*3/5*2}{3/5*3/5*2/5+2/5*2/5*3/5*2}$$ Which is equal to $$\frac {24/125} {42/125}=24/42=4/7 =0.\overline{571428}$$
A: You need to compute $\Pr((S_5=18)\cap (S_4=17))$ correctly, compute $\Pr(S_5=18)$, and divide. 
For the numerator, multiply probabilities along all paths to $18$ that have $17$ the previous day, and add.  
For the denominator, multiply probabilities along all paths that end up ay $18$, and add.  After all, your conditional probability tells you that your sample space  is being restricted to paths that end at $18$. 
Renmark: It is not clear from the diagram what transition probabilities you used. But at least one entry is wrong. Look at the path that goes $17$, $16$, $17$, $18$. For the $17$ to $18$ part, you put what looks like $0.4$ for that transition. But the day before we went from $16$ to $17$, so the probability of $17$ to $18$ the next day is $0.6$.
