#ATTENDANCE QUIZ FOR LECTURE 2 of Dr. Z.'s Math454(02) Rutgers University # Please Edit this .txt page with Answers #Email ShaloshBEkhad@gmail.com #Subject: p2 #with an attachment called #p2FirstLast.txt #(e.g. p2DoronZeilberger.txt) #Right after finishing watching the Second lecture but no later than Friday, Sept. 11, 2020, 8:00pm Q1. THE FIRST ATTENDANCE QUESTION WAS: How many walks in Manhattan are there (not using BDWAY) from corner of min(1,8) ave and min(0,4) ave to corner of max(1,8) ave and max(0,4) ave. Walking in positive direction. A1. MY ANSWER TO THE FIRST ATTENDANCE QUESTION IS: Walks := proc(m, n) local W1, W2, w1, w2; option remember; if m < 0 or n < 0 then RETURN({}); end if; if m = 0 and n = 0 then RETURN({[]}); end if; W1 := Walks(m - 1, n); W2 := Walks(m, n - 1); {seq([op(w1), E], w1 in W1), seq([op(w2), N], w2 in W2)}; end proc; Walks(1, 8); {[E, N, N, N, N, N, N, N, N], [N, E, N, N, N, N, N, N, N], [N, N, E, N, N, N, N, N, N], [N, N, N, E, N, N, N, N, N], [N, N, N, N, E, N, N, N, N], [N, N, N, N, N, E, N, N, N], [N, N, N, N, N, N, E, N, N], [N, N, N, N, N, N, N, E, N], [N, N, N, N, N, N, N, N, E]} 9 walks is the answer. Q2. THE SECOND ATTENDANCE QUESTION WAS: Consider RUID as a word of 9 words in the 10-letter "ALPHABET" {0,1,...,9} How many rearrangements for RUID? A2. MY ANSWER TO THE SECOND ATTENDANCE QUESTION IS: NuW := proc(L) local k, i; option remember; k := nops(L); if min(op(L)) < 0 then 0; elif L = [0 $ k] then 1; else add(NuW([op(1 .. i - 1, L), L[i] - 1, op(i + 1 .. k, L)]), i = 1 .. k); end if; end proc; #RUID:183004339 NuW([1, 1, 3, 2, 1, 1]); 30240