# Figuring how many paths there are to get to a point on a cartesian coordinate system [duplicate]

Possible Duplicate:
Counting number of moves on a grid

I have an exercise in my Computer Science class, to figure out how many paths there are from $(0,0)$ to $(x,y)$ on a cartesian coordinate system, while the only legal moves are move up and move right.

Is there a simple method to calculate the number of available paths?

-

## marked as duplicate by Austin Mohr, Micah, Davide Giraudo, Martin Argerami, martiniDec 8 '12 at 4:10

yes they are, edited. – Georgey Dec 7 '12 at 21:53
Note that ${x + y} \choose x$ = ${x + y}\choose y$ – amWhy Dec 7 '12 at 21:57
This is very similar to PE 15 (FYI)... projecteuler.net/problem=15 – apnorton Dec 7 '12 at 22:01

Yes, there is. You must go right $x$ times and up $y$ times, and you may make these $x+y$ moves in any order. Write R for a right move and U for an up move: you want the number of strings of $x$ R’s and $y$ U’s. There are $\binom{x+y}x$ ways to choose which $x$ places get the R’s, and that completely determines the string, so the answer is $\binom{x+y}x$.
Assuming $x\ge 0$ and $y\ge 0$ you will make $x+y$ moves in total and among these are $y$ moves up. That should be $x+y\choose y$.