#`Please do not post homework` #`Jiecheng Guo, 09.14.2020, Assignment 2` #question1 #`if a = 0 and b = 0, then F(a,b,c) = 1. If a = 0 and c = 0, then F(a,b,c) = 1. If b = 0 and c = 0, then F(a,b,c) = 1.` #`F(a,b,c-1) = F(a+b+c-1)!/(a!*b!*`(c-1)!), F(a,b-1,c) = F(a+b+c-1)!/(a!*(b-1)!*c!), and F(a-1,b,c) = F(a+b+c-1)!/((a-1)!*b!*c!). #` F(a,b,c)=F(a,b,c-1)+F(a,b-1,c)+F(a-1,b,c)=(a+b+c-1)!/(a!b!(c-1)!)+(a+b+c-1)!/(a!(b-1)!c!)+(a+b+c-1)!/((a-1)!b!c!` #` (a+b+c-1)!/(a(a-1)!b(b-1)!(c-1)!)+(a+b+c-1)!/(a(a-1)!(b-1)!c(c-1)!)+(a+b+c-1)!/((a-1)!b(b-1)!c(c-1)!)` #` (a+b+c-1)!/((a-1)!(b-1)!(c-1)!)(1/ab+1/ac+1/bc)` #` (a+b+c-1)!/((a-1)!(b-1)!(c-1)!)((c+b+a)/abc)` #` (a+b+c!)/(a!b!c!) ` #question2 #The number of walks in the k-dimensional Manhattan lattice from (0,0,...,0) to (a[i],a[2],...,a[3]) is as the same number of words in the alphabet {1,2,...,k} with the letter i showing up exactly a[i] times because different letters in the alphabet are essentially different dimensions, with additional repetitions of a letter i being like additional steps in the ith direction. #question3 #` The explicit formula is (a[1]+...a[k])! / (a[1]!*...*a[k]!)Let S = sum(a[i],i=1..k)` #` Since a[1] represents the number of occurences of the letter '1'. a[2] ` #` represents the number of occurences of the letter '2', etc.` #` We can say that the posssible choices for a[1] is binomial (S, a[1]), ` #` and after removing letters '1', a[2] as binomial(S-a[1], a[2]), etc.` #` Thus we get that for all a[i] from 1 to k, we get that for all occurences of a[i] as ` #`binomial(S,a[1])*binomial`(S-a[1],a[2])*binomial(S-a[1]-a[2],a[3])*...*binomial(S-a[1]-a[2]-a[3]-...-a[k-1], a[k]) #`= S!/((S-a[1])!*`(a[1])!)*(S-a[1])!/((S-a[1]-a[2])!*(a[2])!)*...*(S-a[1]-a[2]-...-a[k-1])!/((S-a[1]-a[2]-...-a[k])!(a[k])!) #` Since we can cancel out the numerator and denominator for most of this equation, we get` #` = S!/(a[1]!a[2]!a[3]!...a[k]!)` #question4 #`from maple code 1 ` RestrictedWalks :=proc(m,n,s) local W1,W2,w1,w2,curr: option remember: if m < 0 or n < 0 then RETURN({}); end if: curr := [m, n] if member(curr, s) then RETURN({}); end if: if m = 0 and n = 0 then RETURN({[]}); end if: W1 := RestrictedWalks(m - 1, n, s): W2 := RestrictedWalks(m, n - 1, s): {seq([op(w1), E], w1 in W1), seq([op(w2), N], w2 in W2)}: end: #question5 #from maple code 1 RestrictedNuWalks := proc(m,n,s) local W1,W2,curr: option remember: if m < 0 or n < 0 then RETURN(0); end if: curr := [m, n]: if m = 0 and n = 0 and member(curr, s) then RETURN(0); end if: if m = 0 and n = 0 then RETURN(1); end if: if member(curr, s) then RETURN(0); end if: W1 := RestrictedNuWalks(m - 1, n, s): W2 := RestrictedNuWalks(m, n - 1, s): W1 + W2: end: