Question: An unsual mapping(table)

I have two lists viz.

m:=[0,1,2,3,4,5]; n:=[0,1,2,3,4,5,6,7,8,9];

I have to define a mapping (i.e. a Maple table) say `p` such that

(1) p(0)=0,

(2) p(max(m))=p(max(n)) and

(3) For all other i in m p(i) is a random choice from n but with condition that p(i)>=p(i-1).

Help is desperately needed. regards

Please Wait...