Pedery
Reputation
Top tag
Next privilege 250 Rep.
 Oct 10 awarded Popular Question May 6 awarded Supporter Jan 30 awarded Teacher Jan 30 comment Finding points in a grid with exactly k paths to them? Sigh... Please read my answer thoroughly before you answer. Finding all i and j such as i!/((i-j)!j!)=n will take O(n). It's a simple loop, from 0 to max(i, j). Jan 29 comment Finding points in a grid with exactly k paths to them? Did you read my entire answer? If there are R right moves and U up moves between two points, then all paths leading between them will number C(R+U, R) (using binomial notation). Thus one will need to iterate over i and j to find all of them that result in i!/((i-j)!j!)=n. From there one can use my proposition in the second last paragraph to calculate the actual paths, given that you now know the steps that can take you there (but not the order). Jan 29 comment Finding points in a grid with exactly k paths to them? Expanded the solution based on your comments. Jan 29 comment Finding points in a grid with exactly k paths to them? If you start at (0,0), I get that you have 15 possible paths to (4,2), and 7 possible paths to (6,1) or have I misunderstood the question...? Jan 29 comment Finding points in a grid with exactly k paths to them? Sure you do! Between (x,y) and (x+3,y+3) there are exactly 3 'U's and 3 'R's. Any (new) combination of R, R, R, U, U and U will give a new path. Jan 29 answered Finding points in a grid with exactly k paths to them? Jan 14 awarded Student Jan 14 comment Creating a parametrized ellipse at an angle Thanks! I'll try this out in code tomorrow. Jan 14 comment Creating a parametrized ellipse at an angle Yep, Isaac is correct. it would produce the same looking ellipse since t is in the interval [0, 360], regardless of whether a constant is added. Your answer would simply start and end the ellipse at a different place along the curve. Jan 14 awarded Autobiographer Jan 14 asked Creating a parametrized ellipse at an angle