ELI5: Explain Like I'm 5

Delannoy number

Hey there kiddo! Do you know what a Delannoy number is? No worries if you don't!

Okay, so imagine you're playing a game with your friend where you both start at the bottom left corner of a grid, and your goal is to get to the top right corner. You can only move up, right, or diagonally up and to the right.

Now, let's say you want to know how many different paths you can take to get to the top right corner of the grid. That's where the Delannoy number comes in! It's a special number that helps us count all the different paths you can take.

The Delannoy number is written as D(m,n), where "m" is the number of columns in the grid and "n" is the number of rows. We use this formula to find the Delannoy number:

D(m,n) = D(m-1,n) + D(m-1,n-1) + D(m,n-1)

Now, that formula might sound confusing, but it's actually pretty simple! It just means that to find the number of paths to get to a certain point in the grid, you just need to add up the number of paths to get to the point directly to the left of it, the point diagonally up and to the left, and the point directly above it.

So, if you had a 2x2 grid (2 columns and 2 rows), you would find the Delannoy number like this:

D(2,2) = D(1,2) + D(1,1) + D(2,1)

To find each of those values, we'd use the formula again:

D(1,2) = D(0,2) + D(0,1) + D(1,1)
D(1,1) = D(0,1) + D(0,0) + D(1,0)
D(2,1) = D(1,1) + D(1,0) + D(2,0)

And so on, until we reach the base case of D(0,0) = 1 (because there's only one path from the bottom left corner to itself).

And there you have it, kiddo! A Delannoy number is just a way to count all the different paths you can take to get from one point to another in a grid. Cool, huh?
Related topics others have asked about: