document.write( "Question 1196699: Marvin the fly starts at (0,0). For each step, Marvin moves one unit right or one unit up. He is trying to get to the point (5,7). However, at (4,4) there is a frog that will eat him if he goes through that point. In how many ways can Marvin reach (5,7)? \n" ); document.write( "
Algebra.Com's Answer #829647 by ikleyn(52781)\"\" \"About 
You can put this solution on YOUR website!
.
\n" ); document.write( "Marvin the fly starts at (0,0). For each step, Marvin moves one unit right or one unit up.
\n" ); document.write( "He is trying to get to the point (5,7). However, at (4,4) there is a frog that will eat him
\n" ); document.write( "if he goes through that point. In how many ways can Marvin reach (5,7)?
\n" ); document.write( "~~~~~~~~~~~~~~\r
\n" ); document.write( "
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "            The idea of the solution is to calculate the number of all existing different paths\r
\n" ); document.write( "\n" ); document.write( "            from (0,0) to (5,7), and then SUBTRACT from it the number of all such different paths\r
\n" ); document.write( "\n" ); document.write( "            from (0,0) to (5,7), that go through point (4,4).\r
\n" ); document.write( "
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "
\r\n" );
document.write( "Each path from (0,0) to (5,7) on this grid can be presented as the word consisting of\r\n" );
document.write( "5+7 = 12 letters R and U; each such letter represents one move one init Right or one\r\n" );
document.write( "unit Up, respectively.\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "So, the number of all possible paths from (0,0) to (5,7) is  \"C%5B12%5D%5E5\" = \"%2812%2A11%2A10%2A9%2A8%29%2F%281%2A2%2A3%2A4%2A5%29\" = 792.\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "Next, the paths from (0,0) to (5,7) that go through point (4,4) are combinations /compositions of these partial paths:\r\n" );
document.write( "\r\n" );
document.write( "    - one from (0,0) to (4,4); the number of such paths is  \"C%5B4%2B4%5D%5E4\" = \"C%5B8%5D%5E4\" = 70;\r\n" );
document.write( "\r\n" );
document.write( "    - and the other path is from (4,4) to (5,7); the number of such paths is  \"C%5B%285-4%29%2B%287-4%29%5D%5E1\" = \"C%5B4%5D%5E1\" = 4.\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "The number of such special paths is the product 70*4 = 280.\r\n" );
document.write( "\r\n" );
document.write( "\r\n" );
document.write( "Doing in accordance with the general idea, we should SUBTRACT 280 from 792, and we get the answer  \r\n" );
document.write( "\r\n" );
document.write( "    the number of the sought paths is  792 - 280 = 512.    ANSWER\r\n" );
document.write( "
\r
\n" ); document.write( "\n" ); document.write( "Solved.\r
\n" ); document.write( "
\n" ); document.write( "
\n" ); document.write( "\n" ); document.write( "
\n" ); document.write( "
\n" );