#OK to post homework #Zidong Zhang, 28/2/2021, Assignment 10 #Inv(N):the number of inversion, denoted by inv(¦Ð), is the number of pairs 1 ¡Ü i < j ¡Ü n such ¦Ð[i] > ¦Ð[j][For example inv(631425)=8] Inv := proc(N) local i , j , n , count ,m , L, k, c, b: n := convert(N , base , 10): count := 0: for i from 1 to nops(n)-1 do for j from i+1 to nops(n) do if n[i] ¦Ð[i+1] [For example inv(631425)=3] Des := proc(N) local n , i, count : n := convert(N, base , 10): count := 0: for i from 1 to nops(n)-1 do if n[i] < n[i+1] then count := count +1: fi: od: count: end: #Maj(N):The major index, denoted by maj(¦Ð), is the SUM of the places i, such that ¦Ð[i] > ¦Ð[i+1] [For example maj(631425)=1+2+4=7] Maj := proc(N) local n , su, i: n:= convert(N , base , 10): su:=0: for i from 1 to nops(n)-1 do if n[i]