The prince want to meet the princess , but
**
"Not everything is easy"
**
.

The prince must go throught $5\times 5$ grid , the prince is at the point $(0,0)$ , the princess is at the point $(5,5)$

The prince can go only $up$ and $right$

where there are $3$ dangerous points ,

At $(2,2)$ there is a mud pool , at $(3,3)$ there is a snake , at $(4,4)$ there is a mine .

**
Safe path
**
is a way that the prince can go in , without passing throught any dangerous point.

What is the number of
**
SAFE PATHS
**
(going only
$up$
and
$right$
)

The answer is 48.

**
This section requires Javascript.
**

You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.

The number of paths from $(0,0)$ to $(m,n)$ moving only up or right is ${m+n \choose m}$ (you have to move a total of $m+n$ times, you pick $m$ times to move right). Furthermore, the number of paths that go through a specific point $(a,b)$ on the way to $(m,n)$ is simply $[\text{paths from }(0,0)\text{ to } (a,b)]\cdot[\text{paths from }(a,b)\text{ to } (m,n)]$ .

We now use the principle of inclusion-exclusion $\text{Safe paths} = \text{Total paths} - \text{Paths through one trap} + \text{Paths through two traps} - \text{Paths through three traps}$ Let $T_1$ , $T_2$ and $T_3$ denote the three traps. $\begin{aligned} \text{Safe paths} &= {10\choose 5} = 252 \\ \text{Paths through one trap} &= \text{Paths through }T_1 + \text{Paths through }T_2 + \text{Paths through }T_3\\ &= {4 \choose 2}{6 \choose 3} + {6 \choose 3}{4 \choose 2} + {8 \choose 4}{2 \choose 1} \\ &= 6\cdot 20 + 20\cdot 6 + 70\cdot 2 = 380 \\ \text{Paths through two traps} &= \text{Paths through }T_1 \text{ and } T_2 + \text{Paths through }T_1 \text{ and } T_3 + \text{Paths through }T_2 \text{ and } T_3 \\ &= {4 \choose 2}{2 \choose 1}{4 \choose 2} + {4 \choose 2}{4 \choose 2}{2 \choose 1} + {6 \choose 3}{2 \choose 1}{2 \choose 1} \\ &= 6\cdot 2\cdot 6 + 6\cdot 6\cdot 2 + 20\cdot 2\cdot 2 = 224 \\ \text{Paths through three traps} &= \text{Paths through }T_1 \text{ and } T_2 \text{ and } T_3 \\ &= {4 \choose 2}{2 \choose 1}{2 \choose 1}{2 \choose 1} \\ &= 6\cdot 2\cdot 2 \cdot 2 = 48 \end{aligned}$

Thus, we have $\text{Safe paths} = 252 - 380 + 224 - 48 = \boxed{48}$