2021 fryer test 4C 

Answer: (2^36) * 13. which is around 8.933 * 10^11
My Solution:

I found out that the amount of SF paths from A to B and C where you can't go through B to reach C and vice versa is 2^N where N is the number of squares. So in this case, it's 2^2 = 4. so there are 4 SF paths from A to B and C.

please ignore the '2t' above the diagram
The number of SF paths in the middle 4 squares where you can't cross C to reach D and vice versa:
A to C: 6 paths
A to D: 7 paths
B to C: 6 paths
B to D: 7 paths
The number of SF paths from S to A or B is (2^18) / 2 = 2^17. Number of SF paths from C or D to F is (2^18) / 2 = 2^17.
Amount of paths from S to F with every possible start and end point for the middle 4 squares:
A and C: (2^17) * 6 * (2^17) = (2^34) * 6
A and D: (2^17) * 7 * (2^17) = (2^34) * 7
B and C: (2^17) * 6 * (2^17) = (2^34) * 6
B and D: (2^17) * 7 * (2^17) = (2^34) * 7
total number of paths: (2^34) * 6 * 2 + (2^34) * 7 * 2 = around 4.667 * 10^11
I do not know why my answer isn't correct, please tell me where I went wrong.
 A: You are correct that the number of paths from $S$ to $A$ not using line $AB$ is $2^{17}$ and that the number of paths from $S$ to $B$ not using line $AB$ is also $2^{17}$. You are also correct that the number of paths from $A$ or $B$ to $C$ or $D$ not using $CD$ (but possibly using $AB$) is $26$.
The problem is in your asymmetric treatment of the middle four squares. Since you have allowed $AB$ to be used but not $CD$, you can't use $2^{17}$ for the count for getting from $C$ to $F$ and for getting from $D$ to $F$. In fact, you have to use $2^{18}$ for both of these counts. The reason is that you are free either to use or not use each of the last $18$ vertical segments. The vertical segment $CD$ is the $19^\text{th}$ vertical segment from the end: whether you use it or not is uniquely determined by the choices made for the last $18$ vertical segments and by whether you ended up at $C$ or $D$ at the end of your treatment of the middle four squares.
I think a symmetric treatment of $AB$ and $CD$ would simplify things. If, in your treatment of the middle four squares you didn't allow $AB$ (or $CD$) to be used, there would only be $13$ paths from $A$ or $B$ to $C$ or $D$, rather than $26$. There would then be $2^{18}$ ways of choosing whether to use each of the first $18$ vertical segments (just as for the last $18$) and whether $AB$ gets used is uniquely determined, just as argued above for $CD$.
A: The number of SF paths from $S$ to $A$ or $B$ is not $2^{18}/2$ but $2^{18}$: for each of the leftmost $18$ squares exactly one of the top and bottom edges may be used (otherwise the path cannot reach $F$), and the choice of top or bottom edge determines whether there is a vertical edge or not for the left edges of those $18$ squares (not including the $AB$ edge). By symmetry a similar situation applies for the number of SF paths from $C$ or $D$ to $F$.
Then you have shown that the number of paths from $A$ or $B$ to $C$ or $D$ not using the $AB$ or $CD$ edges is $13$. Whether the $AB$ or $CD$ edges are used is completely determined by where the paths in each part ($S-AB,AB-CD,CD-F$) end, so the answer is $13\cdot2^{36}$.
