Bridge building with irregular planksFastest way to collect an arbitrary armyDo better than chanceGreatest Digital Clock Number, with a Twist!The Old Miss GruppeHow much water do you need to cross the desert?Create bridges to minimise distanceCovering Table with CoinsHow many different kinds of rings are there?Constructing 0.35 Unit LengthOptimal Money-Saving on the NYC Metro
What is Cash Advance APR?
What does routing an IP address mean?
What if a revenant (monster) gains fire resistance?
Why should universal income be universal?
Aragorn's "guise" in the Orthanc Stone
Non-trope happy ending?
The IT department bottlenecks progress. How should I handle this?
Loading commands from file
What does chmod -u do?
Biological Blimps: Propulsion
How do I find all files that end with a dot
Can I sign legal documents with a smiley face?
Multiplicative persistence
Approximating irrational number to rational number
Delivering sarcasm
Why did the HMS Bounty go back to a time when whales are already rare?
Which one is correct as adjective “protruding” or “protruded”?
Pre-mixing cryogenic fuels and using only one fuel tank
How to implement a feedback to keep the DC gain at zero for this conceptual passive filter?
How can Trident be so inexpensive? Will it orbit Triton or just do a (slow) flyby?
Is this toilet slogan correct usage of the English language?
How to indicate a cut out for a product window
Should I stop contributing to retirement accounts?
What is this called? Old film camera viewer?
Bridge building with irregular planks
Fastest way to collect an arbitrary armyDo better than chanceGreatest Digital Clock Number, with a Twist!The Old Miss GruppeHow much water do you need to cross the desert?Create bridges to minimise distanceCovering Table with CoinsHow many different kinds of rings are there?Constructing 0.35 Unit LengthOptimal Money-Saving on the NYC Metro
$begingroup$
Imagine you have a big rectangular pond in your back garden. You wish to build a bridge from your house in the lower left corner to the small pagoda in the top right.
You have lots of planks of length $1$ and $2$. You only wish to place planks orthogonal to the sides of the pond, and you don't want to go backwards ever. The pond is $10times10$.
How many ways are there to do this?
For example:
. . . ._P
|
. . . . .
|
. . . . .
|
. . ._. .
|
H_._. . .
For a bonus, is there a generic solution for planks of length $l_1,l_2,dots,l_k$?
mathematics combinatorics
$endgroup$
add a comment |
$begingroup$
Imagine you have a big rectangular pond in your back garden. You wish to build a bridge from your house in the lower left corner to the small pagoda in the top right.
You have lots of planks of length $1$ and $2$. You only wish to place planks orthogonal to the sides of the pond, and you don't want to go backwards ever. The pond is $10times10$.
How many ways are there to do this?
For example:
. . . ._P
|
. . . . .
|
. . . . .
|
. . ._. .
|
H_._. . .
For a bonus, is there a generic solution for planks of length $l_1,l_2,dots,l_k$?
mathematics combinatorics
$endgroup$
add a comment |
$begingroup$
Imagine you have a big rectangular pond in your back garden. You wish to build a bridge from your house in the lower left corner to the small pagoda in the top right.
You have lots of planks of length $1$ and $2$. You only wish to place planks orthogonal to the sides of the pond, and you don't want to go backwards ever. The pond is $10times10$.
How many ways are there to do this?
For example:
. . . ._P
|
. . . . .
|
. . . . .
|
. . ._. .
|
H_._. . .
For a bonus, is there a generic solution for planks of length $l_1,l_2,dots,l_k$?
mathematics combinatorics
$endgroup$
Imagine you have a big rectangular pond in your back garden. You wish to build a bridge from your house in the lower left corner to the small pagoda in the top right.
You have lots of planks of length $1$ and $2$. You only wish to place planks orthogonal to the sides of the pond, and you don't want to go backwards ever. The pond is $10times10$.
How many ways are there to do this?
For example:
. . . ._P
|
. . . . .
|
. . . . .
|
. . ._. .
|
H_._. . .
For a bonus, is there a generic solution for planks of length $l_1,l_2,dots,l_k$?
mathematics combinatorics
mathematics combinatorics
asked yesterday
JonMark PerryJonMark Perry
20.4k64099
20.4k64099
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
Rather than thinking of planks as having lengths, think of them as defining certain sets of vectors. So in this case we have (1,0), (0,1), (2,0), (0,2). (Caution: if you have e.g. a plank of length 5 then you need to allow (3,4) and (4,3) as well as (5,0) and (0,5)! [EDITED to add:] No, as pointed out by another user in comments that's wrong because the question specifies orthogonal only. Though obviously you could also do it the other way if you wanted :-).)
Now we have a recurrence relation: if we write $N(a,b)$ for the number of ways to span a pond of size $(a,b)$ then we have $N(0,0)=1$ and $N(a,b)=sum N(a-x,b-y)$ where the sum is over plank-vectors $(x,y)$.
For the particular case here, the table looks like this:
$$beginarrayr
1 & 1 & 2 & 3 & 5 & 8 & 13 & 21 & 34 & 55 & 89 \
1 & 2 & 5 & 10 & 20 & 38 & 71 & 130 & 235 & 420 & 744 \
2 & 5 & 14 & 32 & 71 & 149 & 304 & 604 & 1177 & 2256 & 4266 \
3 & 10 & 32 & 84 & 207 & 478 & 1060 & 2272 & 4744 & 9692 & 19446 \
5 & 20 & 71 & 207 & 556 & 1390 & 3310 & 7576 & 16807 & 36331 & 76850 \
8 & 38 & 149 & 478 & 1390 & 3736 & 9496 & 23080 & 54127 & 123230 & 273653 \
13 & 71 & 304 & 1060 & 3310 & 9496 & 25612 & 65764 & 162310 & 387635 & 900448 \
21 & 130 & 604 & 2272 & 7576 & 23080 & 65764 & 177688 & 459889 & 1148442 & 2782432 \
34 & 235 & 1177 & 4744 & 16807 & 54127 & 162310 & 459889 & 1244398 & 3240364 & 8167642 \
55 & 420 & 2256 & 9692 & 36331 & 123230 & 387635 & 1148442 & 3240364 & 8777612 & 22968050 \
89 & 744 & 4266 & 19446 & 76850 & 273653 & 900448 & 2782432 & 8167642 & 22968050 & 62271384
endarray
$$
The number you want is in the bottom right of the array. This happens to be http://oeis.org/A036355. In general, the generating function for these things is $frac11-sum x^dxy^dy$ where the sum is over plank-vectors $(dx,dy)$. I guess you can probably get a closed form out of that somehow.
$endgroup$
2
$begingroup$
I was about to post the same table. :-)
$endgroup$
– Jaap Scherphuis
yesterday
1
$begingroup$
Why am I not surprised that the person saying that is you? :-)
$endgroup$
– Gareth McCaughan♦
yesterday
9
$begingroup$
On my computer, the table spills over into the HNQ. Maybe just me?
$endgroup$
– Brandon_J
yesterday
1
$begingroup$
@GarethMcCaughan The (3,4)/(4,3) bit is wrong, and confused me for a minute before I realized what you meant. You can't place planks on an angle like that, since the question specified that planks must be "orthogonal to the sides of the pond".
$endgroup$
– Billy Mailman
yesterday
1
$begingroup$
@Brandon_J Not just you, me too
$endgroup$
– Sensoray
yesterday
|
show 1 more comment
$begingroup$
My answer (using a computer program) is:
There are 8777612 ways to arrange the planks.
I solved this using a C program#include <stdio.h>
#define WIDTH 10
#define DEPTH 10
#define PLANK 2
unsigned long long cache[DEPTH][WIDTH];
unsigned long long recur(int row, int col)
int main(void)
printf("Paths = %llun", recur(0, 0));
Note that this is from coordinate (0,0) to (9,9) because the start and finish points are in the pond. The distance is $9$ in each direction. It checks out when manually counting small ponds.
This also provides a generic solution for ponds up to $26 times 26$, or up to $2^64-1$ paths.
For small ponds the cache isn't necessary.
$endgroup$
$begingroup$
@JonMarkPerry isn't the other answer for 11 x 11 pond? Count across the table.
$endgroup$
– Weather Vane
yesterday
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: "559"
;
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2fpuzzling.stackexchange.com%2fquestions%2f80933%2fbridge-building-with-irregular-planks%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Rather than thinking of planks as having lengths, think of them as defining certain sets of vectors. So in this case we have (1,0), (0,1), (2,0), (0,2). (Caution: if you have e.g. a plank of length 5 then you need to allow (3,4) and (4,3) as well as (5,0) and (0,5)! [EDITED to add:] No, as pointed out by another user in comments that's wrong because the question specifies orthogonal only. Though obviously you could also do it the other way if you wanted :-).)
Now we have a recurrence relation: if we write $N(a,b)$ for the number of ways to span a pond of size $(a,b)$ then we have $N(0,0)=1$ and $N(a,b)=sum N(a-x,b-y)$ where the sum is over plank-vectors $(x,y)$.
For the particular case here, the table looks like this:
$$beginarrayr
1 & 1 & 2 & 3 & 5 & 8 & 13 & 21 & 34 & 55 & 89 \
1 & 2 & 5 & 10 & 20 & 38 & 71 & 130 & 235 & 420 & 744 \
2 & 5 & 14 & 32 & 71 & 149 & 304 & 604 & 1177 & 2256 & 4266 \
3 & 10 & 32 & 84 & 207 & 478 & 1060 & 2272 & 4744 & 9692 & 19446 \
5 & 20 & 71 & 207 & 556 & 1390 & 3310 & 7576 & 16807 & 36331 & 76850 \
8 & 38 & 149 & 478 & 1390 & 3736 & 9496 & 23080 & 54127 & 123230 & 273653 \
13 & 71 & 304 & 1060 & 3310 & 9496 & 25612 & 65764 & 162310 & 387635 & 900448 \
21 & 130 & 604 & 2272 & 7576 & 23080 & 65764 & 177688 & 459889 & 1148442 & 2782432 \
34 & 235 & 1177 & 4744 & 16807 & 54127 & 162310 & 459889 & 1244398 & 3240364 & 8167642 \
55 & 420 & 2256 & 9692 & 36331 & 123230 & 387635 & 1148442 & 3240364 & 8777612 & 22968050 \
89 & 744 & 4266 & 19446 & 76850 & 273653 & 900448 & 2782432 & 8167642 & 22968050 & 62271384
endarray
$$
The number you want is in the bottom right of the array. This happens to be http://oeis.org/A036355. In general, the generating function for these things is $frac11-sum x^dxy^dy$ where the sum is over plank-vectors $(dx,dy)$. I guess you can probably get a closed form out of that somehow.
$endgroup$
2
$begingroup$
I was about to post the same table. :-)
$endgroup$
– Jaap Scherphuis
yesterday
1
$begingroup$
Why am I not surprised that the person saying that is you? :-)
$endgroup$
– Gareth McCaughan♦
yesterday
9
$begingroup$
On my computer, the table spills over into the HNQ. Maybe just me?
$endgroup$
– Brandon_J
yesterday
1
$begingroup$
@GarethMcCaughan The (3,4)/(4,3) bit is wrong, and confused me for a minute before I realized what you meant. You can't place planks on an angle like that, since the question specified that planks must be "orthogonal to the sides of the pond".
$endgroup$
– Billy Mailman
yesterday
1
$begingroup$
@Brandon_J Not just you, me too
$endgroup$
– Sensoray
yesterday
|
show 1 more comment
$begingroup$
Rather than thinking of planks as having lengths, think of them as defining certain sets of vectors. So in this case we have (1,0), (0,1), (2,0), (0,2). (Caution: if you have e.g. a plank of length 5 then you need to allow (3,4) and (4,3) as well as (5,0) and (0,5)! [EDITED to add:] No, as pointed out by another user in comments that's wrong because the question specifies orthogonal only. Though obviously you could also do it the other way if you wanted :-).)
Now we have a recurrence relation: if we write $N(a,b)$ for the number of ways to span a pond of size $(a,b)$ then we have $N(0,0)=1$ and $N(a,b)=sum N(a-x,b-y)$ where the sum is over plank-vectors $(x,y)$.
For the particular case here, the table looks like this:
$$beginarrayr
1 & 1 & 2 & 3 & 5 & 8 & 13 & 21 & 34 & 55 & 89 \
1 & 2 & 5 & 10 & 20 & 38 & 71 & 130 & 235 & 420 & 744 \
2 & 5 & 14 & 32 & 71 & 149 & 304 & 604 & 1177 & 2256 & 4266 \
3 & 10 & 32 & 84 & 207 & 478 & 1060 & 2272 & 4744 & 9692 & 19446 \
5 & 20 & 71 & 207 & 556 & 1390 & 3310 & 7576 & 16807 & 36331 & 76850 \
8 & 38 & 149 & 478 & 1390 & 3736 & 9496 & 23080 & 54127 & 123230 & 273653 \
13 & 71 & 304 & 1060 & 3310 & 9496 & 25612 & 65764 & 162310 & 387635 & 900448 \
21 & 130 & 604 & 2272 & 7576 & 23080 & 65764 & 177688 & 459889 & 1148442 & 2782432 \
34 & 235 & 1177 & 4744 & 16807 & 54127 & 162310 & 459889 & 1244398 & 3240364 & 8167642 \
55 & 420 & 2256 & 9692 & 36331 & 123230 & 387635 & 1148442 & 3240364 & 8777612 & 22968050 \
89 & 744 & 4266 & 19446 & 76850 & 273653 & 900448 & 2782432 & 8167642 & 22968050 & 62271384
endarray
$$
The number you want is in the bottom right of the array. This happens to be http://oeis.org/A036355. In general, the generating function for these things is $frac11-sum x^dxy^dy$ where the sum is over plank-vectors $(dx,dy)$. I guess you can probably get a closed form out of that somehow.
$endgroup$
2
$begingroup$
I was about to post the same table. :-)
$endgroup$
– Jaap Scherphuis
yesterday
1
$begingroup$
Why am I not surprised that the person saying that is you? :-)
$endgroup$
– Gareth McCaughan♦
yesterday
9
$begingroup$
On my computer, the table spills over into the HNQ. Maybe just me?
$endgroup$
– Brandon_J
yesterday
1
$begingroup$
@GarethMcCaughan The (3,4)/(4,3) bit is wrong, and confused me for a minute before I realized what you meant. You can't place planks on an angle like that, since the question specified that planks must be "orthogonal to the sides of the pond".
$endgroup$
– Billy Mailman
yesterday
1
$begingroup$
@Brandon_J Not just you, me too
$endgroup$
– Sensoray
yesterday
|
show 1 more comment
$begingroup$
Rather than thinking of planks as having lengths, think of them as defining certain sets of vectors. So in this case we have (1,0), (0,1), (2,0), (0,2). (Caution: if you have e.g. a plank of length 5 then you need to allow (3,4) and (4,3) as well as (5,0) and (0,5)! [EDITED to add:] No, as pointed out by another user in comments that's wrong because the question specifies orthogonal only. Though obviously you could also do it the other way if you wanted :-).)
Now we have a recurrence relation: if we write $N(a,b)$ for the number of ways to span a pond of size $(a,b)$ then we have $N(0,0)=1$ and $N(a,b)=sum N(a-x,b-y)$ where the sum is over plank-vectors $(x,y)$.
For the particular case here, the table looks like this:
$$beginarrayr
1 & 1 & 2 & 3 & 5 & 8 & 13 & 21 & 34 & 55 & 89 \
1 & 2 & 5 & 10 & 20 & 38 & 71 & 130 & 235 & 420 & 744 \
2 & 5 & 14 & 32 & 71 & 149 & 304 & 604 & 1177 & 2256 & 4266 \
3 & 10 & 32 & 84 & 207 & 478 & 1060 & 2272 & 4744 & 9692 & 19446 \
5 & 20 & 71 & 207 & 556 & 1390 & 3310 & 7576 & 16807 & 36331 & 76850 \
8 & 38 & 149 & 478 & 1390 & 3736 & 9496 & 23080 & 54127 & 123230 & 273653 \
13 & 71 & 304 & 1060 & 3310 & 9496 & 25612 & 65764 & 162310 & 387635 & 900448 \
21 & 130 & 604 & 2272 & 7576 & 23080 & 65764 & 177688 & 459889 & 1148442 & 2782432 \
34 & 235 & 1177 & 4744 & 16807 & 54127 & 162310 & 459889 & 1244398 & 3240364 & 8167642 \
55 & 420 & 2256 & 9692 & 36331 & 123230 & 387635 & 1148442 & 3240364 & 8777612 & 22968050 \
89 & 744 & 4266 & 19446 & 76850 & 273653 & 900448 & 2782432 & 8167642 & 22968050 & 62271384
endarray
$$
The number you want is in the bottom right of the array. This happens to be http://oeis.org/A036355. In general, the generating function for these things is $frac11-sum x^dxy^dy$ where the sum is over plank-vectors $(dx,dy)$. I guess you can probably get a closed form out of that somehow.
$endgroup$
Rather than thinking of planks as having lengths, think of them as defining certain sets of vectors. So in this case we have (1,0), (0,1), (2,0), (0,2). (Caution: if you have e.g. a plank of length 5 then you need to allow (3,4) and (4,3) as well as (5,0) and (0,5)! [EDITED to add:] No, as pointed out by another user in comments that's wrong because the question specifies orthogonal only. Though obviously you could also do it the other way if you wanted :-).)
Now we have a recurrence relation: if we write $N(a,b)$ for the number of ways to span a pond of size $(a,b)$ then we have $N(0,0)=1$ and $N(a,b)=sum N(a-x,b-y)$ where the sum is over plank-vectors $(x,y)$.
For the particular case here, the table looks like this:
$$beginarrayr
1 & 1 & 2 & 3 & 5 & 8 & 13 & 21 & 34 & 55 & 89 \
1 & 2 & 5 & 10 & 20 & 38 & 71 & 130 & 235 & 420 & 744 \
2 & 5 & 14 & 32 & 71 & 149 & 304 & 604 & 1177 & 2256 & 4266 \
3 & 10 & 32 & 84 & 207 & 478 & 1060 & 2272 & 4744 & 9692 & 19446 \
5 & 20 & 71 & 207 & 556 & 1390 & 3310 & 7576 & 16807 & 36331 & 76850 \
8 & 38 & 149 & 478 & 1390 & 3736 & 9496 & 23080 & 54127 & 123230 & 273653 \
13 & 71 & 304 & 1060 & 3310 & 9496 & 25612 & 65764 & 162310 & 387635 & 900448 \
21 & 130 & 604 & 2272 & 7576 & 23080 & 65764 & 177688 & 459889 & 1148442 & 2782432 \
34 & 235 & 1177 & 4744 & 16807 & 54127 & 162310 & 459889 & 1244398 & 3240364 & 8167642 \
55 & 420 & 2256 & 9692 & 36331 & 123230 & 387635 & 1148442 & 3240364 & 8777612 & 22968050 \
89 & 744 & 4266 & 19446 & 76850 & 273653 & 900448 & 2782432 & 8167642 & 22968050 & 62271384
endarray
$$
The number you want is in the bottom right of the array. This happens to be http://oeis.org/A036355. In general, the generating function for these things is $frac11-sum x^dxy^dy$ where the sum is over plank-vectors $(dx,dy)$. I guess you can probably get a closed form out of that somehow.
edited yesterday
answered yesterday
Gareth McCaughan♦Gareth McCaughan
65k3164254
65k3164254
2
$begingroup$
I was about to post the same table. :-)
$endgroup$
– Jaap Scherphuis
yesterday
1
$begingroup$
Why am I not surprised that the person saying that is you? :-)
$endgroup$
– Gareth McCaughan♦
yesterday
9
$begingroup$
On my computer, the table spills over into the HNQ. Maybe just me?
$endgroup$
– Brandon_J
yesterday
1
$begingroup$
@GarethMcCaughan The (3,4)/(4,3) bit is wrong, and confused me for a minute before I realized what you meant. You can't place planks on an angle like that, since the question specified that planks must be "orthogonal to the sides of the pond".
$endgroup$
– Billy Mailman
yesterday
1
$begingroup$
@Brandon_J Not just you, me too
$endgroup$
– Sensoray
yesterday
|
show 1 more comment
2
$begingroup$
I was about to post the same table. :-)
$endgroup$
– Jaap Scherphuis
yesterday
1
$begingroup$
Why am I not surprised that the person saying that is you? :-)
$endgroup$
– Gareth McCaughan♦
yesterday
9
$begingroup$
On my computer, the table spills over into the HNQ. Maybe just me?
$endgroup$
– Brandon_J
yesterday
1
$begingroup$
@GarethMcCaughan The (3,4)/(4,3) bit is wrong, and confused me for a minute before I realized what you meant. You can't place planks on an angle like that, since the question specified that planks must be "orthogonal to the sides of the pond".
$endgroup$
– Billy Mailman
yesterday
1
$begingroup$
@Brandon_J Not just you, me too
$endgroup$
– Sensoray
yesterday
2
2
$begingroup$
I was about to post the same table. :-)
$endgroup$
– Jaap Scherphuis
yesterday
$begingroup$
I was about to post the same table. :-)
$endgroup$
– Jaap Scherphuis
yesterday
1
1
$begingroup$
Why am I not surprised that the person saying that is you? :-)
$endgroup$
– Gareth McCaughan♦
yesterday
$begingroup$
Why am I not surprised that the person saying that is you? :-)
$endgroup$
– Gareth McCaughan♦
yesterday
9
9
$begingroup$
On my computer, the table spills over into the HNQ. Maybe just me?
$endgroup$
– Brandon_J
yesterday
$begingroup$
On my computer, the table spills over into the HNQ. Maybe just me?
$endgroup$
– Brandon_J
yesterday
1
1
$begingroup$
@GarethMcCaughan The (3,4)/(4,3) bit is wrong, and confused me for a minute before I realized what you meant. You can't place planks on an angle like that, since the question specified that planks must be "orthogonal to the sides of the pond".
$endgroup$
– Billy Mailman
yesterday
$begingroup$
@GarethMcCaughan The (3,4)/(4,3) bit is wrong, and confused me for a minute before I realized what you meant. You can't place planks on an angle like that, since the question specified that planks must be "orthogonal to the sides of the pond".
$endgroup$
– Billy Mailman
yesterday
1
1
$begingroup$
@Brandon_J Not just you, me too
$endgroup$
– Sensoray
yesterday
$begingroup$
@Brandon_J Not just you, me too
$endgroup$
– Sensoray
yesterday
|
show 1 more comment
$begingroup$
My answer (using a computer program) is:
There are 8777612 ways to arrange the planks.
I solved this using a C program#include <stdio.h>
#define WIDTH 10
#define DEPTH 10
#define PLANK 2
unsigned long long cache[DEPTH][WIDTH];
unsigned long long recur(int row, int col)
int main(void)
printf("Paths = %llun", recur(0, 0));
Note that this is from coordinate (0,0) to (9,9) because the start and finish points are in the pond. The distance is $9$ in each direction. It checks out when manually counting small ponds.
This also provides a generic solution for ponds up to $26 times 26$, or up to $2^64-1$ paths.
For small ponds the cache isn't necessary.
$endgroup$
$begingroup$
@JonMarkPerry isn't the other answer for 11 x 11 pond? Count across the table.
$endgroup$
– Weather Vane
yesterday
add a comment |
$begingroup$
My answer (using a computer program) is:
There are 8777612 ways to arrange the planks.
I solved this using a C program#include <stdio.h>
#define WIDTH 10
#define DEPTH 10
#define PLANK 2
unsigned long long cache[DEPTH][WIDTH];
unsigned long long recur(int row, int col)
int main(void)
printf("Paths = %llun", recur(0, 0));
Note that this is from coordinate (0,0) to (9,9) because the start and finish points are in the pond. The distance is $9$ in each direction. It checks out when manually counting small ponds.
This also provides a generic solution for ponds up to $26 times 26$, or up to $2^64-1$ paths.
For small ponds the cache isn't necessary.
$endgroup$
$begingroup$
@JonMarkPerry isn't the other answer for 11 x 11 pond? Count across the table.
$endgroup$
– Weather Vane
yesterday
add a comment |
$begingroup$
My answer (using a computer program) is:
There are 8777612 ways to arrange the planks.
I solved this using a C program#include <stdio.h>
#define WIDTH 10
#define DEPTH 10
#define PLANK 2
unsigned long long cache[DEPTH][WIDTH];
unsigned long long recur(int row, int col)
int main(void)
printf("Paths = %llun", recur(0, 0));
Note that this is from coordinate (0,0) to (9,9) because the start and finish points are in the pond. The distance is $9$ in each direction. It checks out when manually counting small ponds.
This also provides a generic solution for ponds up to $26 times 26$, or up to $2^64-1$ paths.
For small ponds the cache isn't necessary.
$endgroup$
My answer (using a computer program) is:
There are 8777612 ways to arrange the planks.
I solved this using a C program#include <stdio.h>
#define WIDTH 10
#define DEPTH 10
#define PLANK 2
unsigned long long cache[DEPTH][WIDTH];
unsigned long long recur(int row, int col)
int main(void)
printf("Paths = %llun", recur(0, 0));
Note that this is from coordinate (0,0) to (9,9) because the start and finish points are in the pond. The distance is $9$ in each direction. It checks out when manually counting small ponds.
This also provides a generic solution for ponds up to $26 times 26$, or up to $2^64-1$ paths.
For small ponds the cache isn't necessary.
edited yesterday
answered yesterday
Weather VaneWeather Vane
1,957110
1,957110
$begingroup$
@JonMarkPerry isn't the other answer for 11 x 11 pond? Count across the table.
$endgroup$
– Weather Vane
yesterday
add a comment |
$begingroup$
@JonMarkPerry isn't the other answer for 11 x 11 pond? Count across the table.
$endgroup$
– Weather Vane
yesterday
$begingroup$
@JonMarkPerry isn't the other answer for 11 x 11 pond? Count across the table.
$endgroup$
– Weather Vane
yesterday
$begingroup$
@JonMarkPerry isn't the other answer for 11 x 11 pond? Count across the table.
$endgroup$
– Weather Vane
yesterday
add a comment |
Thanks for contributing an answer to Puzzling 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%2fpuzzling.stackexchange.com%2fquestions%2f80933%2fbridge-building-with-irregular-planks%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