Search the courses, subjects, tracks, games and features, or jump straight to a page.
Learn it your way
A short class with Sarah and her students. The other ways are under More.
Sign up free to listen. Transcripts are free to read.
Today, we’re going to explore how to count the number of different ways to move from the bottom left corner to the top right of a grid. Can anyone tell me what movements we can make?
We can only move right or up.
Exactly! So, if we start at point (0,0) and want to reach (m,n), how many moves will we need to make in total?
We would need m plus n moves.
Right! And to find the number of distinct paths, we use the binomial coefficient. Who remembers how to express this mathematically?
It’s n choose k, right?
Yes! It’s 'm + n choose m' or 'm + n choose n', both yield the same result because they count the right and up moves. For example, from (0,0) to (5,10), we can compute this as 15 choose 5. Let’s summarize: every path consists of a sequence of right and up moves.
Now, let's calculate the number of paths for specific coordinates. How many paths are there from (0,0) to (5,10)?
It’s 3003, right?
Correct! This comes from calculating 15 choose 5. Can anyone explain why this formula works?
Because we are choosing 5 positions out of 15 total moves to be the right moves, and the rest must be up moves!
Exactly! So now, what if there were a blocked intersection? How would we adjust our count?
We would need to exclude the paths that go through the blocked intersection.
Good! This leads us to the inclusion-exclusion principle. But let’s first calculate how many paths go through a blocked point. Can anyone tell me how we would approach that?
If we have a blocked intersection at (2,4), how can we find the count of paths that go through it?
We calculate the paths from (0,0) to (2,4) and then from (2,4) to (5,10).
Exactly! Let’s compute those values. How many ways are there to get to (2,4)?
That’s 15 ways!
Right! And moving from (2,4) to (5,10) gives us 84 paths. So, what’s the total number of paths through (2,4)?
That would be 15 times 84, which equals 1260.
Exactly! To find valid paths, we subtract this from the total paths initially calculated. So, 3003 minus 1260 gives us 1743 valid paths. Let’s summarize: when faced with blocked paths, we calculate paths through those points and adjust the total using subtraction.
What if we have multiple blocked points like both (2,4) and (4,4)? How would we approach this?
We would need to calculate paths through each block and then account for the overlap.
Correct! Can anyone remind us how we find overlaps?
By adding back the paths that go through both blocks!
Exactly. This addition is part of the inclusion-exclusion principle. By keeping track of path counts through each point and adjusting for overlaps, we handle complex grids effectively.
So, in a messy grid, we combine everything we know so far!
Yes! And this method of combinatorial counting is crucial not only here but in many algorithmic scenarios. Let’s summarize what we learned today!
Unique paths from (0,0) to (m,n) using only right and up moves.
A method to compute distinct paths through the use of combination formulas.
A mathematical formula to compute paths by choosing positions for right or up moves.
A combinatorial principle that adjusts total counts for overlapping blocked paths.
To move right and up, that's the way, choose your paths all day.
Imagine a traveler navigating a grid, only allowed to move right or up, seeking the best path, avoiding blocked streets.
For paths without blocks, remember: Right AND Up - Never Down or Left!
R.U (Right and Up) - the steps to reach your grid's top!
Term
Total Path Count
Click to flip
Term
Path with Block
Click to flip
A sequence of moves to traverse from one corner of the grid to another, limited to specific directions.
A mathematical technique used to count combinations of objects under specific constraints.
A coefficient that gives the number of ways to choose k elements from a set of n elements, usually denoted as 'n choose k'.
A principle used in combinatorics to calculate the size of the union of overlapping sets by including and excluding intersections.
This section explores the problem of counting distinct grid paths from the bottom-left to the top-right corner of a rectangular grid while adhering to movement constraints.
The section discusses how to compute the number of ways to traverse a grid from the origin to a specified point using combinatorial methods. It also introduces the complexities of blocked intersections and how to use inclusion-exclusion principles to adjust path counts accordingly.
In a rectangular grid, we begin at the coordinate (0, 0) and our goal is to reach the coordinate (m, n) while only moving up or to the right. The section establishes a formula based on combinatorial counting, which reveals that for any point (m, n), one must make a total of m + n moves, involving m right moves and n up moves. The paths can be computed using the binomial coefficient, also understood as 'n choose k', which gives the distinct arrangements of right and up moves. However, when there are blocked intersections in the grid, one can leverage combinatorial strategies to calculate the total valid paths by excluding paths that go through blocked intersections using the principle of inclusion and exclusion. This is pertinent in combinatorial counting, enhancing understanding of recursive algorithms and pathfinding complexities.