Closed-form for finding the number of paths on an nxm board
$begingroup$
Let a board $B$ be of size $n times m $ squares where $n, m in mathbb{Z}$ and $n, m ge 1$. Starting from the upper-left square, $B_{1,1}$, find the number of paths to the bottom-right square, $B_{n,m}$, by going right or down at any given square.
For example, let $B$ be $2times 2$, then the total number of paths is two: $(B_{1,1}, B_{1,2}, B_{2,2}), (B_{1,1},B_{2,1},B_{2,2})$.
One can calculate the total number of paths for an $ntimes m$ board by representing the board as a matrix where the top row are 1s and the left-most column are 1s, then the number of paths to get to $B_{n,m} = B_{n-1,m} + B_{n,m-1}$. Going further, the total paths can be expressed as the closed-form $frac{(n-1+m-1)!}{(n-1)!(m-1)!}$.
When the problem is extended to allow movements of right, right-down, and down at any given square, the closed-form above breaks down. As an example for a board $B$ of size $2times 2$, the total number of paths is three now: $(B_{1,1}, B_{1,2}, B_{2,2}), (B_{1,1}, B_{2,2}), (B_{1,1},B_{2,1},B_{2,2})$. One could still calculate the total paths doing the matrix method above, but I'm interested in whether a closed-form exist?
combinatorics combinations
$endgroup$
add a comment |
$begingroup$
Let a board $B$ be of size $n times m $ squares where $n, m in mathbb{Z}$ and $n, m ge 1$. Starting from the upper-left square, $B_{1,1}$, find the number of paths to the bottom-right square, $B_{n,m}$, by going right or down at any given square.
For example, let $B$ be $2times 2$, then the total number of paths is two: $(B_{1,1}, B_{1,2}, B_{2,2}), (B_{1,1},B_{2,1},B_{2,2})$.
One can calculate the total number of paths for an $ntimes m$ board by representing the board as a matrix where the top row are 1s and the left-most column are 1s, then the number of paths to get to $B_{n,m} = B_{n-1,m} + B_{n,m-1}$. Going further, the total paths can be expressed as the closed-form $frac{(n-1+m-1)!}{(n-1)!(m-1)!}$.
When the problem is extended to allow movements of right, right-down, and down at any given square, the closed-form above breaks down. As an example for a board $B$ of size $2times 2$, the total number of paths is three now: $(B_{1,1}, B_{1,2}, B_{2,2}), (B_{1,1}, B_{2,2}), (B_{1,1},B_{2,1},B_{2,2})$. One could still calculate the total paths doing the matrix method above, but I'm interested in whether a closed-form exist?
combinatorics combinations
$endgroup$
1
$begingroup$
See en.wikipedia.org/wiki/Delannoy_number . Using keyword "Delannoy" brings interesting tracks on this site.
$endgroup$
– Jean Marie
Jan 11 at 10:05
add a comment |
$begingroup$
Let a board $B$ be of size $n times m $ squares where $n, m in mathbb{Z}$ and $n, m ge 1$. Starting from the upper-left square, $B_{1,1}$, find the number of paths to the bottom-right square, $B_{n,m}$, by going right or down at any given square.
For example, let $B$ be $2times 2$, then the total number of paths is two: $(B_{1,1}, B_{1,2}, B_{2,2}), (B_{1,1},B_{2,1},B_{2,2})$.
One can calculate the total number of paths for an $ntimes m$ board by representing the board as a matrix where the top row are 1s and the left-most column are 1s, then the number of paths to get to $B_{n,m} = B_{n-1,m} + B_{n,m-1}$. Going further, the total paths can be expressed as the closed-form $frac{(n-1+m-1)!}{(n-1)!(m-1)!}$.
When the problem is extended to allow movements of right, right-down, and down at any given square, the closed-form above breaks down. As an example for a board $B$ of size $2times 2$, the total number of paths is three now: $(B_{1,1}, B_{1,2}, B_{2,2}), (B_{1,1}, B_{2,2}), (B_{1,1},B_{2,1},B_{2,2})$. One could still calculate the total paths doing the matrix method above, but I'm interested in whether a closed-form exist?
combinatorics combinations
$endgroup$
Let a board $B$ be of size $n times m $ squares where $n, m in mathbb{Z}$ and $n, m ge 1$. Starting from the upper-left square, $B_{1,1}$, find the number of paths to the bottom-right square, $B_{n,m}$, by going right or down at any given square.
For example, let $B$ be $2times 2$, then the total number of paths is two: $(B_{1,1}, B_{1,2}, B_{2,2}), (B_{1,1},B_{2,1},B_{2,2})$.
One can calculate the total number of paths for an $ntimes m$ board by representing the board as a matrix where the top row are 1s and the left-most column are 1s, then the number of paths to get to $B_{n,m} = B_{n-1,m} + B_{n,m-1}$. Going further, the total paths can be expressed as the closed-form $frac{(n-1+m-1)!}{(n-1)!(m-1)!}$.
When the problem is extended to allow movements of right, right-down, and down at any given square, the closed-form above breaks down. As an example for a board $B$ of size $2times 2$, the total number of paths is three now: $(B_{1,1}, B_{1,2}, B_{2,2}), (B_{1,1}, B_{2,2}), (B_{1,1},B_{2,1},B_{2,2})$. One could still calculate the total paths doing the matrix method above, but I'm interested in whether a closed-form exist?
combinatorics combinations
combinatorics combinations
edited Jan 11 at 7:35
Miket25
asked Jan 11 at 7:26
Miket25Miket25
1106
1106
1
$begingroup$
See en.wikipedia.org/wiki/Delannoy_number . Using keyword "Delannoy" brings interesting tracks on this site.
$endgroup$
– Jean Marie
Jan 11 at 10:05
add a comment |
1
$begingroup$
See en.wikipedia.org/wiki/Delannoy_number . Using keyword "Delannoy" brings interesting tracks on this site.
$endgroup$
– Jean Marie
Jan 11 at 10:05
1
1
$begingroup$
See en.wikipedia.org/wiki/Delannoy_number . Using keyword "Delannoy" brings interesting tracks on this site.
$endgroup$
– Jean Marie
Jan 11 at 10:05
$begingroup$
See en.wikipedia.org/wiki/Delannoy_number . Using keyword "Delannoy" brings interesting tracks on this site.
$endgroup$
– Jean Marie
Jan 11 at 10:05
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
Let $t$ be the number of diagonal moves. Then there are $n-1-t$ horizontal moves and $m-1-t$ vertical moves, for a total of $binom{n+m-2-t}{t,n-1-t,m-1-t}$ paths (this is a multinomial coefficient). Therefore the total number of paths is
$$
sum_{t=0}^{min(n,m)-1} binom{n+m-2-t}{t,n-1-t,m-1-t}.
$$
I'm not sure this can be simplified any further.
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3069568%2fclosed-form-for-finding-the-number-of-paths-on-an-nxm-board%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Let $t$ be the number of diagonal moves. Then there are $n-1-t$ horizontal moves and $m-1-t$ vertical moves, for a total of $binom{n+m-2-t}{t,n-1-t,m-1-t}$ paths (this is a multinomial coefficient). Therefore the total number of paths is
$$
sum_{t=0}^{min(n,m)-1} binom{n+m-2-t}{t,n-1-t,m-1-t}.
$$
I'm not sure this can be simplified any further.
$endgroup$
add a comment |
$begingroup$
Let $t$ be the number of diagonal moves. Then there are $n-1-t$ horizontal moves and $m-1-t$ vertical moves, for a total of $binom{n+m-2-t}{t,n-1-t,m-1-t}$ paths (this is a multinomial coefficient). Therefore the total number of paths is
$$
sum_{t=0}^{min(n,m)-1} binom{n+m-2-t}{t,n-1-t,m-1-t}.
$$
I'm not sure this can be simplified any further.
$endgroup$
add a comment |
$begingroup$
Let $t$ be the number of diagonal moves. Then there are $n-1-t$ horizontal moves and $m-1-t$ vertical moves, for a total of $binom{n+m-2-t}{t,n-1-t,m-1-t}$ paths (this is a multinomial coefficient). Therefore the total number of paths is
$$
sum_{t=0}^{min(n,m)-1} binom{n+m-2-t}{t,n-1-t,m-1-t}.
$$
I'm not sure this can be simplified any further.
$endgroup$
Let $t$ be the number of diagonal moves. Then there are $n-1-t$ horizontal moves and $m-1-t$ vertical moves, for a total of $binom{n+m-2-t}{t,n-1-t,m-1-t}$ paths (this is a multinomial coefficient). Therefore the total number of paths is
$$
sum_{t=0}^{min(n,m)-1} binom{n+m-2-t}{t,n-1-t,m-1-t}.
$$
I'm not sure this can be simplified any further.
answered Jan 11 at 8:58
Yuval FilmusYuval Filmus
48.7k472145
48.7k472145
add a comment |
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3069568%2fclosed-form-for-finding-the-number-of-paths-on-an-nxm-board%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
$begingroup$
See en.wikipedia.org/wiki/Delannoy_number . Using keyword "Delannoy" brings interesting tracks on this site.
$endgroup$
– Jean Marie
Jan 11 at 10:05