2

We know that the ways to go from A to B in a $m×n$ rectangle is $\frac{(m+n)!}{m!n!}$.

then find ways to go from $A$ to $B$ just by using this formula.(shortest way)

enter image description here

My Attempt:I calculated the $4*4$ square ways there are 70 ways now we should reduce the ways that should'nt calculated.Can you help me please??

Taha Akbari
  • 3,770

3 Answers3

2

I don't think it pays to set up complicated combinatorial processes to solve this. Doing it by hand I found $N=26$ in less than a minute.

Write a $1$ next to $A$. Now successively find the numbers for the other vertices according to the following rule: The number at $x$ is the sum of the numbers at the vertex immediately to the left of $x$ (if there is such a vertex) and at the vertex immediately below $x$ (if there is such a vertex).

  • 1
    Multiple answerers arriving at $26$ suggests that you've miscopied the diagram, or the problem is misstated, or something else is different between the answer you have and the problem we're all solving. – mjqxxxx Jun 02 '16 at 14:16
  • @mjqxxxx: I think this comment is addressed at the OP. – Christian Blatter Jun 03 '16 at 07:50
1

Four edges are missing, so we have four restrictions for the path not to use one of them, and we want to count the paths that violate no restriction. There are $\binom{4+4}4=70$ ways to violate $0$ particular restrictions. There are $\binom{3+2}2+\binom{3+2}2+\binom{3+3}3+\binom{2+1}1\binom{2+2}2=10+10+20+18=58$ ways to violate $1$ particular restriction. Of the six pairs of restrictions, two can't be violated simultaneously, and the remaining four can be violated in $\binom{1+1}1+\binom{2+1}1+\binom{2+1}1+\binom{2+1}1\binom{1+1}1=14$ ways. There's no way to use three or four of the edges in one path, so that's it, and by inclusion-exclusion there are $70-58+14=26$ paths that use none of the missing edges.

joriki
  • 242,601
  • 1
    @TahaAkbari: If two people count $26$ and one counts $25$ and you claim that the answer is $38$, perhaps you should explain why you believe that. – joriki Jun 02 '16 at 14:16
  • @TahaAkbari: $1$ and $21$ are the same, $2$ and $31$ are the same -- I stopped checking at that point. I'd suggest to take a bit more care before you claim that three other people are wrong. Also, in case you intend to do this again with fewer paths, please provide them as text, not in an image, so the duplicates can be determined automatically. – joriki Jun 02 '16 at 18:27
  • Thanks for your answer but can you please explain more with a picture I can't understand it well. – Taha Akbari Jun 02 '16 at 19:23
  • @TahaAkbari: I'm not too good with pictures. As an example, take the missing edge near the centre. Its one vertex is $2$ horizontal steps and $1$ vertical step away from $A$, so there are $\binom{2+1}1$ ways to go from $A$ to that vertex. Then we use the missing edge, and then its other vertex is $2$ horizontal steps and $2$ vertical steps away from $B$, so there are $\binom{2+2}2$ ways to go from that vertex to $B$. Since we can combine any path from $A$ to the edge with any path from the edge to $B$, there are $\binom{2+1}1\binom{2+2}2$ different paths that use this missing edge. – joriki Jun 02 '16 at 20:55
  • @TahaAkbari: As another example, counting the paths that use both that edge and also the missing edge at the top right: Again there are $\binom{2+1}1$ ways to get from $A$ to the central edge. Then there are $\binom{1+1}1$ ways to get from the central edge to the top-right edge (since the endpoint of the central edge is $1$ horizontal step and $1$ vertical step away from the starting point of the top-right edge). Then there's only one way to get from the top-right edge to $B$. So there are $\binom{2+1}1\binom{1+1}1$ ways to use those two missing edges. – joriki Jun 02 '16 at 20:58
  • Ok thanks you know a lot about combinatorics Is there any book to learn it well? – Taha Akbari Jun 03 '16 at 17:20
0

You can decompose your rectangle. I note the point with coordinates, $A=(0,0)$ and $B=(4,4)$, first coordinate is horizontal. I note $N(x_1,..,x_n,\neg y_1, .., \neg y_m)$ the number of paths that go through all the $x_i$ but don't go through the $y_i$.

Since any shortest path going through $(2,0)$ or $(2,1)$ will go through $(3,1)$ or $(4,1)$, we have

$N=N((4,1)) + N((3,1),\neg (4,1)) + N(\neg (2,0),\neg (2,1))$

$N((4,1))=\frac{5!}{4!1!}=5$ according to your formula, since once we are in $(4,1)$, there is only one way to go to $B$

Since $(3,2)$ is the only one node after $(3,1)$ that is not $(4,1)$, and there are only two distinct path from $(3,2)$, we have

$N((3,1),\neg (3,1)) = N((3,2),\neg (2,2)) = N((3,2),(3,4))+N((3,2),(4,2))=2 \times \frac{4!}{3!1!}=8$.

Now, note that $N(\neg (2,0), \neg (2,1)) = N((1,1),\neg (2,1)) + N((0,2))$...

I'm a rather lazy guy, so I won't finish this, it is quit exhaustive.

I think, (by calculating the rest mentally) it is $N=25$, but you need to do the complete thing in order to be sure.

Rq : I think you can do a similar reasoning with edges instead of point, it may be faster.

Vincent
  • 2,358