Walking on an infinite gridHelp me to simplify $sumlimits_i=0^lfloorfracr2rfloorbinomribinomr-ir-2i$Find number of waysNumber of walks on 2D gridCombinations/Permutations Count Paths Through GridPath counting discreteBlock walking and non-overlapping pathsNumber of words which can be read at a gridPath counting in a grid - what's the way to prove this approach?

How to capture c-lightining logs?

Distinguishing between octahedral and tetrahedral holes

How can faith be maintained in a world of living gods?

Why is the the worst case for this function O(n*n)

Are programming languages necessary/useful for operations research practitioner?

How there are 3 possible tautomers of 2,2,4-trimethylheptane-3,5-dione?

What is the difference between a translation and a Galilean transformation?

Owner keeps cutting corners and poaching workers for his other company

How can I protect myself in case of attack in case like this?

Why does low tire pressure decrease fuel economy?

After a few interviews, What should I do after told to wait?

How can Schrödinger's cat be both dead and alive?

Why would an airport be depicted with symbology for runways longer than 8,069 feet even though it is reported on the sectional as 7,200 feet?

A PEMDAS issue request for explanation

Short story: Interstellar inspector senses "off" nature of planet hiding aggressive culture

How to add extra edges in tree?

The pirate treasure of Leatherback Atoll

What is the difference between tl_to_str:V and tl_to_str:N?

Leaving the USA for 10 yrs when you have asylum

How is lower/no gravity simulated on a planet with gravity, without leaving the surface?

How strong is aircraft-grade spruce?

Problem with listing a directory to grep

When calculating averages, why can we treat exploding die as if they're independent?

2 load centers under 1 meter: do you need bonding and main breakers at both?



Walking on an infinite grid


Help me to simplify $sumlimits_i=0^lfloorfracr2rfloorbinomribinomr-ir-2i$Find number of waysNumber of walks on 2D gridCombinations/Permutations Count Paths Through GridPath counting discreteBlock walking and non-overlapping pathsNumber of words which can be read at a gridPath counting in a grid - what's the way to prove this approach?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








4












$begingroup$


I am sure someone has asked a similar question already, but I wasn't able to find it.



So lets get started: We have an infinite grid with coordinates out of $ mathbbZ $. Lets say the first coordinate is the X and the second is the Y. We start at some position on the grid (lets say $ (2, 2) $) and now want to go to an other position (lets say $ (42, 2) $). To do that we could go the following steps (for example):
$$A=(+1, 0)$$
$$B=(+1, +1)$$
$$C=(+1, -1)$$
Now I want to know the number of possible ways using the steps from above.



I already had some ideas - I'll list them here too for inspiration:



  1. The step A has a weight of one and the step B and C has a combined weight of 2. So my mission is to find the number of their combinations to reach 40 (see example from above).
    BUT this doesn't work because combinations like 'BAC' are also valid.


  2. I count the possible ways to perform the steps B and C: If n equals the number of steps into the right direction, so i can go B on $n-1$ steps (the last one is impossible, because for now I start with up only) and it corresponding down step can be on $n-2$ steps and so on...
    This doesn't work, because I could go on $n-1$ steps up and on the n-th all down. Additionally things like 'BCCAB' are with this model also not possible.



  3. Well, I can see a pattern there (n equals steps to the right):



    • 40xA; 0xB+C -> 1 possible way

    • 38xA; 1xB+C -> $ n * (n-1) $ possible ways

    • 36xA; 2xB+C -> $ n * (n-1) * (n-2) * (n-3) $ possible ways

    • 34xA; 3xB+C -> $ n * (n-1) * (n-2) * (n-3) * (n-4) * (n-5) $ possible ways


...so maybe something like this: $ prodlimits_i=0limits^n/2-1 ( (n-i*2) * (n-i*2-1) ) $



So, anyone has an idea or hint for me?



EDIT: Added third idea.










share|cite|improve this question











$endgroup$









  • 5




    $begingroup$
    The number of paths from $(0,0)$ to $(42,2)$ is the coefficient of $t^2$ in $(t^-1+1+t)^42$.
    $endgroup$
    – Lord Shark the Unknown
    9 hours ago






  • 1




    $begingroup$
    Sir isn't it $binom442$ . you have to walk 44 steps and you have to turn to y 2 times somewhere between. or $binom4442$ which is same
    $endgroup$
    – Rishi
    9 hours ago











  • $begingroup$
    read my comment if it helps
    $endgroup$
    – Rishi
    9 hours ago










  • $begingroup$
    Slightly different problem, but the overall reasoning might be of use math.stackexchange.com/questions/3086343/find-number-of-ways/…
    $endgroup$
    – sam wolfe
    9 hours ago










  • $begingroup$
    @Rishi Hmmm, that sound really good! Lets see... If i want to allow any number of up/down steps... Something like the sum from zero to n/2 over the binom? But why 44 steps? You start at 2 and have to get to 42 -> 40 steps! The steps from above (ABC) are ONE step (so right, up+right (=diagonal), down+right (=diagonal))!
    $endgroup$
    – Simonmicro
    9 hours ago

















4












$begingroup$


I am sure someone has asked a similar question already, but I wasn't able to find it.



So lets get started: We have an infinite grid with coordinates out of $ mathbbZ $. Lets say the first coordinate is the X and the second is the Y. We start at some position on the grid (lets say $ (2, 2) $) and now want to go to an other position (lets say $ (42, 2) $). To do that we could go the following steps (for example):
$$A=(+1, 0)$$
$$B=(+1, +1)$$
$$C=(+1, -1)$$
Now I want to know the number of possible ways using the steps from above.



I already had some ideas - I'll list them here too for inspiration:



  1. The step A has a weight of one and the step B and C has a combined weight of 2. So my mission is to find the number of their combinations to reach 40 (see example from above).
    BUT this doesn't work because combinations like 'BAC' are also valid.


  2. I count the possible ways to perform the steps B and C: If n equals the number of steps into the right direction, so i can go B on $n-1$ steps (the last one is impossible, because for now I start with up only) and it corresponding down step can be on $n-2$ steps and so on...
    This doesn't work, because I could go on $n-1$ steps up and on the n-th all down. Additionally things like 'BCCAB' are with this model also not possible.



  3. Well, I can see a pattern there (n equals steps to the right):



    • 40xA; 0xB+C -> 1 possible way

    • 38xA; 1xB+C -> $ n * (n-1) $ possible ways

    • 36xA; 2xB+C -> $ n * (n-1) * (n-2) * (n-3) $ possible ways

    • 34xA; 3xB+C -> $ n * (n-1) * (n-2) * (n-3) * (n-4) * (n-5) $ possible ways


...so maybe something like this: $ prodlimits_i=0limits^n/2-1 ( (n-i*2) * (n-i*2-1) ) $



So, anyone has an idea or hint for me?



EDIT: Added third idea.










share|cite|improve this question











$endgroup$









  • 5




    $begingroup$
    The number of paths from $(0,0)$ to $(42,2)$ is the coefficient of $t^2$ in $(t^-1+1+t)^42$.
    $endgroup$
    – Lord Shark the Unknown
    9 hours ago






  • 1




    $begingroup$
    Sir isn't it $binom442$ . you have to walk 44 steps and you have to turn to y 2 times somewhere between. or $binom4442$ which is same
    $endgroup$
    – Rishi
    9 hours ago











  • $begingroup$
    read my comment if it helps
    $endgroup$
    – Rishi
    9 hours ago










  • $begingroup$
    Slightly different problem, but the overall reasoning might be of use math.stackexchange.com/questions/3086343/find-number-of-ways/…
    $endgroup$
    – sam wolfe
    9 hours ago










  • $begingroup$
    @Rishi Hmmm, that sound really good! Lets see... If i want to allow any number of up/down steps... Something like the sum from zero to n/2 over the binom? But why 44 steps? You start at 2 and have to get to 42 -> 40 steps! The steps from above (ABC) are ONE step (so right, up+right (=diagonal), down+right (=diagonal))!
    $endgroup$
    – Simonmicro
    9 hours ago













4












4








4


1



$begingroup$


I am sure someone has asked a similar question already, but I wasn't able to find it.



So lets get started: We have an infinite grid with coordinates out of $ mathbbZ $. Lets say the first coordinate is the X and the second is the Y. We start at some position on the grid (lets say $ (2, 2) $) and now want to go to an other position (lets say $ (42, 2) $). To do that we could go the following steps (for example):
$$A=(+1, 0)$$
$$B=(+1, +1)$$
$$C=(+1, -1)$$
Now I want to know the number of possible ways using the steps from above.



I already had some ideas - I'll list them here too for inspiration:



  1. The step A has a weight of one and the step B and C has a combined weight of 2. So my mission is to find the number of their combinations to reach 40 (see example from above).
    BUT this doesn't work because combinations like 'BAC' are also valid.


  2. I count the possible ways to perform the steps B and C: If n equals the number of steps into the right direction, so i can go B on $n-1$ steps (the last one is impossible, because for now I start with up only) and it corresponding down step can be on $n-2$ steps and so on...
    This doesn't work, because I could go on $n-1$ steps up and on the n-th all down. Additionally things like 'BCCAB' are with this model also not possible.



  3. Well, I can see a pattern there (n equals steps to the right):



    • 40xA; 0xB+C -> 1 possible way

    • 38xA; 1xB+C -> $ n * (n-1) $ possible ways

    • 36xA; 2xB+C -> $ n * (n-1) * (n-2) * (n-3) $ possible ways

    • 34xA; 3xB+C -> $ n * (n-1) * (n-2) * (n-3) * (n-4) * (n-5) $ possible ways


...so maybe something like this: $ prodlimits_i=0limits^n/2-1 ( (n-i*2) * (n-i*2-1) ) $



So, anyone has an idea or hint for me?



EDIT: Added third idea.










share|cite|improve this question











$endgroup$




I am sure someone has asked a similar question already, but I wasn't able to find it.



So lets get started: We have an infinite grid with coordinates out of $ mathbbZ $. Lets say the first coordinate is the X and the second is the Y. We start at some position on the grid (lets say $ (2, 2) $) and now want to go to an other position (lets say $ (42, 2) $). To do that we could go the following steps (for example):
$$A=(+1, 0)$$
$$B=(+1, +1)$$
$$C=(+1, -1)$$
Now I want to know the number of possible ways using the steps from above.



I already had some ideas - I'll list them here too for inspiration:



  1. The step A has a weight of one and the step B and C has a combined weight of 2. So my mission is to find the number of their combinations to reach 40 (see example from above).
    BUT this doesn't work because combinations like 'BAC' are also valid.


  2. I count the possible ways to perform the steps B and C: If n equals the number of steps into the right direction, so i can go B on $n-1$ steps (the last one is impossible, because for now I start with up only) and it corresponding down step can be on $n-2$ steps and so on...
    This doesn't work, because I could go on $n-1$ steps up and on the n-th all down. Additionally things like 'BCCAB' are with this model also not possible.



  3. Well, I can see a pattern there (n equals steps to the right):



    • 40xA; 0xB+C -> 1 possible way

    • 38xA; 1xB+C -> $ n * (n-1) $ possible ways

    • 36xA; 2xB+C -> $ n * (n-1) * (n-2) * (n-3) $ possible ways

    • 34xA; 3xB+C -> $ n * (n-1) * (n-2) * (n-3) * (n-4) * (n-5) $ possible ways


...so maybe something like this: $ prodlimits_i=0limits^n/2-1 ( (n-i*2) * (n-i*2-1) ) $



So, anyone has an idea or hint for me?



EDIT: Added third idea.







combinatorics discrete-mathematics






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited 9 hours ago







Simonmicro

















asked 9 hours ago









SimonmicroSimonmicro

284 bronze badges




284 bronze badges










  • 5




    $begingroup$
    The number of paths from $(0,0)$ to $(42,2)$ is the coefficient of $t^2$ in $(t^-1+1+t)^42$.
    $endgroup$
    – Lord Shark the Unknown
    9 hours ago






  • 1




    $begingroup$
    Sir isn't it $binom442$ . you have to walk 44 steps and you have to turn to y 2 times somewhere between. or $binom4442$ which is same
    $endgroup$
    – Rishi
    9 hours ago











  • $begingroup$
    read my comment if it helps
    $endgroup$
    – Rishi
    9 hours ago










  • $begingroup$
    Slightly different problem, but the overall reasoning might be of use math.stackexchange.com/questions/3086343/find-number-of-ways/…
    $endgroup$
    – sam wolfe
    9 hours ago










  • $begingroup$
    @Rishi Hmmm, that sound really good! Lets see... If i want to allow any number of up/down steps... Something like the sum from zero to n/2 over the binom? But why 44 steps? You start at 2 and have to get to 42 -> 40 steps! The steps from above (ABC) are ONE step (so right, up+right (=diagonal), down+right (=diagonal))!
    $endgroup$
    – Simonmicro
    9 hours ago












  • 5




    $begingroup$
    The number of paths from $(0,0)$ to $(42,2)$ is the coefficient of $t^2$ in $(t^-1+1+t)^42$.
    $endgroup$
    – Lord Shark the Unknown
    9 hours ago






  • 1




    $begingroup$
    Sir isn't it $binom442$ . you have to walk 44 steps and you have to turn to y 2 times somewhere between. or $binom4442$ which is same
    $endgroup$
    – Rishi
    9 hours ago











  • $begingroup$
    read my comment if it helps
    $endgroup$
    – Rishi
    9 hours ago










  • $begingroup$
    Slightly different problem, but the overall reasoning might be of use math.stackexchange.com/questions/3086343/find-number-of-ways/…
    $endgroup$
    – sam wolfe
    9 hours ago










  • $begingroup$
    @Rishi Hmmm, that sound really good! Lets see... If i want to allow any number of up/down steps... Something like the sum from zero to n/2 over the binom? But why 44 steps? You start at 2 and have to get to 42 -> 40 steps! The steps from above (ABC) are ONE step (so right, up+right (=diagonal), down+right (=diagonal))!
    $endgroup$
    – Simonmicro
    9 hours ago







5




5




$begingroup$
The number of paths from $(0,0)$ to $(42,2)$ is the coefficient of $t^2$ in $(t^-1+1+t)^42$.
$endgroup$
– Lord Shark the Unknown
9 hours ago




$begingroup$
The number of paths from $(0,0)$ to $(42,2)$ is the coefficient of $t^2$ in $(t^-1+1+t)^42$.
$endgroup$
– Lord Shark the Unknown
9 hours ago




1




1




$begingroup$
Sir isn't it $binom442$ . you have to walk 44 steps and you have to turn to y 2 times somewhere between. or $binom4442$ which is same
$endgroup$
– Rishi
9 hours ago





$begingroup$
Sir isn't it $binom442$ . you have to walk 44 steps and you have to turn to y 2 times somewhere between. or $binom4442$ which is same
$endgroup$
– Rishi
9 hours ago













$begingroup$
read my comment if it helps
$endgroup$
– Rishi
9 hours ago




$begingroup$
read my comment if it helps
$endgroup$
– Rishi
9 hours ago












$begingroup$
Slightly different problem, but the overall reasoning might be of use math.stackexchange.com/questions/3086343/find-number-of-ways/…
$endgroup$
– sam wolfe
9 hours ago




$begingroup$
Slightly different problem, but the overall reasoning might be of use math.stackexchange.com/questions/3086343/find-number-of-ways/…
$endgroup$
– sam wolfe
9 hours ago












$begingroup$
@Rishi Hmmm, that sound really good! Lets see... If i want to allow any number of up/down steps... Something like the sum from zero to n/2 over the binom? But why 44 steps? You start at 2 and have to get to 42 -> 40 steps! The steps from above (ABC) are ONE step (so right, up+right (=diagonal), down+right (=diagonal))!
$endgroup$
– Simonmicro
9 hours ago




$begingroup$
@Rishi Hmmm, that sound really good! Lets see... If i want to allow any number of up/down steps... Something like the sum from zero to n/2 over the binom? But why 44 steps? You start at 2 and have to get to 42 -> 40 steps! The steps from above (ABC) are ONE step (so right, up+right (=diagonal), down+right (=diagonal))!
$endgroup$
– Simonmicro
9 hours ago










2 Answers
2






active

oldest

votes


















5














$begingroup$

We encode the steps with $x$ when going a step horizontally in $x$-direction and with $y$ when going vertically in $y$-direction. This way $A,B,C$ become
beginalign*
&A=(1,0)quadto x^1y^0\
&B=(1,1)quad to x^1y^1\
&C=(1,-1) to x^1y^-1\
endalign*

To go one step either $A$ or $B$ or $C$ is encoded as
beginalign*
x+xy+fracxy
endalign*



Note the number of paths from $(2,2)$ to $(42,2)$ is due to symmetry equal to the number of paths from $(0,0)$ to $(40,0)$. We need $40$ steps to go from $(0,0)$ to $(40,0)$ and so we consider
beginalign*
[x^40y^0]left(x+xy+fracxyright)^40tag1
endalign*

where we conveniently use the coefficient of operator $[x^ny^m]$ to denote the coefficient of $x^ny^m$ in a series $A(x,y)$.




We obtain
beginalign*
colorblue[x^40y^0]&colorblueleft(x+xy+fracxyright)^40\
&=[x^40y^0]x^40left(1+y+frac1yright)^40\
&=[y^0]sum_k=0^40binom40kleft(y+frac1yright)^ktag2\
&=[y^0]sum_k=0^40binom40ksum_j=0^kbinomkjy^jy^-(k-j)\
&=sum_k=0^40binom40k[y^k]sum_j=0^kbinomkjy^2jtag3\
&=sum_k=0^20binom402k[y^2k]sum_j=0^2kbinom2kjy^2jtag4\
&,,colorblue=sum_k=0^20binom402kbinom2kktag5
endalign*

in accordance with the result of @JeanMarie.




Comment:



  • In (2) we apply the rule $[x^p]x^q=[x^p-q]$ and apply the binomial theorem to $left(1+left(y+frac1yright)right)^40$.


  • In (3) we apply the rule $[y^p]y^q=[y^p-q]$ again.


  • In (4) we observe that only even powers $2j$ do contribute. So we need only to consider even indices $2k$.


  • In (5) we finally select the coefficient of $y^2k$.



Note:
The coefficients of $x^0$ in the expansion of $left(x+1+x^-1right)^n$ are called central trinomial coefficients. They do not admit a closed formula which is shown in this post.







share|cite|improve this answer











$endgroup$






















    3














    $begingroup$

    First of all, your problem is equivalent to find the number of paths from $(0,0)$ to $(40,0)$. This is what we are going to assume.



    Considering $A,B,C$ as vectors, we are in a first step looking for the number of triples $(m,n,p)$ of integers such that $$mbinom10+nbinom11+pbinom 1-1=binom400 iff begincasesm+n+p&=&40\n-p&=&0endcases.$$



    which amounts to say :



    $$textDetermine (first) the ordered pairs of integers (m,n) textsuch that m+2n=40$$



    Thus, necessarily : $m=2k$ for $k=0,1,cdots 20.$ meaning that :



    $$(m,n,p)=(2k,20-k,20-k)=(0,20,20),(2,19,19),(4,18,18), etc...$$



    For each pair $(m,n)$ it remains to constitute a word of $40$ letters $A,B,C$, i.e.




    place into $40$ slots : $m=2k$ letters "$A$"s, $(20-k)$ letters "$B$"s, and $(20-k)$ letters "$C$"s as well.




    Once the $2k$ "slots" for letters "$A$" have been attributed, we have to place the same amount of letters $B$ and $C$ into the $40-2k$ remaining "slots", i.e., $20-k$ letters $B$ and as many letters "$C$". We consider only placement of letters "$B$" (Placing letters "$C$" hasn't to be considered : they occupy the remaining "slots"). This boils down to the following count :




    $$sum_k=0^20 binom402kbinom40-2k20-k=sum_k=0^20 frac40 !(2k)! (20-k) ! (20-k) !$$




    I don't know if one can give a close expression to this sum...






    share|cite|improve this answer











    $endgroup$

















      Your Answer








      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/4.0/"u003ecc by-sa 4.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
      );



      );














      draft saved

      draft discarded
















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3348209%2fwalking-on-an-infinite-grid%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









      5














      $begingroup$

      We encode the steps with $x$ when going a step horizontally in $x$-direction and with $y$ when going vertically in $y$-direction. This way $A,B,C$ become
      beginalign*
      &A=(1,0)quadto x^1y^0\
      &B=(1,1)quad to x^1y^1\
      &C=(1,-1) to x^1y^-1\
      endalign*

      To go one step either $A$ or $B$ or $C$ is encoded as
      beginalign*
      x+xy+fracxy
      endalign*



      Note the number of paths from $(2,2)$ to $(42,2)$ is due to symmetry equal to the number of paths from $(0,0)$ to $(40,0)$. We need $40$ steps to go from $(0,0)$ to $(40,0)$ and so we consider
      beginalign*
      [x^40y^0]left(x+xy+fracxyright)^40tag1
      endalign*

      where we conveniently use the coefficient of operator $[x^ny^m]$ to denote the coefficient of $x^ny^m$ in a series $A(x,y)$.




      We obtain
      beginalign*
      colorblue[x^40y^0]&colorblueleft(x+xy+fracxyright)^40\
      &=[x^40y^0]x^40left(1+y+frac1yright)^40\
      &=[y^0]sum_k=0^40binom40kleft(y+frac1yright)^ktag2\
      &=[y^0]sum_k=0^40binom40ksum_j=0^kbinomkjy^jy^-(k-j)\
      &=sum_k=0^40binom40k[y^k]sum_j=0^kbinomkjy^2jtag3\
      &=sum_k=0^20binom402k[y^2k]sum_j=0^2kbinom2kjy^2jtag4\
      &,,colorblue=sum_k=0^20binom402kbinom2kktag5
      endalign*

      in accordance with the result of @JeanMarie.




      Comment:



      • In (2) we apply the rule $[x^p]x^q=[x^p-q]$ and apply the binomial theorem to $left(1+left(y+frac1yright)right)^40$.


      • In (3) we apply the rule $[y^p]y^q=[y^p-q]$ again.


      • In (4) we observe that only even powers $2j$ do contribute. So we need only to consider even indices $2k$.


      • In (5) we finally select the coefficient of $y^2k$.



      Note:
      The coefficients of $x^0$ in the expansion of $left(x+1+x^-1right)^n$ are called central trinomial coefficients. They do not admit a closed formula which is shown in this post.







      share|cite|improve this answer











      $endgroup$



















        5














        $begingroup$

        We encode the steps with $x$ when going a step horizontally in $x$-direction and with $y$ when going vertically in $y$-direction. This way $A,B,C$ become
        beginalign*
        &A=(1,0)quadto x^1y^0\
        &B=(1,1)quad to x^1y^1\
        &C=(1,-1) to x^1y^-1\
        endalign*

        To go one step either $A$ or $B$ or $C$ is encoded as
        beginalign*
        x+xy+fracxy
        endalign*



        Note the number of paths from $(2,2)$ to $(42,2)$ is due to symmetry equal to the number of paths from $(0,0)$ to $(40,0)$. We need $40$ steps to go from $(0,0)$ to $(40,0)$ and so we consider
        beginalign*
        [x^40y^0]left(x+xy+fracxyright)^40tag1
        endalign*

        where we conveniently use the coefficient of operator $[x^ny^m]$ to denote the coefficient of $x^ny^m$ in a series $A(x,y)$.




        We obtain
        beginalign*
        colorblue[x^40y^0]&colorblueleft(x+xy+fracxyright)^40\
        &=[x^40y^0]x^40left(1+y+frac1yright)^40\
        &=[y^0]sum_k=0^40binom40kleft(y+frac1yright)^ktag2\
        &=[y^0]sum_k=0^40binom40ksum_j=0^kbinomkjy^jy^-(k-j)\
        &=sum_k=0^40binom40k[y^k]sum_j=0^kbinomkjy^2jtag3\
        &=sum_k=0^20binom402k[y^2k]sum_j=0^2kbinom2kjy^2jtag4\
        &,,colorblue=sum_k=0^20binom402kbinom2kktag5
        endalign*

        in accordance with the result of @JeanMarie.




        Comment:



        • In (2) we apply the rule $[x^p]x^q=[x^p-q]$ and apply the binomial theorem to $left(1+left(y+frac1yright)right)^40$.


        • In (3) we apply the rule $[y^p]y^q=[y^p-q]$ again.


        • In (4) we observe that only even powers $2j$ do contribute. So we need only to consider even indices $2k$.


        • In (5) we finally select the coefficient of $y^2k$.



        Note:
        The coefficients of $x^0$ in the expansion of $left(x+1+x^-1right)^n$ are called central trinomial coefficients. They do not admit a closed formula which is shown in this post.







        share|cite|improve this answer











        $endgroup$

















          5














          5










          5







          $begingroup$

          We encode the steps with $x$ when going a step horizontally in $x$-direction and with $y$ when going vertically in $y$-direction. This way $A,B,C$ become
          beginalign*
          &A=(1,0)quadto x^1y^0\
          &B=(1,1)quad to x^1y^1\
          &C=(1,-1) to x^1y^-1\
          endalign*

          To go one step either $A$ or $B$ or $C$ is encoded as
          beginalign*
          x+xy+fracxy
          endalign*



          Note the number of paths from $(2,2)$ to $(42,2)$ is due to symmetry equal to the number of paths from $(0,0)$ to $(40,0)$. We need $40$ steps to go from $(0,0)$ to $(40,0)$ and so we consider
          beginalign*
          [x^40y^0]left(x+xy+fracxyright)^40tag1
          endalign*

          where we conveniently use the coefficient of operator $[x^ny^m]$ to denote the coefficient of $x^ny^m$ in a series $A(x,y)$.




          We obtain
          beginalign*
          colorblue[x^40y^0]&colorblueleft(x+xy+fracxyright)^40\
          &=[x^40y^0]x^40left(1+y+frac1yright)^40\
          &=[y^0]sum_k=0^40binom40kleft(y+frac1yright)^ktag2\
          &=[y^0]sum_k=0^40binom40ksum_j=0^kbinomkjy^jy^-(k-j)\
          &=sum_k=0^40binom40k[y^k]sum_j=0^kbinomkjy^2jtag3\
          &=sum_k=0^20binom402k[y^2k]sum_j=0^2kbinom2kjy^2jtag4\
          &,,colorblue=sum_k=0^20binom402kbinom2kktag5
          endalign*

          in accordance with the result of @JeanMarie.




          Comment:



          • In (2) we apply the rule $[x^p]x^q=[x^p-q]$ and apply the binomial theorem to $left(1+left(y+frac1yright)right)^40$.


          • In (3) we apply the rule $[y^p]y^q=[y^p-q]$ again.


          • In (4) we observe that only even powers $2j$ do contribute. So we need only to consider even indices $2k$.


          • In (5) we finally select the coefficient of $y^2k$.



          Note:
          The coefficients of $x^0$ in the expansion of $left(x+1+x^-1right)^n$ are called central trinomial coefficients. They do not admit a closed formula which is shown in this post.







          share|cite|improve this answer











          $endgroup$



          We encode the steps with $x$ when going a step horizontally in $x$-direction and with $y$ when going vertically in $y$-direction. This way $A,B,C$ become
          beginalign*
          &A=(1,0)quadto x^1y^0\
          &B=(1,1)quad to x^1y^1\
          &C=(1,-1) to x^1y^-1\
          endalign*

          To go one step either $A$ or $B$ or $C$ is encoded as
          beginalign*
          x+xy+fracxy
          endalign*



          Note the number of paths from $(2,2)$ to $(42,2)$ is due to symmetry equal to the number of paths from $(0,0)$ to $(40,0)$. We need $40$ steps to go from $(0,0)$ to $(40,0)$ and so we consider
          beginalign*
          [x^40y^0]left(x+xy+fracxyright)^40tag1
          endalign*

          where we conveniently use the coefficient of operator $[x^ny^m]$ to denote the coefficient of $x^ny^m$ in a series $A(x,y)$.




          We obtain
          beginalign*
          colorblue[x^40y^0]&colorblueleft(x+xy+fracxyright)^40\
          &=[x^40y^0]x^40left(1+y+frac1yright)^40\
          &=[y^0]sum_k=0^40binom40kleft(y+frac1yright)^ktag2\
          &=[y^0]sum_k=0^40binom40ksum_j=0^kbinomkjy^jy^-(k-j)\
          &=sum_k=0^40binom40k[y^k]sum_j=0^kbinomkjy^2jtag3\
          &=sum_k=0^20binom402k[y^2k]sum_j=0^2kbinom2kjy^2jtag4\
          &,,colorblue=sum_k=0^20binom402kbinom2kktag5
          endalign*

          in accordance with the result of @JeanMarie.




          Comment:



          • In (2) we apply the rule $[x^p]x^q=[x^p-q]$ and apply the binomial theorem to $left(1+left(y+frac1yright)right)^40$.


          • In (3) we apply the rule $[y^p]y^q=[y^p-q]$ again.


          • In (4) we observe that only even powers $2j$ do contribute. So we need only to consider even indices $2k$.


          • In (5) we finally select the coefficient of $y^2k$.



          Note:
          The coefficients of $x^0$ in the expansion of $left(x+1+x^-1right)^n$ are called central trinomial coefficients. They do not admit a closed formula which is shown in this post.








          share|cite|improve this answer














          share|cite|improve this answer



          share|cite|improve this answer








          edited 4 hours ago

























          answered 4 hours ago









          Markus ScheuerMarkus Scheuer

          68.1k4 gold badges64 silver badges164 bronze badges




          68.1k4 gold badges64 silver badges164 bronze badges


























              3














              $begingroup$

              First of all, your problem is equivalent to find the number of paths from $(0,0)$ to $(40,0)$. This is what we are going to assume.



              Considering $A,B,C$ as vectors, we are in a first step looking for the number of triples $(m,n,p)$ of integers such that $$mbinom10+nbinom11+pbinom 1-1=binom400 iff begincasesm+n+p&=&40\n-p&=&0endcases.$$



              which amounts to say :



              $$textDetermine (first) the ordered pairs of integers (m,n) textsuch that m+2n=40$$



              Thus, necessarily : $m=2k$ for $k=0,1,cdots 20.$ meaning that :



              $$(m,n,p)=(2k,20-k,20-k)=(0,20,20),(2,19,19),(4,18,18), etc...$$



              For each pair $(m,n)$ it remains to constitute a word of $40$ letters $A,B,C$, i.e.




              place into $40$ slots : $m=2k$ letters "$A$"s, $(20-k)$ letters "$B$"s, and $(20-k)$ letters "$C$"s as well.




              Once the $2k$ "slots" for letters "$A$" have been attributed, we have to place the same amount of letters $B$ and $C$ into the $40-2k$ remaining "slots", i.e., $20-k$ letters $B$ and as many letters "$C$". We consider only placement of letters "$B$" (Placing letters "$C$" hasn't to be considered : they occupy the remaining "slots"). This boils down to the following count :




              $$sum_k=0^20 binom402kbinom40-2k20-k=sum_k=0^20 frac40 !(2k)! (20-k) ! (20-k) !$$




              I don't know if one can give a close expression to this sum...






              share|cite|improve this answer











              $endgroup$



















                3














                $begingroup$

                First of all, your problem is equivalent to find the number of paths from $(0,0)$ to $(40,0)$. This is what we are going to assume.



                Considering $A,B,C$ as vectors, we are in a first step looking for the number of triples $(m,n,p)$ of integers such that $$mbinom10+nbinom11+pbinom 1-1=binom400 iff begincasesm+n+p&=&40\n-p&=&0endcases.$$



                which amounts to say :



                $$textDetermine (first) the ordered pairs of integers (m,n) textsuch that m+2n=40$$



                Thus, necessarily : $m=2k$ for $k=0,1,cdots 20.$ meaning that :



                $$(m,n,p)=(2k,20-k,20-k)=(0,20,20),(2,19,19),(4,18,18), etc...$$



                For each pair $(m,n)$ it remains to constitute a word of $40$ letters $A,B,C$, i.e.




                place into $40$ slots : $m=2k$ letters "$A$"s, $(20-k)$ letters "$B$"s, and $(20-k)$ letters "$C$"s as well.




                Once the $2k$ "slots" for letters "$A$" have been attributed, we have to place the same amount of letters $B$ and $C$ into the $40-2k$ remaining "slots", i.e., $20-k$ letters $B$ and as many letters "$C$". We consider only placement of letters "$B$" (Placing letters "$C$" hasn't to be considered : they occupy the remaining "slots"). This boils down to the following count :




                $$sum_k=0^20 binom402kbinom40-2k20-k=sum_k=0^20 frac40 !(2k)! (20-k) ! (20-k) !$$




                I don't know if one can give a close expression to this sum...






                share|cite|improve this answer











                $endgroup$

















                  3














                  3










                  3







                  $begingroup$

                  First of all, your problem is equivalent to find the number of paths from $(0,0)$ to $(40,0)$. This is what we are going to assume.



                  Considering $A,B,C$ as vectors, we are in a first step looking for the number of triples $(m,n,p)$ of integers such that $$mbinom10+nbinom11+pbinom 1-1=binom400 iff begincasesm+n+p&=&40\n-p&=&0endcases.$$



                  which amounts to say :



                  $$textDetermine (first) the ordered pairs of integers (m,n) textsuch that m+2n=40$$



                  Thus, necessarily : $m=2k$ for $k=0,1,cdots 20.$ meaning that :



                  $$(m,n,p)=(2k,20-k,20-k)=(0,20,20),(2,19,19),(4,18,18), etc...$$



                  For each pair $(m,n)$ it remains to constitute a word of $40$ letters $A,B,C$, i.e.




                  place into $40$ slots : $m=2k$ letters "$A$"s, $(20-k)$ letters "$B$"s, and $(20-k)$ letters "$C$"s as well.




                  Once the $2k$ "slots" for letters "$A$" have been attributed, we have to place the same amount of letters $B$ and $C$ into the $40-2k$ remaining "slots", i.e., $20-k$ letters $B$ and as many letters "$C$". We consider only placement of letters "$B$" (Placing letters "$C$" hasn't to be considered : they occupy the remaining "slots"). This boils down to the following count :




                  $$sum_k=0^20 binom402kbinom40-2k20-k=sum_k=0^20 frac40 !(2k)! (20-k) ! (20-k) !$$




                  I don't know if one can give a close expression to this sum...






                  share|cite|improve this answer











                  $endgroup$



                  First of all, your problem is equivalent to find the number of paths from $(0,0)$ to $(40,0)$. This is what we are going to assume.



                  Considering $A,B,C$ as vectors, we are in a first step looking for the number of triples $(m,n,p)$ of integers such that $$mbinom10+nbinom11+pbinom 1-1=binom400 iff begincasesm+n+p&=&40\n-p&=&0endcases.$$



                  which amounts to say :



                  $$textDetermine (first) the ordered pairs of integers (m,n) textsuch that m+2n=40$$



                  Thus, necessarily : $m=2k$ for $k=0,1,cdots 20.$ meaning that :



                  $$(m,n,p)=(2k,20-k,20-k)=(0,20,20),(2,19,19),(4,18,18), etc...$$



                  For each pair $(m,n)$ it remains to constitute a word of $40$ letters $A,B,C$, i.e.




                  place into $40$ slots : $m=2k$ letters "$A$"s, $(20-k)$ letters "$B$"s, and $(20-k)$ letters "$C$"s as well.




                  Once the $2k$ "slots" for letters "$A$" have been attributed, we have to place the same amount of letters $B$ and $C$ into the $40-2k$ remaining "slots", i.e., $20-k$ letters $B$ and as many letters "$C$". We consider only placement of letters "$B$" (Placing letters "$C$" hasn't to be considered : they occupy the remaining "slots"). This boils down to the following count :




                  $$sum_k=0^20 binom402kbinom40-2k20-k=sum_k=0^20 frac40 !(2k)! (20-k) ! (20-k) !$$




                  I don't know if one can give a close expression to this sum...







                  share|cite|improve this answer














                  share|cite|improve this answer



                  share|cite|improve this answer








                  edited 6 hours ago

























                  answered 7 hours ago









                  Jean MarieJean Marie

                  35.7k4 gold badges26 silver badges62 bronze badges




                  35.7k4 gold badges26 silver badges62 bronze badges































                      draft saved

                      draft discarded















































                      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.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3348209%2fwalking-on-an-infinite-grid%23new-answer', 'question_page');

                      );

                      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







                      Popular posts from this blog

                      Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

                      Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

                      199年 目錄 大件事 到箇年出世嗰人 到箇年死嗰人 節慶、風俗習慣 導覽選單