Menu Close

In-how-many-ways-can-you-go-up-a-staircase-with-20-steps-if-you-take-one-two-or-three-steps-at-a-time-




Question Number 166770 by mr W last updated on 27/Feb/22
In how many ways can you go up a   staircase with 20 steps if you take   one, two or three steps at a time?
Inhowmanywayscanyougoupastaircasewith20stepsifyoutakeone,twoorthreestepsatatime?
Commented by MJS_new last updated on 27/Feb/22
is it 121415?
isit121415?
Commented by mr W last updated on 28/Feb/22
i havn′t calculated it yet sir.
ihavntcalculatedityetsir.
Commented by peter frank last updated on 28/Feb/22
very tough
verytough
Commented by MJS_new last updated on 28/Feb/22
not tough. just arrange as follows:  333333 2  333333 11  33333 221  33333 2111  33333 11111  3333 2222  3333 22211  ...  then count the permutations of each row
nottough.justarrangeasfollows:33333323333331133333221333332111333331111133332222333322211thencountthepermutationsofeachrow
Commented by mr W last updated on 28/Feb/22
MJS sir:  121415 is correct. i got the same.
MJSsir:121415iscorrect.igotthesame.
Commented by MJS_new last updated on 28/Feb/22
thank you!
thankyou!
Answered by nadovic last updated on 27/Feb/22
One Step: 20 ways  Two Steps: 10 ways  Three Steps: 7 ways    Number of Ways = 20 + 10 + 7                                        = 37 ways
OneStep:20waysTwoSteps:10waysThreeSteps:7waysNumberofWays=20+10+7=37ways
Commented by mr W last updated on 27/Feb/22
wrong!
wrong!
Answered by nadovic last updated on 28/Feb/22
      = ^(20) P_1  +^(20) P_2  +^(20) P_3        = 7240 ways
=20P1+20P2+20P3=7240ways
Commented by MJS_new last updated on 28/Feb/22
maybe test your hypothetical formula with  an easy example?  5 stairs:  32 23 311 131 113 221 212 122 2111 1211  1121 1112 11111  13 possibilities  6 stairs:  33 321 312 231 213 132 123 3111 1311 1131  1113 222 2211 2121 2112 1221 1212 1122  21111 12111 11211 11121 11112 111111  24 possibilities  ...
maybetestyourhypotheticalformulawithaneasyexample?5stairs:322331113111322121212221111211112111121111113possibilities6stairs:333213122312131321233111131111311113222221121212112122112121122211111211111211111211111211111124possibilities
Answered by mr W last updated on 01/Mar/22
let′s look at the case that we make n   moves to go up the staircase. each   move can be of one, two or three   steps.    the number of ways to go up the  staircase in n moves is the number  of integer solutions of the equation  a_1 +a_2 +a_3 +...+a_n =20  with 1≤a_i ≤3.  using generating function it is the   coefficient of the x^(20)  term in the  expansion of (x+x^2 +x^3 )^n .    (x+x^2 +x^3 )^n   =x^n (1+x+x^2 )^n   =((x^n (1−x^3 )^n )/((1−x)^n ))  =x^n {Σ_(k=0) ^n (−1)^k C_k ^n x^(3k) }{Σ_(m=0) ^∞ C_(n−1) ^(m+n−1) x^m }  x^n x^(3k) x^m =x^(n+3k+m) =^! x^(20)   n+3k+m=^! 20  ⇒3k+m=20−n  0≤k≤n, m≥0  ⇒7≤n≤20 (this is clear, we need at  least 7 moves and at most 20 moves  to go up the staircase.)    example n=10:  k=0, m=10 ⇒C_0 ^(10) C_9 ^(19) =92378  k=1, m=7 ⇒−C_1 ^(10) C_9 ^(16) =−114400  k=2, m=4 ⇒C_2 ^(10) C_9 ^(13) =32175  k=3, m=1 ⇒−C_3 ^(10) C_9 ^(10) =−1200  that means the coef. of x^(20)  is  92378−114400+32175−1200=8953    the results for all values of n see  following table.    the total result is 121415. i.e. there  are 121415 ways to go up the staircase.
letslookatthecasethatwemakenmovestogoupthestaircase.eachmovecanbeofone,twoorthreesteps.thenumberofwaystogoupthestaircaseinnmovesisthenumberofintegersolutionsoftheequationa1+a2+a3++an=20with1ai3.usinggeneratingfunctionitisthecoefficientofthex20termintheexpansionof(x+x2+x3)n.(x+x2+x3)n=xn(1+x+x2)n=xn(1x3)n(1x)n=xn{nk=0(1)kCknx3k}{m=0Cn1m+n1xm}xnx3kxm=xn+3k+m=!x20n+3k+m=!203k+m=20n0kn,m07n20(thisisclear,weneedatleast7movesandatmost20movestogoupthestaircase.)examplen=10:k=0,m=10C010C919=92378k=1,m=7C110C916=114400k=2,m=4C210C913=32175k=3,m=1C310C910=1200thatmeansthecoef.ofx20is92378114400+321751200=8953theresultsforallvaluesofnseefollowingtable.thetotalresultis121415.i.e.thereare121415waystogoupthestaircase.
Commented by mr W last updated on 28/Feb/22
Commented by Tawa11 last updated on 28/Feb/22
Great sir
Greatsir
Answered by mr W last updated on 02/Mar/22
AN OTHER METHOD  let′s say there are N(n) ways to go up  a staircase with n steps. if we make  a move with one step, then there are  n−1 steps remaining and there are  N(n−1) ways to go up the remaining  steps. if we make a move with  two steps, then there are n−2 steps   remaining and there are N(n−2)   ways to go up the remaining steps.   similarly if we make a move with   three steps, then there are N(n−3)   ways to go up the remaining steps.   therefore we have following  recurrence relation:  N(n)=N(n−1)+N(n−2)+N(n−3)  we also have   N(1)=1  N(2)=2  N(3)=4  applying the recurrence relation above,   we get  N(4)=7  N(5)=13  N(6)=24  N(7)=44  N(8)=81  N(9)=149  N(10)=274  N(11)=504  N(12)=927  N(13)=1705  N(14)=3136  N(15)=5768  N(16)=10609  N(17)=19513  N(18)=35890  N(19)=66012  N(20)=121415 ✓    we can also find a closed formula  for N(n) by solving following  characteristic equation  λ^3 −λ^2 −λ−1=0  let λ=s+(1/3)  s^2 −(4/3)s−((38)/(27))=0  with u=((3(√(33))+19))^(1/3) , v=((3(√(33))−19))^(1/3)   λ_1 =(1/3)(1+u−v)  λ_(2,3) =(1/6)[2−u+v±(√3)(u+v)i]  ⇒N(n)=Aλ_1 ^n +Bλ_2 ^n +Cλ_3 ^n   N(0)=N(3)−N(2)−N(1)=1  N(−1)=N(2)−N(1)−N(0)=0    N(1)=Aλ_1 +Bλ_2 +Cλ_3 =1  N(0)=A+B+C=1  N(−1)=(A/λ_1 )+(B/λ_2 )+(C/λ_3 )=0   [(λ_1 ,λ_2 ,λ_3 ),(1,1,1),((1/λ_1 ),(1/λ_2 ),(1/λ_3 )) ] ((A),(B),(C) ) = ((1),(1),(0) )  ⇒ ((A),(B),(C) ) = [(λ_1 ,λ_2 ,λ_3 ),(1,1,1),((1/λ_1 ),(1/λ_2 ),(1/λ_3 )) ]^(−1)  ((1),(1),(0) )
ANOTHERMETHODletssaythereareN(n)waystogoupastaircasewithnsteps.ifwemakeamovewithonestep,thentherearen1stepsremainingandthereareN(n1)waystogouptheremainingsteps.ifwemakeamovewithtwosteps,thentherearen2stepsremainingandthereareN(n2)waystogouptheremainingsteps.similarlyifwemakeamovewiththreesteps,thenthereareN(n3)waystogouptheremainingsteps.thereforewehavefollowingrecurrencerelation:N(n)=N(n1)+N(n2)+N(n3)wealsohaveN(1)=1N(2)=2N(3)=4applyingtherecurrencerelationabove,wegetN(4)=7N(5)=13N(6)=24N(7)=44N(8)=81N(9)=149N(10)=274N(11)=504N(12)=927N(13)=1705N(14)=3136N(15)=5768N(16)=10609N(17)=19513N(18)=35890N(19)=66012N(20)=121415wecanalsofindaclosedformulaforN(n)bysolvingfollowingcharacteristicequationλ3λ2λ1=0letλ=s+13s243s3827=0withu=333+193,v=333193λ1=13(1+uv)λ2,3=16[2u+v±3(u+v)i]N(n)=Aλ1n+Bλ2n+Cλ3nN(0)=N(3)N(2)N(1)=1N(1)=N(2)N(1)N(0)=0N(1)=Aλ1+Bλ2+Cλ3=1N(0)=A+B+C=1N(1)=Aλ1+Bλ2+Cλ3=0[λ1λ2λ31111λ11λ21λ3](ABC)=(110)(ABC)=[λ1λ2λ31111λ11λ21λ3]1(110)

Leave a Reply

Your email address will not be published. Required fields are marked *