Basic Examples (3)
Basic Examples
(3)
Consider the permutation:
In[147]:=
p={2,8,1,5,4,7,6,3,9};
Its ascents are at the indices 1, 3, 5, 8, corresponding to , , , :
2<8
1<5
4<7
3<9
In[190]:=
Out[190]=
{1,3,5,8}
The descents follow easily:
In[208]:=
ReverseLength@p-@Reverse@p
Out[208]=
{2,4,6,7}
Possible Issues (4)
Possible Issues
(4)