you give permutation n number p1p2pn we perform k operation follow type choose uniformly random index l r lr reverse order element plpl1pr your task find expect value number inversion result permutation